This page is part of the FHIR Specification (v4.3.0: R4B - STU). 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
http://www.hl7.org/Special/committees/fiwg/index.cfm | Maturity Level: N | Normative (from v4.0.0) | Compartments: Not linked to any defined compartments |
This page has been approved as part of an ANSI standard. See the Infrastructure Package for further details. |
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 |
---|---|---|---|---|
DomainResource | «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 | 0..1 | Narrative | Text summary of the resource, for human interpretation | |
contained | I | 0..* | Resource | Contained, inline Resources + Warning: Containing new R4B resources within R4 resources may cause interoperability issues if instances are shared with R4 systems |
extension | 0..* | Extension | Additional content defined by implementations | |
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored |
Documentation for this format |
UML Diagram (Legend)
XML Template
<[name] xmlns="http://hl7.org/fhir"> <!-- from Element: extension --> <text><!-- 0..1 Narrative Text summary of the resource, for human interpretation --></text> <contained><!-- 0..* Resource Contained, inline Resources --></contained> <extension><!-- 0..* Extension Additional content defined by implementations --></extension> <modifierExtension><!-- 0..* Extension Extensions that cannot be ignored --></modifierExtension> </[name]>
JSON Template
{ "resourceType" : "[name]", // from Resource: id, meta, implicitRules, and language "text" : { Narrative }, // Text summary of the resource, for human interpretation "contained" : [{ Resource }], // Contained, inline Resources (Extensions - see JSON page) (Modifier Extensions - see JSON page) }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:[name]; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Element: Element.extension fhir:DomainResource.text [ Narrative ]; # 0..1 Text summary of the resource, for human interpretation fhir:DomainResource.contained [ Resource ], ... ; # 0..* Contained, inline Resources fhir:DomainResource.extension [ Extension ], ... ; # 0..* Additional content defined by implementations fhir:DomainResource.modifierExtension [ Extension ], ... ; # 0..* Extensions that cannot be ignored ]
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
DomainResource | «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 | 0..1 | Narrative | Text summary of the resource, for human interpretation | |
contained | I | 0..* | Resource | Contained, inline Resources + Warning: Containing new R4B resources within R4 resources may cause interoperability issues if instances are shared with R4 systems |
extension | 0..* | Extension | Additional content defined by implementations | |
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored |
Documentation for this format |
XML Template
<[name] xmlns="http://hl7.org/fhir"> <!-- from Element: extension --> <text><!-- 0..1 Narrative Text summary of the resource, for human interpretation --></text> <contained><!-- 0..* Resource Contained, inline Resources --></contained> <extension><!-- 0..* Extension Additional content defined by implementations --></extension> <modifierExtension><!-- 0..* Extension Extensions that cannot be ignored --></modifierExtension> </[name]>
JSON Template
{ "resourceType" : "[name]", // from Resource: id, meta, implicitRules, and language "text" : { Narrative }, // Text summary of the resource, for human interpretation "contained" : [{ Resource }], // Contained, inline Resources (Extensions - see JSON page) (Modifier Extensions - see JSON page) }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:[name]; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Element: Element.extension fhir:DomainResource.text [ Narrative ]; # 0..1 Text summary of the resource, for human interpretation fhir:DomainResource.contained [ Resource ], ... ; # 0..* Contained, inline Resources fhir:DomainResource.extension [ Extension ], ... ; # 0..* Additional content defined by implementations fhir:DomainResource.modifierExtension [ Extension ], ... ; # 0..* Extensions that cannot be ignored ]
id | Level | Location | Description | Expression |
dom-2 | Rule | (base) | If the resource is contained in another resource, it SHALL NOT contain nested Resources | contained.contained.empty() |
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.exists() and ('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url)))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(uri) = '#').exists()).not()).trace('unmatched', id).empty() |
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 | Rule | (base) | If a resource is contained in another resource, it SHALL NOT have a security label | contained.meta.security.empty() |
dom-6 | Guideline | (base) | A resource should have narrative for robust management | text.`div`.exists() This is (only) a best practice guideline because:
|
dom-r4b | Warning | DomainResource.contained | Containing new R4B resources within R4 resources may cause interoperability issues if instances are shared with R4 systems | ($this is Citation or $this is Evidence or $this is EvidenceReport or $this is EvidenceVariable or $this is MedicinalProductDefinition or $this is PackagedProductDefinition or $this is AdministrableProductDefinition or $this is Ingredient or $this is ClinicalUseDefinition or $this is RegulatedAuthorization or $this is SubstanceDefinition or $this is SubscriptionStatus or $this is SubscriptionTopic) implies (%resource is Citation or %resource is Evidence or %resource is EvidenceReport or %resource is EvidenceVariable or %resource is MedicinalProductDefinition or %resource is PackagedProductDefinition or %resource is AdministrableProductDefinition or %resource is Ingredient or %resource is ClinicalUseDefinition or %resource is RegulatedAuthorization or %resource is SubstanceDefinition or %resource is SubscriptionStatus or %resource is SubscriptionTopic) |
To search for extensions, define a SearchParameter for the extension. All other search parameters are named aliases for existing content in the resource. In some cases, though not all, the search parameter name is the same as the element that it searches, but this is not required. Searching for extensions is the same - define a name that identifies the value extension by its URL, and then searches can filter based on the value of the extension.
Common search parameters defined by this resource. See Searching for more information about searching in REST, messaging, and services.
Name | Type | Description | Paths |
_text | string | Search on the narrative of the resource |