<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://fhir.synapxe.sg/StructureDefinition/Invoice" />
  <name value="Invoice-StructureDefinition" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Invoice" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Invoice" />
  <derivation value="constraint" />
  <snapshot>
    <element id="Invoice.lineItem.chargeItemReference">
      <path value="Invoice.lineItem.chargeItemReference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ChargeItem" />
        <targetProfile value="http://fhir.synapxe.sg/StructureDefinition/Encounter" />
      </type>
    </element>
  </snapshot>
  <differential>
    <element id="Invoice.lineItem.chargeItemReference">
      <path value="Invoice.lineItem.chargeItemReference" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ChargeItem" />
        <targetProfile value="http://fhir.synapxe.sg/StructureDefinition/Encounter" />
      </type>
    </element>
    <element id="Invoice.extension">
      <path value="Invoice.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Invoice.extension:billType">
      <path value="Invoice.extension" />
      <sliceName value="billType" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ihis.sg/ccdp/extension/billType" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Invoice.extension:billFlag">
      <path value="Invoice.extension" />
      <sliceName value="billFlag" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ihis.sg/ccdp/extension/billFlag" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Invoice.extension:location">
      <path value="Invoice.extension" />
      <sliceName value="location" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ihis.sg/ccdp/extension/location" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Invoice.extension:requesterId">
      <path value="Invoice.extension" />
      <sliceName value="requesterId" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://ihis.sg/ccdp/extension/requesterId" />
      </type>
      <isModifier value="false" />
    </element>
  </differential>
</StructureDefinition>