Release 4 5

This page is part of the FHIR Specification (v4.0.1: R4 (v5.0.0: R5 - Mixed Normative and STU ) ). This is the current published version in it's permanent home (it will always be available at this URL). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

2.27 2.1.27.6 DomainResource Resource

This page has been approved as part of an ANSI standard. See the Infrastructure Package for further details.
http://www.hl7.org/Special/committees/fiwg/index.cfm FHIR Infrastructure icon Work Group Maturity Level : N   Normative (from v4.0.0) Security Category : N/A Compartments : Not linked to any No defined compartments

A domain resource is a resource that:

As an abstract resource, this resource is never created directly; instead, one of its descendant resources ( see List of Resources ) is created.

This resource extends the base Resource . All of the listed Resources except Bundle , Parameters and Binary extend this resource.

Structure

Name Flags Card. Type Description & Constraints doco
. . DomainResource I «A» N Resource A resource with narrative, extensions, and contained resources
+ Rule: If the resource is contained in another resource, it SHALL NOT contain nested Resources
+ Rule: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource
+ Rule: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
+ Rule: If a resource is contained in another resource, it SHALL NOT have a security label
+ Guideline: A resource should have narrative for robust management

Elements defined in Ancestors: id , meta , implicitRules , language
. . . text C 0..1 Narrative Text summary of the resource, for human interpretation
. . . contained C 0..* Resource Contained, inline Resources

. . . extension 0..* Extension Additional content defined by implementations


doco Documentation for this format icon

UML Diagram ( Legend )

DomainResource ( Resource ) A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety text : Narrative [0..1] « This element has or is affected by some invariants C » These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning contained : Resource [0..*] « This element has or is affected by some invariants C » May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension extension : Extension [0..*] May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself) (this element modifies the meaning of other elements) modifierExtension : Extension [0..*]
XML Template < <!-- from Element: --> <</text> <</contained> <</extension> <<a href="domainresource-definitions.html#DomainResource.modifierExtension" title="May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself) (this element modifies the meaning of other elements)" class="dict"></modifierExtension> </[name]> JSON Template { "resourceType" : "", // from " " () () } Turtle Template @prefix fhir: <http://hl7.org/fhir/> . [ a fhir:; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Element: fhir: fhir: fhir: fhir:<a href="domainresource-definitions.html#DomainResource.modifierExtension" title="May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself) (this element modifies the meaning of other elements)" class="dict"> ]

Structure

Name Flags Card. Type Description & Constraints doco
. . DomainResource I «A» N Resource A resource with narrative, extensions, and contained resources
+ Rule: If the resource is contained in another resource, it SHALL NOT contain nested Resources
+ Rule: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource
+ Rule: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
+ Rule: If a resource is contained in another resource, it SHALL NOT have a security label
+ Guideline: A resource should have narrative for robust management

Elements defined in Ancestors: id , meta , implicitRules , language
. . . text C 0..1 Narrative Text summary of the resource, for human interpretation
. . . contained C 0..* Resource Contained, inline Resources

. . . extension 0..* Extension Additional content defined by implementations


doco Documentation for this format icon

UML Diagram ( Legend )

DomainResource ( Resource ) A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety text : Narrative [0..1] « This element has or is affected by some invariants C » These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning contained : Resource [0..*] « This element has or is affected by some invariants C » May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension extension : Extension [0..*] May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself) (this element modifies the meaning of other elements) modifierExtension : Extension [0..*]
XML Template < <!-- from Element: --> <</text> <</contained> <</extension> <<a href="domainresource-definitions.html#DomainResource.modifierExtension" title="May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself) (this element modifies the meaning of other elements)" class="dict"></modifierExtension> </[name]>

JSON Template  

