<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="il-core-location" />
  <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="1" />
  </extension>
  <url value="http://fhir.health.gov.il/StructureDefinition/il-core-location" />
  <version value="0.21.0" />
  <name value="ILCoreLocation" />
  <title value="ILCore Location Profile" />
  <status value="draft" />
  <date value="2026-03-23" />
  <publisher value="Israel Core Team" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="tal.primak@moh.gov.il" />
    </telecom>
  </contact>
  <description value="Israel Core proposed constraints and extensions on the Location Resource" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Location" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Location" />
  <derivation value="constraint" />
  <differential>
    <element id="Location">
      <path value="Location" />
      <short value="Israel Core Location Profile" />
      <definition value="The Location Profile is based upon the core FHIR Location Resource" />
      <constraint>
        <key value="il-location-mode" />
        <requirements value="נועד להבטיח שכאשר מייצגים מיקום ספציפי, למופע המתואר תהיה כתובת (או הגדרת מיקום גיאוגרפי). אחרת, הציפיה היא שליחידה אליו המיקום משתייך תהיה כתובת משלה. אילוץ זה עובד בהשלמה עם il-location-address" />
        <severity value="error" />
        <human value="If Location.mode = 'instance', Location.position or Location.address or Location.partOf SHALL have a value" />
        <expression value="mode='instance' implies (address.exists() or position.exists())" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-location" />
      </constraint>
      <constraint>
        <key value="il-location-address" />
        <requirements value="נועד להבטיח שמיקום שנמצא בראש היררכיית המיקומים (לדוגמה - בית חולים) תהיה בעלת כתובת או מיקום. אילוץ מזה משלים את il-location-mode" />
        <severity value="error" />
        <human value="If Location.partOf is empty, Location.address OR Location.position SHALL have a value" />
        <expression value="partOf.empty() implies address.exists() or position.exists()" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-location" />
      </constraint>
    </element>
    <element id="Location.identifier">
      <path value="Location.identifier" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-identifier" />
      </type>
    </element>
    <element id="Location.status">
      <path value="Location.status" />
      <mustSupport value="true" />
    </element>
    <element id="Location.name">
      <path value="Location.name" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Location.telecom.system">
      <path value="Location.telecom.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Location.telecom.value">
      <path value="Location.telecom.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Location.telecom.use">
      <path value="Location.telecom.use" />
      <mustSupport value="true" />
    </element>
    <element id="Location.address">
      <path value="Location.address" />
      <type>
        <code value="Address" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-address" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Location.address.extension:geolocation">
      <path value="Location.address.extension" />
      <sliceName value="geolocation" />
      <max value="0" />
    </element>
    <element id="Location.managingOrganization">
      <path value="Location.managingOrganization" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Location.partOf">
      <path value="Location.partOf" />
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy">
          <valueBoolean value="true" />
        </extension>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-location" />
      </type>
    </element>
  </differential>
</StructureDefinition>