<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="signal-invoice" />
  <url value="https://signalbhn.org/fhir/StructureDefinition/invoice" />
  <name value="Invoice" />
  <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" />
  <differential>
    <element id="Invoice.identifier">
      <path value="Invoice.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="Invoice identifier" />
      <definition value="Invoice identifier" />
    </element>
    <element id="Invoice.identifier:UserId">
      <path value="Invoice.identifier" />
      <sliceName value="UserId" />
      <short value="Invoice User Identifier" />
      <definition value="User who generate the pre-bill" />
      <patternIdentifier>
        <system value="https://signalbhn.org/fhir/sid/invoice-user-id" />
      </patternIdentifier>
    </element>
    <element id="Invoice.identifier:ServiceOrgId">
      <path value="Invoice.identifier" />
      <sliceName value="ServiceOrgId" />
      <short value="Invoice ServiceOrg Identifier" />
      <definition value="Service Org identifier is created as slice to store User affiliated service org" />
      <patternIdentifier>
        <system value="https://signalbhn.org/fhir/sid/invoice-serviceorg-id" />
      </patternIdentifier>
    </element>
    <element id="Invoice.type">
      <path value="Invoice.type" />
      <binding>
        <strength value="extensible" />
        <description value="Invoice" />
      </binding>
    </element>
  </differential>
</StructureDefinition>