<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://digit.org/fhir/StructureDefinition/DIGITHCMFacilityLocation" />
  <name value="DIGITHCMFacilityLocation" />
  <status value="active" />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Location" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Location" />
  <derivation value="constraint" />
  <differential>
    <element id="Location.extension">
      <path value="Location.extension" />
      <slicing>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Location.identifier">
      <path value="Location.identifier" />
      <min value="1" />
    </element>
    <element id="Location.identifier.system">
      <path value="Location.identifier.system" />
      <fixedUri value="https://digit.org/fhir/facilityid" />
    </element>
    <element id="Location.type">
      <path value="Location.type" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="2" />
    </element>
    <element id="Location.type:facility">
      <path value="Location.type" />
      <sliceName value="facility" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://digit.org/CodeSystem/DIGITHCM.Location.Types" />
          <code value="facility" />
        </coding>
      </patternCodeableConcept>
      <binding>
        <strength value="extensible" />
        <description value="Indicates the type of facility at the location." />
      </binding>
    </element>
    <element id="Location.type:usage">
      <path value="Location.type" />
      <sliceName value="usage" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://digit.org/fhir/CodeSystem/facilityUsage" />
        </coding>
      </patternCodeableConcept>
      <binding>
        <strength value="example" />
        <valueSet value="http://digit.org/fhir/ValueSet/facilityUsage" />
      </binding>
    </element>
    <element id="Location.partOf">
      <path value="Location.partOf" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://digit.org/fhir/StructureDefinition/DIGITHCMBoundary" />
        <targetProfile value="https://digit.org/fhir/StructureDefinition/DIGITHCMFacilityLocation" />
      </type>
    </element>
  </differential>
</StructureDefinition>