<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-documentreference" />
  <url value="https://fhir.synapxe.sg/StructureDefinition/profile-documentreference" />
  <name value="DocumentReference" />
  <title value="Document Reference Profile" />
  <status value="active" />
  <publisher value="Synapxe" />
  <description value="This resource is used as a reference to any kind of document for any purpose. Instances of DocumentReference can mingle metadata from the document being described with metadata from the documenting it, but not replace metadata from the source document." />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <type>
        <code value="Identifier" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-identifier" />
      </type>
    </element>
    <element id="DocumentReference.modality">
      <path value="DocumentReference.modality" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.type">
      <path value="DocumentReference.type" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.type.coding.version">
      <path value="DocumentReference.type.coding.version" />
      <max value="0" />
    </element>
    <element id="DocumentReference.category">
      <path value="DocumentReference.category" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.subject.id">
      <path value="DocumentReference.subject.id" />
      <max value="0" />
    </element>
    <element id="DocumentReference.subject.reference">
      <path value="DocumentReference.subject.reference" />
      <max value="0" />
    </element>
    <element id="DocumentReference.subject.type">
      <path value="DocumentReference.subject.type" />
      <min value="1" />
      <patternUri value="Patient" />
    </element>
    <element id="DocumentReference.subject.identifier">
      <path value="DocumentReference.subject.identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-identifier" />
      </type>
    </element>
    <element id="DocumentReference.subject.identifier.system">
      <path value="DocumentReference.subject.identifier.system" />
      <min value="1" />
      <patternUri value="https://fhir.synapxe.sg/NamingSystem/nric" />
    </element>
    <element id="DocumentReference.subject.display">
      <path value="DocumentReference.subject.display" />
      <max value="0" />
    </element>
    <element id="DocumentReference.context">
      <path value="DocumentReference.context" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-patient" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-encounter" />
      </type>
    </element>
    <element id="DocumentReference.event.concept">
      <path value="DocumentReference.event.concept" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.bodySite.concept">
      <path value="DocumentReference.bodySite.concept" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.facilityType">
      <path value="DocumentReference.facilityType" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.practiceSetting">
      <path value="DocumentReference.practiceSetting" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-practitioner" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-organization" />
      </type>
    </element>
    <element id="DocumentReference.attester.mode">
      <path value="DocumentReference.attester.mode" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-organization" />
      </type>
    </element>
    <element id="DocumentReference.relatesTo.code">
      <path value="DocumentReference.relatesTo.code" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.securityLabel">
      <path value="DocumentReference.securityLabel" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="DocumentReference.content.id">
      <path value="DocumentReference.content.id" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content.extension">
      <path value="DocumentReference.content.extension" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content.modifierExtension">
      <path value="DocumentReference.content.modifierExtension" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content.attachment">
      <path value="DocumentReference.content.attachment" />
      <type>
        <code value="Attachment" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-attachment" />
      </type>
    </element>
    <element id="DocumentReference.content.profile">
      <path value="DocumentReference.content.profile" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>