<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="DocumentReference" />
  <meta>
    <lastUpdated value="2019-11-01T09:29:23.356+11:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Foundation.Documents" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="3" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="not-classified" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="sd" />
  </extension>
  <url value="https://fhir.kemkes.go.id/r4/StructureDefinition/DocumentReference" />
  <version value="4.0.1" />
  <name value="DocumentReference" />
  <status value="draft" />
  <date value="2022-07-08T15:10:50.6856647+00:00" />
  <publisher value="Health Level Seven International (Structured Documents)" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://hl7.org/fhir" />
    </telecom>
  </contact>
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://www.hl7.org/Special/committees/structure/index.cfm" />
    </telecom>
  </contact>
  <description value="A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="fhircomposition" />
    <uri value="http://hl7.org/fhir/composition" />
    <name value="FHIR Composition" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="xds" />
    <uri value="http://ihe.net/xds" />
    <name value="XDS metadata equivalent" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
  <derivation value="specialization" />
  <differential>
    <element id="DocumentReference">
      <path value="DocumentReference" />
      <short value="A reference to a document" />
      <definition value="A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text." />
      <comment value="Usually, this is used for documents other than those defined by FHIR." />
      <mapping>
        <identity value="workflow" />
        <map value="Event" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="when describing a Composition" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Document[classCode=&quot;DOC&quot; and moodCode=&quot;EVN&quot;]" />
      </mapping>
      <mapping>
        <identity value="cda" />
        <map value="when describing a CDA" />
      </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.)." />
      <max value="1" />
      <type>
        <code value="Identifier" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.identifier" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.identifier" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.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="cda" />
        <map value="ClinicalDocument/id" />
      </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." />
      <type>
        <code value="Identifier" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.identifier" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.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>
    </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" />
      <type>
        <code value="code" />
      </type>
      <isModifier value="true" />
      <isModifierReason value="This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid" />
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/document-reference-status|4.0.1" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.status" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.status" />
      </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.availabilityStatus" />
      </mapping>
    </element>
    <element id="DocumentReference.docStatus">
      <path value="DocumentReference.docStatus" />
      <short value="preliminary | final | 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." />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/composition-status|4.0.1" />
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.status" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.status" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="TXA-17" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".statusCode" />
      </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 that describes he exact type of document. Helps humans to assess whether the document is of interest when viewing a list of documents." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/c80-doc-typecodes" />
      </binding>
      <mapping>
        <identity value="workflow" />
        <map value="Event.code" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.class" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.type" />
      </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="cda" />
        <map value="ClinicalDocument/code/@code &#xA;&#xA;The typeCode should be mapped from the ClinicalDocument/code element to a set of document type codes configured in the affinity domain. One suggested coding system to use for typeCode is LOINC, in which case the mapping step can be omitted." />
      </mapping>
    </element>
    <element id="DocumentReference.category">
      <path value="DocumentReference.category" />
      <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="Key metadata element describing the the category or classification of the document. This is a broader perspective that groups similar documents based on how they would be used. This is a primary key used in searching." />
      <alias value="claxs" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/document-classcodes" />
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.class" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.class" />
      </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="cda" />
        <map value="Derived from a mapping of /ClinicalDocument/code/@code to an Affinity Domain specified coded value to use and coding system. Affinity Domains are encouraged to use the appropriate value for Type of Service, based on the LOINC Type of Service (see Page 53 of the LOINC User's Manual). Must be consistent with /ClinicalDocument/code/@code" />
      </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 person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.subject" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.subject[x]" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.subject" />
      </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="cda" />
        <map value="ClinicalDocument/recordTarget/" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.subject" />
      </mapping>
    </element>
    <element id="DocumentReference.date">
      <path value="DocumentReference.date" />
      <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." />
      <alias value="indexed" />
      <max value="1" />
      <type>
        <code value="instant" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.occurrence[x]" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.recorded" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.date" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".availabilityTime[type=&quot;TS&quot;]" />
      </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) or who was the source (informant)." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.actor" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.author" />
      </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="cda" />
        <map value="ClinicalDocument/author" />
      </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." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.actor" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.witness" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.attester" />
      </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="cda" />
        <map value="ClinicalDocument/legalAuthenticator" />
      </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 (software system, vendor, or department) to go to find the current version, where to report issues, etc. This is different from the physical location (URL, disk drive, or server) of the document, which is the technical location of the document, which host may be delegated to the management of some other organization." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.performer.actor" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.custodian" />
      </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.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." />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.relatesTo" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".outboundRelationship" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry Associations" />
      </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" />
      <type>
        <code value="code" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/document-relationship-type|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.relatesTo.code" />
      </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." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.relatesTo.target" />
      </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.description">
      <path value="DocumentReference.description" />
      <short value="Human-readable description" />
      <definition value="Human-readable description of the source document." />
      <comment value="What the document is about,  a terse summary of the document." />
      <requirements value="Helps humans to assess whether the document is of interest." />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
      <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.comments" />
      </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.   &#xA;&#xA;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." />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/security-labels" />
      </binding>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.confidentiality, Composition.meta.security" />
      </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>
      <mapping>
        <identity value="cda" />
        <map value="ClinicalDocument/confidentialityCode/@code" />
      </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" />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="fhircomposition" />
        <map value="Bundle(Composition+*)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="document.text" />
      </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." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Attachment" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.language, &#xA;Composition.title, &#xA;Composition.date" />
      </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, DocumentEntry.creationTime" />
      </mapping>
      <mapping>
        <identity value="cda" />
        <map value="ClinicalDocument/languageCode, ClinicalDocument/title, ClinicalDocument/date" />
      </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." />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <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." />
        <valueSet value="http://hl7.org/fhir/ValueSet/formatcodes" />
      </binding>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.meta.profile" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="document.text" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.formatCode" />
      </mapping>
      <mapping>
        <identity value="cda" />
        <map value="derived from the IHE Profile or Implementation Guide templateID" />
      </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." />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="outboundRelationship[typeCode=&quot;SUBJ&quot;].target[classCode&lt;'ACT']" />
      </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." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
      </type>
      <mapping>
        <identity value="workflow" />
        <map value="Event.context" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="FiveWs.context" />
      </mapping>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.encounter" />
      </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>
    </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 type Code, 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." />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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." />
        <valueSet value="http://terminology.hl7.org/ValueSet/v3-ActCode" />
      </binding>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.event.code" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".code" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.eventCodeList" />
      </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." />
      <max value="1" />
      <type>
        <code value="Period" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.event.period" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value=".effectiveTime" />
      </mapping>
      <mapping>
        <identity value="xds" />
        <map value="DocumentEntry.serviceStartTime, DocumentEntry.serviceStopTime" />
      </mapping>
      <mapping>
        <identity value="cda" />
        <map value="ClinicalDocument/documentationOf/&#xA;serviceEvent/effectiveTime/low/&#xA;@value --&gt; ClinicalDocument/documentationOf/&#xA;serviceEvent/effectiveTime/high/&#xA;@value" />
      </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." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DocumentC80FacilityType" />
        </extension>
        <strength value="example" />
        <description value="XDS Facility Type." />
        <valueSet value="http://hl7.org/fhir/ValueSet/c80-facilitycodes" />
      </binding>
      <mapping>
        <identity value="fhircomposition" />
        <map value="usually from a mapping to a local ValueSet" />
      </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>
      <mapping>
        <identity value="cda" />
        <map value="usually a mapping to a local ValueSet. Must be consistent with /clinicalDocument/code" />
      </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="This element should be based on a coarse classification system for the class of specialty practice. Recommend the use of the classification system for Practice Setting, such as that described by the Subject Matter Domain in LOINC." />
      <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." />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <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)." />
        <valueSet value="http://hl7.org/fhir/ValueSet/c80-practice-codes" />
      </binding>
      <mapping>
        <identity value="fhircomposition" />
        <map value="usually from a mapping to a local ValueSet" />
      </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>
      <mapping>
        <identity value="cda" />
        <map value="usually from a mapping to a local ValueSet" />
      </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." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.subject" />
      </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>
      <mapping>
        <identity value="cda" />
        <map value="ClinicalDocument/recordTarget/" />
      </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." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
      </type>
      <mapping>
        <identity value="fhircomposition" />
        <map value="Composition.event.detail" />
      </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>
      <mapping>
        <identity value="cda" />
        <map value="ClinicalDocument/relatedDocument" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>