This page is part of the FHIR Specification (v1.6.0: STU 3 Ballot 4). 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
StructureDefinition for Reference
{ "resourceType": "StructureDefinition", "id": "Reference", "meta": { "lastUpdated": "2016-08-11T17:02:54.322+10:00" }, "text": { "status": "generated", "div": "<div>!-- Snipped for Brevity --></div>" }, "url": "http://hl7.org/fhir/StructureDefinition/Reference", "name": "Reference", "status": "draft", "publisher": "HL7 FHIR Standard", "contact": [ { "telecom": [ { "system": "other", "value": "http://hl7.org/fhir" } ] } ], "date": "2016-08-11T17:02:54+10:00", "description": "Base StructureDefinition for Reference Type", "fhirVersion": "1.6.0", "mapping": [ { "identity": "rim", "uri": "http://hl7.org/v3", "name": "RIM Mapping" } ], "kind": "complex-type", "abstract": false, "type": "Reference", "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Element", "derivation": "specialization", "snapshot": { "element": [ { "id": "Reference", "path": "Reference", "short": "A reference from one resource to another", "definition": "A reference from one resource to another.", "min": 0, "max": "*", "condition": [ "ele-1" ], "constraint": [ { "key": "ele-1", "severity": "error", "human": "All FHIR elements must have a @value or children", "expression": "children().count() > id.count()", "xpath": "@value|f:*|h:div" }, { "key": "ref-1", "severity": "error", "human": "SHALL have a local reference if the resource is provided inline", "expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))", "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" } ], "mapping": [ { "identity": "rim", "map": "n/a" }, { "identity": "rim", "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)" } ] }, { "id": "Reference.id", "path": "Reference.id", "representation": [ "xmlAttr" ], "short": "xml:id (or equivalent in JSON)", "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", "min": 0, "max": "1", "base": { "path": "Element.id", "min": 0, "max": "*" }, "type": [ { "code": "string" } ], "mapping": [ { "identity": "rim", "map": "n/a" } ] }, { "id": "Reference.extension", "path": "Reference.extension", "short": "Additional Content defined by implementations", "definition": "May be used to represent additional information that is not part of the basic definition of the element. In order 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.", "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.", "alias": [ "extensions", "user content" ], "min": 0, "max": "*", "base": { "path": "Element.extension", "min": 0, "max": "*" }, "type": [ { "code": "Extension" } ], "mapping": [ { "identity": "rim", "map": "n/a" } ] }, { "id": "Reference.reference", "path": "Reference.reference", "short": "Relative, internal or absolute URL 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.", "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.", "min": 0, "max": "1", "type": [ { "code": "string" } ], "condition": [ "ref-1" ], "isSummary": true, "mapping": [ { "identity": "rim", "map": "N/A" } ] }, { "id": "Reference.display", "path": "Reference.display", "short": "Text alternative for the resource", "definition": "Plain text narrative that identifies the resource in addition to the resource reference.", "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.", "min": 0, "max": "1", "type": [ { "code": "string" } ], "isSummary": true, "mapping": [ { "identity": "rim", "map": "N/A" } ] } ] }, "differential": { "element": [ { "id": "Reference", "path": "Reference", "short": "A reference from one resource to another", "definition": "A reference from one resource to another.", "min": 0, "max": "*", "constraint": [ { "key": "ref-1", "severity": "error", "human": "SHALL have a local reference if the resource is provided inline", "expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))", "xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" } ], "mapping": [ { "identity": "rim", "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)" } ] }, { "id": "Reference.reference", "path": "Reference.reference", "short": "Relative, internal or absolute URL 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.", "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.", "min": 0, "max": "1", "type": [ { "code": "string" } ], "condition": [ "ref-1" ], "isSummary": true, "mapping": [ { "identity": "rim", "map": "N/A" } ] }, { "id": "Reference.display", "path": "Reference.display", "short": "Text alternative for the resource", "definition": "Plain text narrative that identifies the resource in addition to the resource reference.", "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.", "min": 0, "max": "1", "type": [ { "code": "string" } ], "isSummary": true, "mapping": [ { "identity": "rim", "map": "N/A" } ] } ] } }
Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.