{ "resourceType" : "", // from " " () () }

Additional definitions: Master Definition XML + JSON + ShEx , the spreadsheet version & the dependency analysis , Resource Representation XML + JSON + Turtle Template

@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Element: fhir: fhir: fhir: fhir:<a href="domainresource-definitions.html#DomainResource.modifierExtension" title="May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself) (this element modifies the meaning of other elements)" class="dict"> ]
id UniqueKey Level Location Description Expression
dom-2 img  dom-2 Rule (base) If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 img  dom-3 Rule (base) If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) %resource.descendants().ofType(canonical) | %resource.descendants().as(uri) %resource.descendants().ofType(uri) | %resource.descendants().as(url))) %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) descendants().where(ofType(canonical) = '#').exists() or descendants().where(as(canonical) descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
dom-4 img  dom-4 Rule (base) If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
dom-5 img  dom-5 Rule (base) If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 img  dom-6 Guideline (base) A resource should have narrative for robust management text.`div`.exists()
This is (only) a best practice guideline because:

When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time.


To search for extensions, define The 'contained' mechanism is not permitted as a SearchParameter means of reducing server calls. I.e., It is not allowed to package a set of resources as one base resource and a set of contained resources to allow multiple creates or updates to happen in a single transaction, nor is it permitted to use 'contained' as a means of retrieving multiple resources in a single 'read'.

'contained' is only for use when there is a need to reference another resource, but the extension. All other search parameters are named aliases for existing content in target resource does not have any independence from the referencing resource. Most commonly, this occurs when not enough information is known to allow uniquely identifying the target resource. For example, if a surgeon is known only as "Dr. Smith" (no full name, no license number, etc.), then there would be no way of determining which of the candidate "Dr. Smith" practitioners was being referenced. In some that situation, it would be reasonable for the Procedure to have a 'contained' reference to the Practitioner.

In other cases, though there might be enough information to construct an independent resource, but system behavior does not all, recognize/permit an independent identity. As an example, a prescriber might create a prescription for a custom compound. However, rather than registering the search parameter name is compound as a new 'Medication' instance (that could be pointed to by many prescriptions/dispenses), the same system treats the compound recipe as 'part' of the element prescription - it can only be edited/modified in the context of that one prescription and cannot be queried or manipulated independently. If the prescription were deleted, the Medication would be deleted as well. This would be an appropriate use of 'contained'.

A key consideration with respect to 'contained' resources is that if a resource is sent to a server as 'contained', then it searches, but this is not required. expected to remain 'contained' (at least until a formal update is received that removes the 'contained' resource and perhaps replaces it with a reference to a stand-alone resource due to additional information now being available).

For implementations concerned about minimizing the number of service calls, FHIR provides a number of options:

  • When sending creates or updates, leverage the transaction feature to create/update multiple (interrelated) resources at once
  • When querying for data, make use of _include and _revinclude to return additional resources that are relevant as part of the query
  • Operations can be defined that allow manipulation or retrieval of multiple resources as part of a single action.
  • The document and messaging paradigms also support the simultaneous transport of multiple resources.

REST can be somewhat heavy in terms of the number of service calls needed to manipulate all desired resources. This is part of the cost associated with the flexibility that allows a single RESTful interface to support a wide range of use-cases.

The FHIR specification does not define SearchParameters for most of the standard extensions is we publish and obviously cannot define SearchParameters for extensions developed by implementers outside the same - core FHIR specification. However, implementers are free to define a their own SearchParameters for any extensions they make use of and servers are free to support SearchParameters above and beyond those published as part of the FHIR core specification. There are no formal naming rules for extension-based search parameters. Authors SHOULD name the search parameters in such a way that identifies the value linkage between the extension by its URL, name and then searches can filter based on the value of search parameter is obvious.

The expression for the extension. search parameter would typically end with extension('http://yourextensionurlhere').value . The expression would also need to provide a path to the extension, including handling situations where an extension appears on multiple paths if necessary. Additional constraints could also be added if necessary (e.g. .exists(), =true , etc.)

Common search Search parameters defined by this resource. abstract resource for all descendents. See Searching for more information about searching in REST, messaging, and services.

Name Type Description Paths
_text string special Search on the narrative of the resource