{
  "resourceType": "StructureDefinition",
  "id": "Reference",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2020-05-28T08:51:22.7366509+00:00"
  },
  "url": "http://StructureDefinition.hl7fhir.cn/Reference",
  "name": "Reference",
  "title": "引用信息",
  "status": "draft",
  "fhirVersion": "4.0.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/Reference",
  "derivation": "constraint",
  "snapshot": {
    "element": [
      {
        "id": "Reference",
        "path": "Reference",
        "short": "引用类型",
        "definition": "从一个资源到另一个资源的引用",
        "comment": "引用应该是对实际FHIR资源的引用，并且应该是可解析的(允许访问控制、临时不可用等)。解析可以通过从URL检索来实现，也可以在适用的情况下通过资源类型来实现，将绝对引用作为标准URL处理并在本地注册表/存储库中查找它。",
        "min": 0,
        "max": "*",
        "base": {
          "path": "Reference",
          "min": 0,
          "max": "*"
        },
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a contained resource if a local reference is provided",
            "expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.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, '#')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Reference"
          }
        ],
        "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": "Unique id for inter-element referencing",
        "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": "1"
        },
        "type": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ],
            "code": "http://hl7.org/fhirpath/System.String"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Reference.extension",
        "path": "Reference.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "description": "Extensions are always sliced by (at least) url",
          "rules": "open"
        },
        "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. 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.",
        "comment": "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"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Reference.reference",
        "path": "Reference.reference",
        "short": "文字引用，相对，内部或绝对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.\r\n对另一个资源所在位置的引用。它是相对于服务基URL的，或者是解析到资源所在位置的绝对URL。\r\n如果引用不是指向FHIR RESTful服务器，该引用为特定的引用。内部片段引用(以“#”开头)引用包含的资源。",
        "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.\r\n\r\n使用绝对url提供了一种适合于cloud/web 上下文的稳定的可访问方式，而使用相对/逻辑引用提供了一种灵活的方法，适用于跨封闭生态系统边界进行交易。绝对url不需要指向FHIR RESTful服务器，尽管这是首选方法。如果URL符合结构“/[type]/[id]”，那么应该假定引用是指向FHIR RESTful服务器。",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.reference",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1",
          "ref-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Reference.type",
        "path": "Reference.type",
        "short": "目标类型",
        "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.\n\nThe 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).\r\n\r\n引用的预期目标类型。提供两种方式：类型和链接。链接是一个FHIR URL，类型表示该数据类型编码。绝对url只允许用于逻辑模型(并且只能用于逻辑模型中的引用，而不能用于资源)。",
        "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.\r\n\r\n此元素用于指示引用的目标的类型。这可以用于填充(或不填充)其他任何元素。在某些情况下，目标的类型可以通过检查引用(例如一个RESTful URL)或解析引用的目标来确定;如果同时提供了类型和引用，则引用应解析为指定的同一类型的资源。",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.type",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "FHIRResourceTypeExt"
            }
          ],
          "strength": "extensible",
          "description": "Aa resource (or, for logical models, the URI of the logical model).",
          "valueSet": "http://hl7.org/fhir/ValueSet/resource-types"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Reference.identifier",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Reference.identifier",
        "short": "逻辑引用 Logical reference, when literal reference is not known",
        "definition": "描述目标资源的标识符。当无法直接引用其他资源时，就会使用这种方法。可能存在的原有如下几点：\r\n1.当它所表示的实体无法通过FHIR服务器访问时。\r\n2.资源的作者无法将已知标识符转换为实际位置。没有要求引用。\r\n该标识符指向一个FHIR实例，并且该实例需要是引用所允许的FHIR资源类型。",
        "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.\r\rWhen 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\r\rApplications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.\r\rReference 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).",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.identifier",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://StructureDefinition.hl7fhir.cn/Identifier"
            ]
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CX / EI (occasionally, more often EI maps to a resource id or a URL)"
          },
          {
            "identity": "rim",
            "map": "II - The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs.  Also maps to Role[classCode=IDENT]"
          },
          {
            "identity": "servd",
            "map": "Identifier"
          },
          {
            "identity": "rim",
            "map": ".identifier"
          }
        ]
      },
      {
        "id": "Reference.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Reference.display",
        "short": "资源的文本显示",
        "definition": "Plain text narrative that identifies the resource in addition to the resource reference.\r\n除资源引用外，标识资源的纯文本叙事。",
        "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.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Reference.display",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Reference",
        "path": "Reference",
        "short": "引用类型",
        "definition": "从一个资源到另一个资源的引用",
        "comment": "引用应该是对实际FHIR资源的引用，并且应该是可解析的(允许访问控制、临时不可用等)。解析可以通过从URL检索来实现，也可以在适用的情况下通过资源类型来实现，将绝对引用作为标准URL处理并在本地注册表/存储库中查找它。"
      },
      {
        "id": "Reference.reference",
        "path": "Reference.reference",
        "short": "文字引用，相对，内部或绝对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.\r\n对另一个资源所在位置的引用。它是相对于服务基URL的，或者是解析到资源所在位置的绝对URL。\r\n如果引用不是指向FHIR RESTful服务器，该引用为特定的引用。内部片段引用(以“#”开头)引用包含的资源。",
        "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.\r\n\r\n使用绝对url提供了一种适合于cloud/web 上下文的稳定的可访问方式，而使用相对/逻辑引用提供了一种灵活的方法，适用于跨封闭生态系统边界进行交易。绝对url不需要指向FHIR RESTful服务器，尽管这是首选方法。如果URL符合结构“/[type]/[id]”，那么应该假定引用是指向FHIR RESTful服务器。"
      },
      {
        "id": "Reference.type",
        "path": "Reference.type",
        "short": "目标类型",
        "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.\n\nThe 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).\r\n\r\n引用的预期目标类型。提供两种方式：类型和链接。链接是一个FHIR URL，类型表示该数据类型编码。绝对url只允许用于逻辑模型(并且只能用于逻辑模型中的引用，而不能用于资源)。",
        "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.\r\n\r\n此元素用于指示引用的目标的类型。这可以用于填充(或不填充)其他任何元素。在某些情况下，目标的类型可以通过检查引用(例如一个RESTful URL)或解析引用的目标来确定;如果同时提供了类型和引用，则引用应解析为指定的同一类型的资源。"
      },
      {
        "id": "Reference.identifier",
        "path": "Reference.identifier",
        "short": "逻辑引用 Logical reference, when literal reference is not known",
        "definition": "描述目标资源的标识符。当无法直接引用其他资源时，就会使用这种方法。可能存在的原有如下几点：\r\n1.当它所表示的实体无法通过FHIR服务器访问时。\r\n2.资源的作者无法将已知标识符转换为实际位置。没有要求引用。\r\n该标识符指向一个FHIR实例，并且该实例需要是引用所允许的FHIR资源类型。",
        "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.\r\rWhen 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\r\rApplications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.\r\rReference 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).",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://StructureDefinition.hl7fhir.cn/Identifier"
            ]
          }
        ]
      },
      {
        "id": "Reference.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Reference.display",
        "short": "资源的文本显示",
        "definition": "Plain text narrative that identifies the resource in addition to the resource reference.\r\n除资源引用外，标识资源的纯文本叙事。"
      }
    ]
  }
}