Virtually Healthcare HL7 FHIR Implementation Guide
0.1.0-current - ci-build United Kingdom flag

Virtually Healthcare HL7 FHIR Implementation Guide, published by Virtually Healthcare. This guide is not an authorized publication; it is the continuous build for version 0.1.0-current built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/Virtually-Healthcare/Virtually-Healthcare-FHIR-Implementation-Guide/ and changes regularly. See the Directory of published versions

Data Type Profile: ReferenceRestOrLogical - Detailed Descriptions

Draft as of 2024-11-06

Definitions for the reference-rest-or-logical data type profile.

Guidance on how to interpret the contents of this table can be found here

0. Reference
InvariantsPA-ident-1: reference or identifier must be present (reference.exists() or identifier.exists())
PA-ident-2: If reference is not present, display must be present (reference.exists().not() implies display.exists())
2. Reference.reference
Must Supporttrue
4. Reference.identifier
NoteThis is a business identifier, not a resource identifier (see discussion)
Must Supporttrue
6. Reference.identifier.system
Pattern Valuehttp://hl7.org/fhir/sid/us-npi
8. Reference.identifier.value
Control1..?
Must Supporttrue
10. Reference.display
Must Supporttrue

Guidance on how to interpret the contents of this table can be found here

0. Reference
Definition

A reference from one resource to another.

ShortA reference from one resource to another
Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

