This page is part of the FHIR Specification (v0.0.82: DSTU 1). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

1.12.7 Resource Definitions - Formal Definitions

1.12.7.1 Resource

Resource
Control1..1
InvariantsDefined on this element
Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative (xpath: not(parent::f:contained and f:text))
Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources (xpath: not(parent::f:contained and f:contained))
Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource (xpath: exists(for $id in f:contained/*/@id return $id[not(descendant::f:reference/@value=concat('#', $id))]))
Resource.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict 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.
Control0..*
TypeExtension
Aliasesextensions; user content
Commentsthere can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone.
Resource.modifierExtension
DefinitionMay 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. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict 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.
Control0..*
TypeExtension
Aliasesextensions; user content
Commentsthere can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone.
Resource.language
DefinitionThe base language in which the resource is written.
Control0..1
Typecode
CommentsLanguage is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).
Resource.text
DefinitionA human-readable narrative that contains a summary of the resource, and may 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.
Control0..1
TypeNarrative
Aliasesnarrative; html; xhtml; display
CommentsContained resources do not have narrative. Resources that are not contained SHOULD have a narrative.
InvariantsAffect this element
Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative (xpath: not(parent::f:contained and f:text))
Resource.contained
DefinitionThese 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.
Control0..*
TypeResource
Aliasesinline resources; anonymous resources; contained resources
CommentsThis should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again.

1.12.7.2 ResourceReference

ResourceReference
DefinitionA reference from one resource to another.
Control1..1
InvariantsDefined on this element
Inv-1: SHALL have a local reference if the resource is provided inline (xpath: not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[@id=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[@id=substring-after(current()/f:reference/@value, '#')]))
ResourceReference.reference
DefinitionA reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.
Control0..1
Typestring
CommentsUsing absolute URLs provides a stable scalable approach suitable for a cloud/web context, while using relative/logical references provides a flexible approach suitable for use when trading across closed eco-system boundaries. Absolute URLs do not need to point to a FHIR RESTful server, though this is the preferred approach. If the url conforms to the structure "/[type]/@[id]" then it should be assumed that the reference is to a FHIR RESTful server.
InvariantsAffect this element
Inv-1: SHALL have a local reference if the resource is provided inline (xpath: not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[@id=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[@id=substring-after(current()/f:reference/@value, '#')]))
ResourceReference.display
DefinitionPlain text narrative that identifies the resource in addition to the resource reference.
Control0..1
Typestring
CommentsThis is generally not the same as the Resource.text of the referenced resource. The purpose is to identify what's being referenced, not to fully describe it.

1.12.7.3 Narrative

Narrative
DefinitionA human-readable formatted text, including images.
Control1..1
Narrative.status
DefinitionThe status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.
Control1..1
BindingNarrativeStatus: The status of a resource narrative (see http://hl7.org/fhir/narrative-status for values)
Typecode
Narrative.div
DefinitionThe actual narrative content, a stripped down version of XHTML.
Control1..1
Typexhtml
CommentsThe contents of the html element are an XHTML fragment containing only the basic html formatting elements described in chapters 7-11 and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained stylesheets. The XHTML content may not contain a head, a body, external stylesheet references, scripts, forms, base/link/xlink, frames, iframes and objects.
InvariantsDefined on this element
Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes (xpath: not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]))
Inv-2: The narrative SHALL have some non-whitespace content (xpath: descendant::text()[normalize-space(.)!=''] or descendant::html:img[@src])
Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes (xpath: not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))]))

1.12.7.4 Extension

Extension
DefinitionOptional Extensions Element - found in all resources.
Control1..1
RequirementsThe ability to add extensions in a structured way is what keeps FHIR resources simple.
Extension.url
DefinitionSource of the definition for the extension code - a logical name or a URL.
Control1..1
Typeuri
CommentsThe definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition should be version specific. This will ideally be the URI for the Resource Profile defining the extension, with the code for the extension after a #.
Extension.value[x]
DefinitionValue of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).
Control0..1
Type*

comments powered by Disqus