Data Model Libraries
    Preparing search index...

    Reference Class

    Base StructureDefinition for Reference Type: A reference from one resource to another.

    FHIR Specification

    • Short: A reference from one resource to another
    • Definition: A reference from one resource to another.
    • Comment: 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.
    • FHIR Version: 4.0.1; Normative since 4.0.0

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    reference?: any

    Reference.reference Element

    FHIR Specification

    • Short: Literal reference, Relative, internal or absolute URL
    • 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.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: true
    type_?: any

    Reference.type Element

    FHIR Specification

    • Short: Type the reference refers to (e.g. "Patient")
    • 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).
    • Comment: 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.
    • FHIR Type: uri
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: true
    identifier?: any

    Reference.identifier Element

    FHIR Specification

    • Short: Logical reference, when literal reference is not known
    • 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.
    • Comment: 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).
    • FHIR Type: Identifier
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: true
    display?: any

    Reference.display Element

    FHIR Specification

    • Short: Text alternative for the resource
    • Definition: Plain text narrative that identifies the resource in addition to the resource reference.
    • Comment: 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.
    • FHIR Type: string
    • Cardinality: 0..1
    • isModifier: false
    • isSummary: true

    Methods

    • Parse the provided Reference JSON to instantiate the Reference data model.

      Parameters

      • sourceJson: Value

        JSON representing FHIR Reference

      • OptionaloptSourceField: string

        Optional data source field (e.g. <complexTypeName>.<complexTypeFieldName>); defaults to Reference

      Returns undefined | Reference

      Reference data model or undefined for Reference

      JsonError tf the provided JSON is not a valid JSON object

    • Returns StringType

      the reference property value as a StringType object if defined; else an empty StringType object

    • Assigns the provided PrimitiveType value to the reference property.

      Parameters

      • element: undefined | StringType

        the reference value

      Returns this

      this

    • Returns boolean

      true if the reference property exists and has a value; false otherwise

    • Returns undefined | string

      the reference property value as a fhirString if defined; else undefined

    • Assigns the provided primitive value to the reference property.

      Parameters

      • value: undefined | string

        the reference value

      Returns this

      this

      PrimitiveTypeError for invalid primitive types

    • Returns boolean

      true if the reference property exists and has a value; false otherwise

    • Returns UriType

      the type_ property value as a UriType object if defined; else an empty UriType object

    • Assigns the provided PrimitiveType value to the type_ property.

      Parameters

      • element: undefined | UriType

        the type_ value

      Returns this

      this

    • Returns boolean

      true if the type_ property exists and has a value; false otherwise

    • Returns undefined | string

      the type_ property value as a fhirUri if defined; else undefined

    • Assigns the provided primitive value to the type_ property.

      Parameters

      • value: undefined | string

        the type_ value

      Returns this

      this

      PrimitiveTypeError for invalid primitive types

    • Returns boolean

      true if the type_ property exists and has a value; false otherwise

    • Returns Identifier

      the identifier property value as a Identifier object if defined; else an empty Identifier object

    • Assigns the provided Identifier object value to the identifier property.

      Parameters

      • value: undefined | Identifier

        the identifier object value

      Returns this

      this

    • Returns boolean

      true if the identifier property exists and has a value; false otherwise

    • Returns StringType

      the display property value as a StringType object if defined; else an empty StringType object

    • Assigns the provided PrimitiveType value to the display property.

      Parameters

      Returns this

      this

    • Returns boolean

      true if the display property exists and has a value; false otherwise

    • Returns undefined | string

      the display property value as a fhirString if defined; else undefined

    • Assigns the provided primitive value to the display property.

      Parameters

      • value: undefined | string

        the display value

      Returns this

      this

      PrimitiveTypeError for invalid primitive types

    • Returns boolean

      true if the display property exists and has a value; false otherwise

    • Returns string

      the FHIR type defined in the FHIR standard

    • Returns boolean

      true if the instance is empty; false otherwise

    • Creates a copy of the current instance.

      Returns Reference

      the a new instance copied from the current instance

    • Returns boolean

      true if the instance is a FHIR complex datatype; false otherwise

    • Returns string

      the complex or primitive data model type name (e.g., 'Period", 'StringType', `UriType', etc.)

    • Returns undefined | Value

      the JSON value or undefined if the instance is empty

    • Returns boolean

      true if the instance is a FHIR complex or primitive datatype; false otherwise

    • Returns undefined | string

      the id property value

    • Assigns the provided value to the id property.

      Parameters

      • value: undefined | string

        the id value

      Returns this

      this

      PrimitiveTypeError for invalid value

    • Returns boolean

      true if id exists and has a value; false otherwise

    • Assigns the provided array of Extension values to the extension property.

      Parameters

      • extension: undefined | IExtension[]

        array of Extensions

      Returns this

      this

    • Determines if the extension property exists.

      Parameters

      • Optionalurl: string

        the url that identifies a specific Extension

      Returns boolean

      true if an Extension has the provided url; false otherwise

      If the url is provided, determines if an Extension having the provided url exists. If the url is not provided, determines if the extension property exists and has any values.

      AssertionError for invalid url

    • Determines if the extension property exists.

      Parameters

      • url: string

        the url that identifies a specific Extension

      Returns undefined | IExtension

      an Extension having the provided url

      If the url is provided, determines if an Extension having the provided url exists. If the url is not provided, determines if the extension property exists and has any values.

      AssertionError for invalid url

    • Adds the provided Extension to the extension property array.

      Parameters

      • extension: undefined | IExtension

        the Extension value to add to the extension property array

      Returns this

      this

    • Removes the Extension having the provided url from the extension property array.

      Parameters

      • url: string

        the url that identifies a specific Extension to remove

      Returns void

      AssertionError for invalid url

    • Returns boolean

      true if and only if the data model has required fields (min cardinality > 0) and at least one of those required fields in the instance is empty; false otherwise

    • Returns boolean

      true if the instance is a FHIR resource; false otherwise

    • Returns boolean

      true if the instance is a FHIR primitive datatype; false otherwise

    • Returns boolean

      true if the instance is a FHIR primitive boolean datatype; false otherwise

    • Returns boolean

      true if the instance is a FHIR primitive string-based datatype; false otherwise

    • Returns boolean

      true if the instance is a FHIR primitive number-based datatype; false otherwise

    • Returns boolean

      true if the instance is a FHIR primitive bigint-based datatype; false otherwise

    • Returns boolean

      true if the instance is a FHIR primitive datetime-based datatype; false otherwise

    • Protected

      Copies the current instance's elements into the provided object.

      Parameters

      Returns void