Control0..*
This element is affected by the following invariants: ele-1
Is Modifierfalse
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
ref-1: SHALL have a contained resource if a local reference is provided (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')))
PA-ident-1: reference or identifier must be present (reference.exists() or identifier.exists())
PA-ident-2: If reference is not present, display must be present (reference.exists().not() implies display.exists())
ref-1: SHALL have a contained resource if a local reference is provided (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')))
2. Reference.reference
Definition

A reference to a location at which the other resource is found. The reference may be 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.

ShortLiteral reference, Relative, internal or absolute URL
Comments

Using 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.

Control0..1
This element is affected by the following invariants: ref-1, PA-ident-1, PA-ident-2
Typestring
Is Modifierfalse
Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
Must Supporttrue
Summarytrue
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
4. Reference.identifier
Definition

An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.

ShortLogical reference, when literal reference is not known
Comments

When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy.

When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference

Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.

Reference is intended to point to a structure that can potentially be expressed as a FHIR resource, though there is no need for it to exist as an actual FHIR resource instance - except in as much as an application wishes to actual find the target of the reference. The content referred to be the identifier must meet the logical constraints implied by any limitations on what resource types are permitted for the reference. For example, it would not be legitimate to send the identifier for a drug prescription if the type were Reference(Observation|DiagnosticReport). One of the use-cases for Reference.identifier is the situation where no FHIR representation exists (where the type is Reference (Any).

NoteThis is a business identifier, not a resource identifier (see discussion)
Control0..1
This element is affected by the following invariants: PA-ident-1
TypeIdentifier
Is Modifierfalse
Must Supporttrue
Summarytrue
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
6. Reference.identifier.use
Definition

The purpose of this identifier.

Shortusual | official | temp | secondary | old (If known)
Comments

Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.

Control0..1
BindingThe codes SHALL be taken from IdentifierUsehttp://hl7.org/fhir/ValueSet/identifier-use|4.0.1
(required to http://hl7.org/fhir/ValueSet/identifier-use|4.0.1)

Identifies the purpose for this identifier, if known .

Typecode
Is Modifiertrue because This is labeled as "Is Modifier" because applications should not mistake a temporary id for a permanent one.
Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
Summarytrue
Requirements

Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.

Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
8. Reference.identifier.system
Definition

Establishes the namespace for the value - that is, a URL that describes a set values that are unique.

ShortThe namespace for the identifier value
Comments

Identifier.system is always case sensitive.

Control0..1
Typeuri
Is Modifierfalse
Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
Summarytrue
Requirements

There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.

Pattern Valuehttp://hl7.org/fhir/sid/us-npi
Example<br/><b>General</b>:http://www.acme.com/identifiers/patient
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
10. Reference.identifier.value
Definition

The portion of the identifier typically relevant to the user and which is unique within the context of the system.

ShortThe value that is unique
Comments

If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the Rendered Value extension. Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.

Control10..1
Typestring
Is Modifierfalse
Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
Must Supporttrue
Summarytrue
Example<br/><b>General</b>:123456
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
12. Reference.display
Definition

Plain text narrative that identifies the resource in addition to the resource reference.

ShortText alternative for the resource
Comments

This 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.

Control0..1
This element is affected by the following invariants: PA-ident-2
Typestring
Is Modifierfalse
Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
Must Supporttrue
Summarytrue
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))

Guidance on how to interpret the contents of this table can be found here

0. Reference
Definition

A reference from one resource to another.

ShortA reference from one resource to another
Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

Control0..*
This element is affected by the following invariants: ele-1
Is Modifierfalse
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
ref-1: SHALL have a contained resource if a local reference is provided (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')))
PA-ident-1: reference or identifier must be present (reference.exists() or identifier.exists())
PA-ident-2: If reference is not present, display must be present (reference.exists().not() implies display.exists())
2. Reference.id
Definition

Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.

ShortUnique id for inter-element referencing
Control0..1
Typestring
Is Modifierfalse
XML FormatIn the XML format, this property is represented as an attribute.
Summaryfalse
4. Reference.extension
Definition

May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

ShortAdditional content defined by implementations
Comments

There 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 level of simplicity for everyone.

Control0..*
TypeExtension
Is Modifierfalse
Summaryfalse
Alternate Namesextensions, user content
Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
ext-1: Must have either extensions or value[x], not both (extension.exists() != value.exists())
SlicingThis element introduces a set of slices on Reference.extension. The slices areUnordered and Open, and can be differentiated using the following discriminators:
  • value @ url
  • 6. Reference.reference
    Definition

    A reference to a location at which the other resource is found. The reference may be 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.

    ShortLiteral reference, Relative, internal or absolute URL
    Comments

    Using 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.

    Control0..1
    This element is affected by the following invariants: ref-1, PA-ident-1, PA-ident-2
    Typestring
    Is Modifierfalse
    Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
    Must Supporttrue
    Summarytrue
    Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
    8. Reference.type
    Definition

    The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.

    The type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. "Patient" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).

    ShortType the reference refers to (e.g. "Patient")
    Comments

    This element is used to indicate the type of the target of the reference. This may be used which ever of the other elements are populated (or not). In some cases, the type of the target may be determined by inspection of the reference (e.g. a RESTful URL) or by resolving the target of the reference; if both the type and a reference is provided, the reference SHALL resolve to a resource of the same type as that specified.

    Control0..1
    BindingUnless not suitable, these codes SHALL be taken from ResourceType
    (extensible to http://hl7.org/fhir/ValueSet/resource-types)

    Aa resource (or, for logical models, the URI of the logical model).

    Typeuri
    Is Modifierfalse
    Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
    Summarytrue
    Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
    10. Reference.identifier
    Definition

    An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.

    ShortLogical reference, when literal reference is not known
    Comments

    When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy.

    When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference

    Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.

    Reference is intended to point to a structure that can potentially be expressed as a FHIR resource, though there is no need for it to exist as an actual FHIR resource instance - except in as much as an application wishes to actual find the target of the reference. The content referred to be the identifier must meet the logical constraints implied by any limitations on what resource types are permitted for the reference. For example, it would not be legitimate to send the identifier for a drug prescription if the type were Reference(Observation|DiagnosticReport). One of the use-cases for Reference.identifier is the situation where no FHIR representation exists (where the type is Reference (Any).

    NoteThis is a business identifier, not a resource identifier (see discussion)
    Control0..1
    This element is affected by the following invariants: PA-ident-1
    TypeIdentifier
    Is Modifierfalse
    Must Supporttrue
    Summarytrue
    Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
    12. Reference.identifier.id
    Definition

    Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.

    ShortUnique id for inter-element referencing
    Control0..1
    Typestring
    Is Modifierfalse
    XML FormatIn the XML format, this property is represented as an attribute.
    Summaryfalse
    14. Reference.identifier.extension
    Definition

    May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

    ShortAdditional content defined by implementations
    Comments

    There 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 level of simplicity for everyone.

    Control0..*
    TypeExtension
    Is Modifierfalse
    Summaryfalse
    Alternate Namesextensions, user content
    Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
    ext-1: Must have either extensions or value[x], not both (extension.exists() != value.exists())
    SlicingThis element introduces a set of slices on Reference.identifier.extension. The slices areUnordered and Open, and can be differentiated using the following discriminators:
    • value @ url
    • 16. Reference.identifier.use
      Definition

      The purpose of this identifier.

      Shortusual | official | temp | secondary | old (If known)
      Comments

      Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.

      Control0..1
      BindingThe codes SHALL be taken from IdentifierUse
      (required to http://hl7.org/fhir/ValueSet/identifier-use|4.0.1)

      Identifies the purpose for this identifier, if known .

      Typecode
      Is Modifiertrue because This is labeled as "Is Modifier" because applications should not mistake a temporary id for a permanent one.
      Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
      Summarytrue
      Requirements

      Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.

      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
      18. Reference.identifier.type
      Definition

      A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.

      ShortDescription of identifier
      Comments

      This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.

      Control0..1
      BindingUnless not suitable, these codes SHALL be taken from Identifier Type Codes
      (extensible to http://hl7.org/fhir/ValueSet/identifier-type)

      A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.

      TypeCodeableConcept
      Is Modifierfalse
      Summarytrue
      Requirements

      Allows users to make use of identifiers when the identifier system is not known.

      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
      20. Reference.identifier.system
      Definition

      Establishes the namespace for the value - that is, a URL that describes a set values that are unique.

      ShortThe namespace for the identifier value
      Comments

      Identifier.system is always case sensitive.

      Control0..1
      Typeuri
      Is Modifierfalse
      Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
      Summarytrue
      Requirements

      There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.

      Pattern Valuehttp://hl7.org/fhir/sid/us-npi
      Example<br/><b>General</b>:http://www.acme.com/identifiers/patient
      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
      22. Reference.identifier.value
      Definition

      The portion of the identifier typically relevant to the user and which is unique within the context of the system.

      ShortThe value that is unique
      Comments

      If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the Rendered Value extension. Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.

      Control1..1
      Typestring
      Is Modifierfalse
      Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
      Must Supporttrue
      Summarytrue
      Example<br/><b>General</b>:123456
      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
      24. Reference.identifier.period
      Definition

      Time period during which identifier is/was valid for use.

      ShortTime period when id is/was valid for use
      Control0..1
      TypePeriod
      Is Modifierfalse
      Summarytrue
      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
      26. Reference.identifier.assigner
      Definition

      Organization that issued/manages the identifier.

      ShortOrganization that issued id (may be just text)
      Comments

      The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.

      Control0..1
      TypeReference(Organization)
      Is Modifierfalse
      Summarytrue
      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))
      28. Reference.display
      Definition

      Plain text narrative that identifies the resource in addition to the resource reference.

      ShortText alternative for the resource
      Comments

      This 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.

      Control0..1
      This element is affected by the following invariants: PA-ident-2
      Typestring
      Is Modifierfalse
      Primitive ValueThis primitive element may be present, or absent, or replaced by an extension
      Must Supporttrue
      Summarytrue
      Invariantsele-1: All FHIR elements must have a @value or children (hasValue() or (children().count() > id.count()))