All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.profiles.MHD-DocumentReference.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
  <meta>
    <lastUpdated value="2017-10-11T15:59:34.903+02:00" />
  </meta>
  <url value="http://oehf.github.io/ipf/fhir/MHD-DocumentReference" />
  <name value="MHD-DocumentReference" />
  <status value="active" />
  <experimental value="false" />
  <date value="2017-10-11T15:48:51.171+02:00" />
  <publisher value="Open eHealth Foundation" />
  <contact>
    <name value="Christian Ohr" />
  </contact>
  <fhirVersion value="3.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <snapshot>
    <element id="DocumentReference">
      <path value="DocumentReference" />
      <short value="A reference to a document" />
      <definition value="A reference to a document." />
      <comment value="Usually, this is used for documents other than those defined by FHIR." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Resource" />
        <min value="0" />
        <max value="*" />
      </base>
      <constraint>
        <key value="dom-2" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
        <expression value="contained.contained.empty()" />
        <xpath value="not(parent::f:contained and f:contained)" />
      </constraint>
      <constraint>
        <key value="dom-1" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL NOT contain any narrative" />
        <expression value="contained.text.empty()" />
        <xpath value="not(parent::f:contained and f:text)" />
      </constraint>
      <constraint>
        <key value="dom-4" />
        <severity value="error" />
        <human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
        <expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
        <xpath value="not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))" />
      </constraint>
      <constraint>
        <key value="dom-3" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource" />
        <expression value="contained.where(('#'+id in %resource.descendants().reference).not()).empty()" />
        <xpath value="not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Document[classCode=&quot;DOC&quot; and moodCode=&quot;EVN&quot;]" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="infrastructure.documents" />
      </mapping>
    </element>
    <element id="DocumentReference.id">
      <path value="DocumentReference.id" />
      <short value="Logical id of this artifact" />
      <definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." />
      <comment value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="id" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.meta">
      <path value="DocumentReference.meta" />
      <short value="Metadata about the resource" />
      <definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.meta" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Meta" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.implicitRules">
      <path value="DocumentReference.implicitRules" />
      <short value="A set of rules under which this content was created" />
      <definition value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." />
      <comment value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. &#xA;&#xA;This element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.implicitRules" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.language">
      <path value="DocumentReference.language" />
      <short value="Language of the resource content" />
      <definition value="The base language in which the resource is written." />
      <comment value="Language 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)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Resource.language" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueReference>
            <reference value="http://hl7.org/fhir/ValueSet/all-languages" />
          </valueReference>
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Language" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="extensible" />
        <description value="A human language." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/languages" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.text">
      <path value="DocumentReference.text" />
      <short value="Text summary of the resource, for human interpretation" />
      <definition value="A 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 &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." />
      <comment value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied).  This may be necessary for data from legacy systems where information is captured as a &quot;text blob&quot; or where text is additionally entered raw or narrated and encoded in formation is added later." />
      <alias value="narrative" />
      <alias value="html" />
      <alias value="xhtml" />
      <alias value="display" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DomainResource.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Narrative" />
      </type>
      <condition value="ele-1" />
      <condition value="dom-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Act.text?" />
      </mapping>
    </element>
    <element id="DocumentReference.contained">
      <path value="DocumentReference.contained" />
      <short value="Contained, inline Resources" />
      <definition value="These 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." />
      <comment value="This 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." />
      <alias value="inline resources" />
      <alias value="anonymous resources" />
      <alias value="contained resources" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.contained" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Resource" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.extension">
      <path value="DocumentReference.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="May 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 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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.modifierExtension">
      <path value="DocumentReference.modifierExtension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Extensions that cannot be ignored" />
      <definition value="May 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 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. Applications processing a resource are required to check for modifier extensions." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DomainResource.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <isModifier value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier">
      <path value="DocumentReference.masterIdentifier" />
      <short value="Master Version Specific Identifier" />
      <definition value="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document." />
      <comment value="CDA Document Id extension and root." />
      <requirements value="The structure and format of this Id shall be consistent with the specification corresponding to the formatCode attribute. (e.g. for a DICOM standard document a 64-character numeric UID, for an HL7 CDA format a serialization of the CDA Document Id extension and root in the form &quot;oid^extension&quot;, where OID is a 64 digits max, and the Id is a 16 UTF-8 char max. If the OID is coded without the extension then the '^' character shall not be included.)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.masterIdentifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-12" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".id" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.uniqueId" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="id" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.id">
      <path value="DocumentReference.masterIdentifier.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.extension">
      <path value="DocumentReference.masterIdentifier.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.use">
      <path value="DocumentReference.masterIdentifier.use" />
      <short value="usual | official | temp | secondary (If known)" />
      <definition value="The purpose of this identifier." />
      <comment value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary." />
      <requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.use" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IdentifierUse" />
        </extension>
        <strength value="required" />
        <description value="Identifies the purpose for this identifier, if known ." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type">
      <path value="DocumentReference.masterIdentifier.type" />
      <short value="Description of identifier" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
      <comment value="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. &#xA;&#xA;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." />
      <requirements value="Allows users to make use of identifiers when the identifier system is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.type" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IdentifierType" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="extensible" />
        <description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.id">
      <path value="DocumentReference.masterIdentifier.type.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.extension">
      <path value="DocumentReference.masterIdentifier.type.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding">
      <path value="DocumentReference.masterIdentifier.type.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.id">
      <path value="DocumentReference.masterIdentifier.type.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.extension">
      <path value="DocumentReference.masterIdentifier.type.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.system">
      <path value="DocumentReference.masterIdentifier.type.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.version">
      <path value="DocumentReference.masterIdentifier.type.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.code">
      <path value="DocumentReference.masterIdentifier.type.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.masterIdentifier.type.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.coding.userSelected">
      <path value="DocumentReference.masterIdentifier.type.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.type.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.masterIdentifier.type.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.system">
      <path value="DocumentReference.masterIdentifier.system" />
      <short value="The namespace for the identifier value" />
      <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique." />
      <comment value="see http://en.wikipedia.org/wiki/Uniform_resource_identifier" />
      <requirements value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="General" />
        <valueUri value="http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / EI-2-4" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.root or Role.id.root" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierType" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.value">
      <path value="DocumentReference.masterIdentifier.value" />
      <short value="The value that is unique" />
      <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system." />
      <comment value="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](extension-rendered-value.html)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="123456" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.1 / EI.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Value" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.period">
      <path value="DocumentReference.masterIdentifier.period" />
      <short value="Time period when id is/was valid for use" />
      <definition value="Time period during which identifier is/was valid for use." />
      <comment value="This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;). If duration is required, specify the type as Interval|Duration." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="per-1" />
        <severity value="error" />
        <human value="If present, start SHALL have a lower value than end" />
        <expression value="start.empty() or end.empty() or (start &lt;= end)" />
        <xpath value="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value &lt;= f:end/@value)" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="IVL&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;] or URG&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.7 + CX.8" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.effectiveTime or implied by context" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StartDate and ./EndDate" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.period.id">
      <path value="DocumentReference.masterIdentifier.period.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.period.extension">
      <path value="DocumentReference.masterIdentifier.period.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.period.start">
      <path value="DocumentReference.masterIdentifier.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comment value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.start" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.period.end">
      <path value="DocumentReference.masterIdentifier.period.end" />
      <short value="End time with inclusive boundary, if not ongoing" />
      <definition value="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <comment value="The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a end value of 2012-02-03." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.end" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <meaningWhenMissing value="If the end of the period is missing, it means that the period is ongoing" />
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.assigner">
      <path value="DocumentReference.masterIdentifier.assigner" />
      <short value="Organization that issued id (may be just text)" />
      <definition value="Organization that issued/manages the identifier." />
      <comment value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.assigner" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / (CX.4,CX.9,CX.10)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierIssuingAuthority" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.assigner.id">
      <path value="DocumentReference.masterIdentifier.assigner.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.assigner.extension">
      <path value="DocumentReference.masterIdentifier.assigner.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.assigner.reference">
      <path value="DocumentReference.masterIdentifier.assigner.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.assigner.identifier">
      <path value="DocumentReference.masterIdentifier.assigner.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.masterIdentifier.assigner.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.masterIdentifier.assigner.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <short value="Other identifiers for the document" />
      <definition value="Other identifiers associated with the document, including version independent identifiers." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DocumentReference.identifier" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-16?" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".id / .setId" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.entryUUID" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="id" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.id">
      <path value="DocumentReference.identifier.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.extension">
      <path value="DocumentReference.identifier.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.use">
      <path value="DocumentReference.identifier.use" />
      <short value="usual | official | temp | secondary (If known)" />
      <definition value="The purpose of this identifier." />
      <comment value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary." />
      <requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.use" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IdentifierUse" />
        </extension>
        <strength value="required" />
        <description value="Identifies the purpose for this identifier, if known ." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type">
      <path value="DocumentReference.identifier.type" />
      <short value="Description of identifier" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
      <comment value="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. &#xA;&#xA;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." />
      <requirements value="Allows users to make use of identifiers when the identifier system is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.type" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IdentifierType" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="extensible" />
        <description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.id">
      <path value="DocumentReference.identifier.type.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.extension">
      <path value="DocumentReference.identifier.type.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding">
      <path value="DocumentReference.identifier.type.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.id">
      <path value="DocumentReference.identifier.type.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.extension">
      <path value="DocumentReference.identifier.type.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.system">
      <path value="DocumentReference.identifier.type.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.version">
      <path value="DocumentReference.identifier.type.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.code">
      <path value="DocumentReference.identifier.type.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.identifier.type.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.coding.userSelected">
      <path value="DocumentReference.identifier.type.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.type.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.identifier.type.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.system">
      <path value="DocumentReference.identifier.system" />
      <short value="The namespace for the identifier value" />
      <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique." />
      <comment value="see http://en.wikipedia.org/wiki/Uniform_resource_identifier" />
      <requirements value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="General" />
        <valueUri value="http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / EI-2-4" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.root or Role.id.root" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierType" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.value">
      <path value="DocumentReference.identifier.value" />
      <short value="The value that is unique" />
      <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system." />
      <comment value="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](extension-rendered-value.html)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="123456" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.1 / EI.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Value" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.period">
      <path value="DocumentReference.identifier.period" />
      <short value="Time period when id is/was valid for use" />
      <definition value="Time period during which identifier is/was valid for use." />
      <comment value="This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;). If duration is required, specify the type as Interval|Duration." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="per-1" />
        <severity value="error" />
        <human value="If present, start SHALL have a lower value than end" />
        <expression value="start.empty() or end.empty() or (start &lt;= end)" />
        <xpath value="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value &lt;= f:end/@value)" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="IVL&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;] or URG&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.7 + CX.8" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.effectiveTime or implied by context" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StartDate and ./EndDate" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.period.id">
      <path value="DocumentReference.identifier.period.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.period.extension">
      <path value="DocumentReference.identifier.period.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.period.start">
      <path value="DocumentReference.identifier.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comment value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.start" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.period.end">
      <path value="DocumentReference.identifier.period.end" />
      <short value="End time with inclusive boundary, if not ongoing" />
      <definition value="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <comment value="The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a end value of 2012-02-03." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.end" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <meaningWhenMissing value="If the end of the period is missing, it means that the period is ongoing" />
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.assigner">
      <path value="DocumentReference.identifier.assigner" />
      <short value="Organization that issued id (may be just text)" />
      <definition value="Organization that issued/manages the identifier." />
      <comment value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.assigner" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / (CX.4,CX.9,CX.10)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierIssuingAuthority" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.assigner.id">
      <path value="DocumentReference.identifier.assigner.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.assigner.extension">
      <path value="DocumentReference.identifier.assigner.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.assigner.reference">
      <path value="DocumentReference.identifier.assigner.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.assigner.identifier">
      <path value="DocumentReference.identifier.assigner.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.identifier.assigner.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.identifier.assigner.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.status">
      <path value="DocumentReference.status" />
      <short value="current | superseded | entered-in-error" />
      <definition value="The status of this document reference." />
      <comment value="This is the status of the DocumentReference object, which might be independent from the docStatus element.&#xA;&#xA;This element is labeled as a modifier because the status contains the codes that mark the document or reference as not currently valid." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="DocumentReference.status" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentReferenceStatus" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="required" />
        <description value="The status of the document reference." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/document-reference-status" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-19" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="interim: .completionCode=&quot;IN&quot; &amp; ./statusCode[isNormalDatatype()]=&quot;active&quot;;  final: .completionCode=&quot;AU&quot; &amp;&amp;  ./statusCode[isNormalDatatype()]=&quot;complete&quot; and not(./inboundRelationship[typeCode=&quot;SUBJ&quot; and isNormalActRelationship()]/source[subsumesCode(&quot;ActClass#CACT&quot;) and moodCode=&quot;EVN&quot; and domainMember(&quot;ReviseDocument&quot;, code) and isNormalAct()]);  amended: .completionCode=&quot;AU&quot; &amp;&amp;  ./statusCode[isNormalDatatype()]=&quot;complete&quot; and ./inboundRelationship[typeCode=&quot;SUBJ&quot; and isNormalActRelationship()]/source[subsumesCode(&quot;ActClass#CACT&quot;) and moodCode=&quot;EVN&quot; and domainMember(&quot;ReviseDocument&quot;, code) and isNormalAct() and statusCode=&quot;completed&quot;];  withdrawn : .completionCode=NI &amp;&amp;  ./statusCode[isNormalDatatype()]=&quot;obsolete&quot;" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry status" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="status" />
      </mapping>
    </element>
    <element id="DocumentReference.docStatus">
      <path value="DocumentReference.docStatus" />
      <short value="preliminary | final | appended | amended | entered-in-error" />
      <definition value="The status of the underlying document." />
      <comment value="The document that is pointed to might be in various lifecycle states." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="DocumentReference.docStatus" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ReferredDocumentStatus" />
        </extension>
        <strength value="required" />
        <description value="Status of the underlying document." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/composition-status" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-17" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".statusCode" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="status" />
      </mapping>
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <short value="Kind of document (LOINC if possible)" />
      <definition value="Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced." />
      <comment value="Key metadata element describing the document, used in searching/filtering." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="DocumentReference.type" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80Type" />
        </extension>
        <strength value="preferred" />
        <description value="Precise type of clinical document." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/c80-doc-typecodes" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.type" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="class" />
      </mapping>
    </element>
    <element id="DocumentReference.type.id">
      <path value="DocumentReference.type.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.type.extension">
      <path value="DocumentReference.type.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding">
      <path value="DocumentReference.type.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.id">
      <path value="DocumentReference.type.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.extension">
      <path value="DocumentReference.type.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.system">
      <path value="DocumentReference.type.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.version">
      <path value="DocumentReference.type.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.code">
      <path value="DocumentReference.type.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.type.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.type.coding.userSelected">
      <path value="DocumentReference.type.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.type.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.type.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.class">
      <path value="DocumentReference.class" />
      <short value="Categorization of document" />
      <definition value="A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type." />
      <comment value="This is a metadata field from [XDS/MHD](http://wiki.ihe.net/index.php?title=Mobile_access_to_Health_Documents_(MHD))." />
      <requirements value="Helps humans to assess whether the document is of interest when viewing a list of documents." />
      <alias value="kind" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.class" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80Class" />
        </extension>
        <strength value="example" />
        <description value="High-level kind of a clinical document at a macro level." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/c80-doc-classcodes" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=&quot;COMP].target[classCode=&quot;LIST&quot;, moodCode=&quot;EVN&quot;].code" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.class" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="class" />
      </mapping>
    </element>
    <element id="DocumentReference.class.id">
      <path value="DocumentReference.class.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.class.extension">
      <path value="DocumentReference.class.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding">
      <path value="DocumentReference.class.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.id">
      <path value="DocumentReference.class.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.extension">
      <path value="DocumentReference.class.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.system">
      <path value="DocumentReference.class.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.version">
      <path value="DocumentReference.class.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.code">
      <path value="DocumentReference.class.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.class.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.class.coding.userSelected">
      <path value="DocumentReference.class.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.class.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.class.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <short value="Who/what is the subject of the document" />
      <definition value="Who or what the document is about. The document can be about a patient." />
      <comment value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.subject" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="PID-3 (No standard way to define a Practitioner or Group subject in HL7 v2 MDM message)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;SBJ&quot;].role[typeCode=&quot;PAT&quot;]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.patientId" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="who.focus" />
      </mapping>
    </element>
    <element id="DocumentReference.subject.id">
      <path value="DocumentReference.subject.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.subject.extension">
      <path value="DocumentReference.subject.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.subject.reference">
      <path value="DocumentReference.subject.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.subject.identifier">
      <path value="DocumentReference.subject.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.subject.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.subject.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.created">
      <path value="DocumentReference.created" />
      <short value="Document creation time" />
      <definition value="When the document was created." />
      <comment value="Creation time is used for tracking, organizing versions and searching. This is the creation time of the document, not the source material on which it is based." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="DocumentReference.created" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime[type=&quot;TS&quot;]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.submissionTime" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="when.done" />
      </mapping>
    </element>
    <element id="DocumentReference.indexed">
      <path value="DocumentReference.indexed" />
      <short value="When this document reference was created" />
      <definition value="When the document reference was created." />
      <comment value="Referencing/indexing time is used for tracking, organizing versions and searching." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="DocumentReference.indexed" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="instant" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".availabilityTime[type=&quot;TS&quot;]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.submissionTime" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="when.recorded" />
      </mapping>
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <short value="Who and/or what authored the document" />
      <definition value="Identifies who is responsible for adding the information to the document." />
      <comment value="Not necessarily who did the actual data entry (i.e. typist) it in or who was the source (informant)." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DocumentReference.author" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-9 (No standard way to indicate a Device in HL7 v2 MDM message)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;AUT&quot;].role[classCode=&quot;ASSIGNED&quot;]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.author" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="who.author" />
      </mapping>
    </element>
    <element id="DocumentReference.author.id">
      <path value="DocumentReference.author.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.author.extension">
      <path value="DocumentReference.author.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.author.reference">
      <path value="DocumentReference.author.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.author.identifier">
      <path value="DocumentReference.author.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.author.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.author.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.authenticator">
      <path value="DocumentReference.authenticator" />
      <short value="Who/what authenticated the document" />
      <definition value="Which person or organization authenticates that this document is valid." />
      <comment value="Represents a participant within the author institution who has legally authenticated or attested the document. Legal authentication implies that a document has been signed manually or electronically by the legal Authenticator." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.authenticator" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-10" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;AUTHEN&quot;].role[classCode=&quot;ASSIGNED&quot;]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.legalAuthenticator" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="who.witness" />
      </mapping>
    </element>
    <element id="DocumentReference.authenticator.id">
      <path value="DocumentReference.authenticator.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.authenticator.extension">
      <path value="DocumentReference.authenticator.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.authenticator.reference">
      <path value="DocumentReference.authenticator.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.authenticator.identifier">
      <path value="DocumentReference.authenticator.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.authenticator.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.authenticator.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <short value="Organization which maintains the document" />
      <definition value="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." />
      <comment value="Identifies the logical organization to go to find the current version, where to report issues, etc. This is different from the physical location of the document, which is the technical location of the document, which host may be delegated to the management of some other organization." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="DocumentReference.custodian" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;RCV&quot;].role[classCode=&quot;CUST&quot;].scoper[classCode=&quot;ORG&quot; and determinerCode=&quot;INST&quot;]" />
      </mapping>
    </element>
    <element id="DocumentReference.custodian.id">
      <path value="DocumentReference.custodian.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.custodian.extension">
      <path value="DocumentReference.custodian.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.custodian.reference">
      <path value="DocumentReference.custodian.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.custodian.identifier">
      <path value="DocumentReference.custodian.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.custodian.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.custodian.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo">
      <path value="DocumentReference.relatesTo" />
      <short value="Relationships to other documents" />
      <definition value="Relationships that this document has with other document references that already exist." />
      <comment value="This element is labeled as a modifier because documents that append to other documents are incomplete on their own." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DocumentReference.relatesTo" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.id">
      <path value="DocumentReference.relatesTo.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.extension">
      <path value="DocumentReference.relatesTo.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.modifierExtension">
      <path value="DocumentReference.relatesTo.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, 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 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. Applications processing a resource are required to check for modifier extensions." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.code">
      <path value="DocumentReference.relatesTo.code" />
      <short value="replaces | transforms | signs | appends" />
      <definition value="The type of relationship that this document has with anther document." />
      <comment value="If this document appends another document, then the document cannot be fully understood without also accessing the referenced document." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="DocumentReference.relatesTo.code" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentRelationshipType" />
        </extension>
        <strength value="required" />
        <description value="The type of relationship between documents." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/document-relationship-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship.typeCode" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry Associations type" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.target">
      <path value="DocumentReference.relatesTo.target" />
      <short value="Target of the relationship" />
      <definition value="The target document of this relationship." />
      <comment value="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." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="DocumentReference.relatesTo.target" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".target[classCode=&quot;DOC&quot;, moodCode=&quot;EVN&quot;].id" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry Associations reference" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.target.id">
      <path value="DocumentReference.relatesTo.target.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.target.extension">
      <path value="DocumentReference.relatesTo.target.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.target.reference">
      <path value="DocumentReference.relatesTo.target.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.target.identifier">
      <path value="DocumentReference.relatesTo.target.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.relatesTo.target.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.relatesTo.target.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.description">
      <path value="DocumentReference.description" />
      <short value="Human-readable description (title)" />
      <definition value="Human-readable description of the source document. This is sometimes known as the &quot;title&quot;." />
      <comment value="What the document is about, rather than a terse summary of the document. It is commonly the case that records do not have a title and are collectively referred to by the display name of Record code (e.g. a &quot;consultation&quot; or &quot;progress note&quot;)." />
      <requirements value="Helps humans to assess whether the document is of interest." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.description" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-25" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship[typeCode=&quot;SUBJ&quot;].target.text" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.description" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel">
      <path value="DocumentReference.securityLabel" />
      <short value="Document security-tags" />
      <definition value="A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the &quot;reference&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to." />
      <comment value="The confidentiality codes can carry multiple vocabulary items. HL7 has developed an understanding of security and privacy tags that might be desirable in a Document Sharing environment, called HL7 Healthcare Privacy and Security Classification System (HCS). The following specification is recommended but not mandated, as the vocabulary bindings are an administrative domain responsibility. The use of this method is up to the policy domain such as the XDS Affinity Domain or other Trust Domain where all parties including sender and recipients are trusted to appropriately tag and enforce.   In the HL7 Healthcare Privacy and Security Classification (HCS) there are code systems specific to Confidentiality, Sensitivity, Integrity, and Handling Caveats. Some values would come from a local vocabulary as they are related to workflow roles and special projects." />
      <requirements value="Use of the Health Care Privacy/Security Classification (HCS) system of security-tag use is recommended." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DocumentReference.securityLabel" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="SecurityLabels" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="extensible" />
        <description value="Security Labels from the Healthcare Privacy and Security Classification System." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/security-labels" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-18" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".confidentialityCode" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.confidentialityCode" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.id">
      <path value="DocumentReference.securityLabel.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.extension">
      <path value="DocumentReference.securityLabel.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding">
      <path value="DocumentReference.securityLabel.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.id">
      <path value="DocumentReference.securityLabel.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.extension">
      <path value="DocumentReference.securityLabel.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.system">
      <path value="DocumentReference.securityLabel.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.version">
      <path value="DocumentReference.securityLabel.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.code">
      <path value="DocumentReference.securityLabel.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.securityLabel.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.coding.userSelected">
      <path value="DocumentReference.securityLabel.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.securityLabel.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.securityLabel.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.content">
      <path value="DocumentReference.content" />
      <short value="Document referenced" />
      <definition value="The document and format referenced. There may be multiple content element repetitions, each with a different format." />
      <min value="1" />
      <max value="*" />
      <base>
        <path value="DocumentReference.content" />
        <min value="1" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="document.text" />
      </mapping>
    </element>
    <element id="DocumentReference.content.id">
      <path value="DocumentReference.content.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.content.extension">
      <path value="DocumentReference.content.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.content.modifierExtension">
      <path value="DocumentReference.content.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, 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 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. Applications processing a resource are required to check for modifier extensions." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment">
      <path value="DocumentReference.content.attachment" />
      <short value="Where to access the document" />
      <definition value="The document or URL of the document along with critical metadata to prove content has integrity." />
      <comment value="When providing a summary view (for example with Observation.value[x]) Attachment should be represented with a brief display text such as &quot;Attachment&quot;." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="DocumentReference.content.attachment" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Attachment" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="att-1" />
        <severity value="error" />
        <human value="It the Attachment has data, it SHALL have a contentType" />
        <expression value="data.empty() or contentType.exists()" />
        <xpath value="not(exists(f:data)) or exists(f:contentType)" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="ED/RP" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="ED" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-3 for mime type" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="document.text" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.mimeType DocumentEntry.languageCode DocumentEntry.URI DocumentEntry.size DocumentEntry.hash DocumentEntry.title" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.id">
      <path value="DocumentReference.content.attachment.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.extension">
      <path value="DocumentReference.content.attachment.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.contentType">
      <path value="DocumentReference.content.attachment.contentType" />
      <short value="Mime type of the content, with charset etc." />
      <definition value="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Processors of the data need to be able to know how to interpret the data." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Attachment.contentType" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <example>
        <label value="General" />
        <valueCode value="text/plain; charset=UTF-8, image/png" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="MimeType" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="required" />
        <description value="The mime type of an attachment. Any valid mime type is allowed." />
        <valueSetUri value="http://www.rfc-editor.org/bcp/bcp13.txt" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="ED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./mediaType, ./charset" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.language">
      <path value="DocumentReference.content.attachment.language" />
      <short value="Human language of the content (BCP-47)" />
      <definition value="The human language of the content. The value can be any valid value according to BCP 47." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Users need to be able to choose between the languages in a set of attachments." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Attachment.language" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <example>
        <label value="General" />
        <valueCode value="en-AU" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueReference>
            <reference value="http://hl7.org/fhir/ValueSet/all-languages" />
          </valueReference>
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Language" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="extensible" />
        <description value="A human language." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/languages" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./language" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.data">
      <path value="DocumentReference.content.attachment.data" />
      <short value="Data inline, base64ed" />
      <definition value="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." />
      <comment value="The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON." />
      <requirements value="The data needs to able to be transmitted inline." />
      <min value="0" />
      <max value="0" />
      <base>
        <path value="Attachment.data" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="base64Binary" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="ED.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./data" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <short value="Uri where the data can be found" />
      <definition value="An alternative location where the data can be accessed." />
      <comment value="If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data." />
      <requirements value="The data needs to be transmitted by reference." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Attachment.url" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="General" />
        <valueUri value="http://www.acme.com/logo-small.png" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="RP.1+RP.2 - if they refer to a URL (see v2.6)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./reference/literal" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.size">
      <path value="DocumentReference.content.attachment.size" />
      <short value="Number of bytes of content (if url provided)" />
      <definition value="The number of bytes of data that make up this attachment (before base64 encoding, if that is done)." />
      <comment value="The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference." />
      <requirements value="Representing the size allows applications to determine whether they should fetch the content automatically in advance, or refuse to fetch it at all." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Attachment.size" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="unsignedInt" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A (needs data type R3 proposal)" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.hash">
      <path value="DocumentReference.content.attachment.hash" />
      <short value="Hash of the data (sha-1, base64ed)" />
      <definition value="The calculated hash of the data using SHA-1. Represented using base64." />
      <comment value="The hash is calculated on the data prior to base64 encoding, if the data is based64 encoded." />
      <requirements value="Included so that applications can verify that the contents of a location have not changed and so that a signature of the content can implicitly sign the content of an image without having to include the data in the instance or reference the url in the signature." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Attachment.hash" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="base64Binary" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".integrityCheck[parent::ED/integrityCheckAlgorithm=&quot;SHA-1&quot;]" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.title">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.content.attachment.title" />
      <short value="Label to display in place of the data" />
      <definition value="A label or set of text to display in place of the data." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Applications need a label to display to a human user in place of the actual data if the data cannot be rendered or perceived by the viewer." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Attachment.title" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="Official Corporate Logo" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./title/data" />
      </mapping>
    </element>
    <element id="DocumentReference.content.attachment.creation">
      <path value="DocumentReference.content.attachment.creation" />
      <short value="Date attachment was first created" />
      <definition value="The date that the attachment was first created." />
      <requirements value="This is often tracked as an integrity issue for use of the attachment." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Attachment.creation" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A (needs data type R3 proposal)" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format">
      <path value="DocumentReference.content.format" />
      <short value="Format/content rules for the document" />
      <definition value="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType." />
      <comment value="Note that while IHE mostly issues URNs for format types, not all documents can be identified by a URI." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.content.format" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentFormat" />
        </extension>
        <strength value="preferred" />
        <description value="Document Format Codes." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/formatcodes" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="document.text" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.formatCode" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.id">
      <path value="DocumentReference.content.format.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.extension">
      <path value="DocumentReference.content.format.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.system">
      <path value="DocumentReference.content.format.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.version">
      <path value="DocumentReference.content.format.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.code">
      <path value="DocumentReference.content.format.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.content.format.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.content.format.userSelected">
      <path value="DocumentReference.content.format.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.context">
      <path value="DocumentReference.context" />
      <short value="Clinical context of document" />
      <definition value="The clinical context in which the document was prepared." />
      <comment value="These values are primarily added to help with searching for interesting/relevant documents." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="outboundRelationship[typeCode=&quot;SUBJ&quot;].target[classCode&lt;'ACT']" />
      </mapping>
    </element>
    <element id="DocumentReference.context.id">
      <path value="DocumentReference.context.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.extension">
      <path value="DocumentReference.context.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.modifierExtension">
      <path value="DocumentReference.context.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, 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 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. Applications processing a resource are required to check for modifier extensions." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.encounter">
      <path value="DocumentReference.context.encounter" />
      <short value="Context of the document  content" />
      <definition value="Describes the clinical encounter or type of care that the document content is associated with." />
      <comment value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.encounter" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="unique(highest(./outboundRelationship[typeCode=&quot;SUBJ&quot; and isNormalActRelationship()], priorityNumber)/target[moodCode=&quot;EVN&quot; and classCode=(&quot;ENC&quot;, &quot;PCPR&quot;) and isNormalAct])" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="context" />
      </mapping>
    </element>
    <element id="DocumentReference.context.encounter.id">
      <path value="DocumentReference.context.encounter.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.encounter.extension">
      <path value="DocumentReference.context.encounter.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.encounter.reference">
      <path value="DocumentReference.context.encounter.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.encounter.identifier">
      <path value="DocumentReference.context.encounter.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.context.encounter.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.encounter.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event">
      <path value="DocumentReference.context.event" />
      <short value="Main clinical acts documented" />
      <definition value="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act." />
      <comment value="An event can further specialize the act inherent in the type, such as  where it is simply &quot;Procedure Report&quot; and the procedure was a &quot;colonoscopy&quot;. If one or more event codes are included, they shall not conflict with the values inherent in the class or type elements as such a conflict would create an ambiguous situation." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DocumentReference.context.event" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentEventType" />
        </extension>
        <strength value="example" />
        <description value="This list of codes represents the main clinical acts being documented." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/v3-ActCode" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".code" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.eventCodeList" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.id">
      <path value="DocumentReference.context.event.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.extension">
      <path value="DocumentReference.context.event.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding">
      <path value="DocumentReference.context.event.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.id">
      <path value="DocumentReference.context.event.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.extension">
      <path value="DocumentReference.context.event.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.system">
      <path value="DocumentReference.context.event.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.version">
      <path value="DocumentReference.context.event.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.code">
      <path value="DocumentReference.context.event.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.event.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.coding.userSelected">
      <path value="DocumentReference.context.event.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.context.event.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.event.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.context.period">
      <path value="DocumentReference.context.period" />
      <short value="Time of service that is being documented" />
      <definition value="The time period over which the service that is described by the document was provided." />
      <comment value="This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;). If duration is required, specify the type as Interval|Duration." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="per-1" />
        <severity value="error" />
        <human value="If present, start SHALL have a lower value than end" />
        <expression value="start.empty() or end.empty() or (start &lt;= end)" />
        <xpath value="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value &lt;= f:end/@value)" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="IVL&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;] or URG&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;]" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.serviceStartTime DocumentEntry.serviceStopTime" />
      </mapping>
    </element>
    <element id="DocumentReference.context.period.id">
      <path value="DocumentReference.context.period.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.period.extension">
      <path value="DocumentReference.context.period.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.period.start">
      <path value="DocumentReference.context.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comment value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.start" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element id="DocumentReference.context.period.end">
      <path value="DocumentReference.context.period.end" />
      <short value="End time with inclusive boundary, if not ongoing" />
      <definition value="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <comment value="The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a end value of 2012-02-03." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.end" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <meaningWhenMissing value="If the end of the period is missing, it means that the period is ongoing" />
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType">
      <path value="DocumentReference.context.facilityType" />
      <short value="Kind of facility where patient was seen" />
      <definition value="The kind of facility where the patient was seen." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.facilityType" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80FacilityType" />
        </extension>
        <strength value="example" />
        <description value="XDS Facility Type." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/c80-facilitycodes" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;LOC&quot;].role[classCode=&quot;DSDLOC&quot;].code" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.healthcareFacilityTypeCode" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.id">
      <path value="DocumentReference.context.facilityType.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.extension">
      <path value="DocumentReference.context.facilityType.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding">
      <path value="DocumentReference.context.facilityType.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.id">
      <path value="DocumentReference.context.facilityType.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.extension">
      <path value="DocumentReference.context.facilityType.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.system">
      <path value="DocumentReference.context.facilityType.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.version">
      <path value="DocumentReference.context.facilityType.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.code">
      <path value="DocumentReference.context.facilityType.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.facilityType.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.coding.userSelected">
      <path value="DocumentReference.context.facilityType.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.context.facilityType.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.facilityType.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting">
      <path value="DocumentReference.context.practiceSetting" />
      <short value="Additional details about where the content was created (e.g. clinical specialty)" />
      <definition value="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty." />
      <comment value="The value set for this content has an example binding because it is a value set decided by community policy. Other examples exist for consideration: * HITSP created the table HITSP/C80 Table 2-148 Clinical Specialty Value Set (a value set based upon SNOMED CT which is referenced by Direct (XDR and XDM for Direct Messaging Specification, Version 1), as well as Nationwide Health Information Network (NHIN).  Query for Documents, Web Service Interface Specification, V 3.0, 07/27/2011 * ELGA (Austria) (ELGA CDA Implementie-rungsleitfäden Registrierung von CDA Dokumenten für ELGA mit IHE Cross-Enterprise Document Sharing: XDS Metadaten (XDSDocumentEntry), [1.2.40.0.34.7.6.3] * XDS Connect-a-thon practiceSettingCode." />
      <requirements value="This is an important piece of metadata that providers often rely upon to quickly sort and/or filter out to find specific content." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.practiceSetting" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80PracticeSetting" />
        </extension>
        <strength value="example" />
        <description value="Additional details about where the content was created (e.g. clinical specialty)." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/c80-practice-codes" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;LOC&quot;].role[classCode=&quot;DSDLOC&quot;].code" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.practiceSettingCode" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.id">
      <path value="DocumentReference.context.practiceSetting.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.extension">
      <path value="DocumentReference.context.practiceSetting.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding">
      <path value="DocumentReference.context.practiceSetting.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.id">
      <path value="DocumentReference.context.practiceSetting.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.extension">
      <path value="DocumentReference.context.practiceSetting.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.system">
      <path value="DocumentReference.context.practiceSetting.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.version">
      <path value="DocumentReference.context.practiceSetting.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.code">
      <path value="DocumentReference.context.practiceSetting.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.practiceSetting.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.coding.userSelected">
      <path value="DocumentReference.context.practiceSetting.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.context.practiceSetting.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.practiceSetting.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo">
      <path value="DocumentReference.context.sourcePatientInfo" />
      <short value="Patient demographics from source" />
      <definition value="The Patient Information as known when the document was published. May be a reference to a version specific, or contained." />
      <comment value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.sourcePatientInfo" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".participation[typeCode=&quot;SBJ&quot;].role[typeCode=&quot;PAT&quot;]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.sourcePatientInfo DocumentEntry.sourcePatientId" />
      </mapping>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.id">
      <path value="DocumentReference.context.sourcePatientInfo.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.extension">
      <path value="DocumentReference.context.sourcePatientInfo.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.reference">
      <path value="DocumentReference.context.sourcePatientInfo.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.identifier">
      <path value="DocumentReference.context.sourcePatientInfo.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.context.sourcePatientInfo.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.sourcePatientInfo.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related">
      <path value="DocumentReference.context.related" />
      <short value="Related identifiers or resources" />
      <definition value="Related identifiers or resources associated with the DocumentReference." />
      <comment value="May be identifiers or resources that caused the DocumentReference or referenced Document to be created." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="DocumentReference.context.related" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./outboundRelationship[typeCode=&quot;PERT&quot; and isNormalActRelationship()] / target[isNormalAct]" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.referenceIdList" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.id">
      <path value="DocumentReference.context.related.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.extension">
      <path value="DocumentReference.context.related.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.modifierExtension">
      <path value="DocumentReference.context.related.modifierExtension" />
      <short value="Extensions that cannot be ignored" />
      <definition value="May be used to represent additional information that is not part of the basic definition of the element, 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 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. Applications processing a resource are required to check for modifier extensions." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <alias value="modifiers" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="BackboneElement.modifierExtension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier">
      <path value="DocumentReference.context.related.identifier" />
      <short value="Identifier of related objects or events" />
      <definition value="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing." />
      <comment value="Order numbers, accession numbers, XDW workflow numbers." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.related.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./outboundRelationship[typeCode=&quot;PERT&quot; and isNormalActRelationship()] / target[isNormalAct] .id" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.id">
      <path value="DocumentReference.context.related.identifier.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.extension">
      <path value="DocumentReference.context.related.identifier.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.use">
      <path value="DocumentReference.context.related.identifier.use" />
      <short value="usual | official | temp | secondary (If known)" />
      <definition value="The purpose of this identifier." />
      <comment value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary." />
      <requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.use" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isModifier value="true" />
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IdentifierUse" />
        </extension>
        <strength value="required" />
        <description value="Identifies the purpose for this identifier, if known ." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-use" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type">
      <path value="DocumentReference.context.related.identifier.type" />
      <short value="Description of identifier" />
      <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
      <comment value="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. &#xA;&#xA;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." />
      <requirements value="Allows users to make use of identifiers when the identifier system is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.type" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IdentifierType" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
          <valueBoolean value="true" />
        </extension>
        <strength value="extensible" />
        <description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/identifier-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.5" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.code or implied by context" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.id">
      <path value="DocumentReference.context.related.identifier.type.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.extension">
      <path value="DocumentReference.context.related.identifier.type.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding">
      <path value="DocumentReference.context.related.identifier.type.coding" />
      <short value="Code defined by a terminology system" />
      <definition value="A reference to a code defined by a terminology system." />
      <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
      <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="CodeableConcept.coding" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1-8, C*E.10-22" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="union(., ./translation)" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.id">
      <path value="DocumentReference.context.related.identifier.type.coding.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.extension">
      <path value="DocumentReference.context.related.identifier.type.coding.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.system">
      <path value="DocumentReference.context.related.identifier.type.coding.system" />
      <short value="Identity of the terminology system" />
      <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
      <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
      <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.3" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystem" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.version">
      <path value="DocumentReference.context.related.identifier.type.coding.version" />
      <short value="Version of the system - if relevant" />
      <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
      <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.version" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.7" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./codeSystemVersion" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.code">
      <path value="DocumentReference.context.related.identifier.type.coding.code" />
      <short value="Symbol in syntax defined by the system" />
      <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to refer to a particular code in the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./code" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.related.identifier.type.coding.display" />
      <short value="Representation defined by the system" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.2 - but note this is not well followed" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV.displayName" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.coding.userSelected">
      <path value="DocumentReference.context.related.identifier.type.coding.userSelected" />
      <short value="If this coding was chosen directly by the user" />
      <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
      <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
      <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Coding.userSelected" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="boolean" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="Sometimes implied by being first" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CD.codingRationale" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.type.text">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.related.identifier.type.text" />
      <short value="Plain text representation of the concept" />
      <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
      <comment value="Very often the text is the same as a displayName of one of the codings." />
      <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="CodeableConcept.text" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="C*E.9. But note many systems use C*E.2 for this" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.system">
      <path value="DocumentReference.context.related.identifier.system" />
      <short value="The namespace for the identifier value" />
      <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique." />
      <comment value="see http://en.wikipedia.org/wiki/Uniform_resource_identifier" />
      <requirements value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.system" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <example>
        <label value="General" />
        <valueUri value="http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / EI-2-4" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.root or Role.id.root" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierType" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.value">
      <path value="DocumentReference.context.related.identifier.value" />
      <short value="The value that is unique" />
      <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system." />
      <comment value="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](extension-rendered-value.html)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.value" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <example>
        <label value="General" />
        <valueString value="123456" />
      </example>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.1 / EI.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./Value" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.period">
      <path value="DocumentReference.context.related.identifier.period" />
      <short value="Time period when id is/was valid for use" />
      <definition value="Time period during which identifier is/was valid for use." />
      <comment value="This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;). If duration is required, specify the type as Interval|Duration." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.period" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Period" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="per-1" />
        <severity value="error" />
        <human value="If present, start SHALL have a lower value than end" />
        <expression value="start.empty() or end.empty() or (start &lt;= end)" />
        <xpath value="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value &lt;= f:end/@value)" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="IVL&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;] or URG&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;]" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.7 + CX.8" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Role.effectiveTime or implied by context" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./StartDate and ./EndDate" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.period.id">
      <path value="DocumentReference.context.related.identifier.period.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.period.extension">
      <path value="DocumentReference.context.related.identifier.period.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.period.start">
      <path value="DocumentReference.context.related.identifier.period.start" />
      <short value="Starting time with inclusive boundary" />
      <definition value="The start of the period. The boundary is inclusive." />
      <comment value="If the low element is missing, the meaning is that the low boundary is not known." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.start" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.1" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./low" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.period.end">
      <path value="DocumentReference.context.related.identifier.period.end" />
      <short value="End time with inclusive boundary, if not ongoing" />
      <definition value="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." />
      <comment value="The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has a end value of 2012-02-03." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Period.end" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <meaningWhenMissing value="If the end of the period is missing, it means that the period is ongoing" />
      <condition value="ele-1" />
      <condition value="per-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="DR.2" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./high" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner">
      <path value="DocumentReference.context.related.identifier.assigner" />
      <short value="Organization that issued id (may be just text)" />
      <definition value="Organization that issued/manages the identifier." />
      <comment value="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." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Identifier.assigner" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX.4 / (CX.4,CX.9,CX.10)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="./IdentifierIssuingAuthority" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner.id">
      <path value="DocumentReference.context.related.identifier.assigner.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner.extension">
      <path value="DocumentReference.context.related.identifier.assigner.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner.reference">
      <path value="DocumentReference.context.related.identifier.assigner.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner.identifier">
      <path value="DocumentReference.context.related.identifier.assigner.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.identifier.assigner.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.related.identifier.assigner.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.ref">
      <path value="DocumentReference.context.related.ref" />
      <short value="Related Resource" />
      <definition value="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing." />
      <comment value="Order, ProcedureRequest,  Procedure, EligibilityRequest, etc." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="DocumentReference.context.related.ref" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
        <xpath value="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, '#')])" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="./outboundRelationship[typeCode=&quot;PERT&quot; and isNormalActRelationship()] / target[isNormalAct].text.reference" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.ref.id">
      <path value="DocumentReference.context.related.ref.id" />
      <representation value="xmlAttr" />
      <short value="xml:id (or equivalent in JSON)" />
      <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <comment value="Note that FHIR strings may not exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.ref.extension">
      <path value="DocumentReference.context.related.ref.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional Content defined by implementations" />
      <definition value="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." />
      <comment value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.ref.reference">
      <path value="DocumentReference.context.related.ref.reference" />
      <short value="Literal reference, Relative, internal or absolute URL" />
      <definition value="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 value="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 &quot;/[type]/[id]&quot; then it should be assumed that the reference is to a FHIR RESTful server." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <condition value="ref-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.ref.identifier">
      <path value="DocumentReference.context.related.ref.identifier" />
      <short value="Logical reference, when literal reference is not known" />
      <definition value="An identifier for the other resource. This is used when there is no way to reference the other resource directly, either because the entity 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 value="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. &#xA;&#xA;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&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Reference.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. 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]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".identifier" />
      </mapping>
    </element>
    <element id="DocumentReference.context.related.ref.display">
      <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
        <valueBoolean value="true" />
      </extension>
      <path value="DocumentReference.context.related.ref.display" />
      <short value="Text alternative for the resource" />
      <definition value="Plain text narrative that identifies the resource in addition to the resource reference." />
      <comment value="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 value="0" />
      <max value="1" />
      <base>
        <path value="Reference.display" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() | (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="DocumentReference.docStatus">
      <path value="DocumentReference.docStatus" />
      <max value="0" />
    </element>
    <element id="DocumentReference.subject">
      <path value="DocumentReference.subject" />
      <definition value="Who or what the document is about. The document can be about a patient." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
    <element id="DocumentReference.created">
      <path value="DocumentReference.created" />
      <max value="0" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content.attachment.data">
      <path value="DocumentReference.content.attachment.data" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy