<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="il-core-patient" />
  <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="2" />
  </extension>
  <url value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
  <version value="0.21.0" />
  <name value="ILCorePatient" />
  <title value="ILCore Patient Profile" />
  <status value="active" />
  <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 Patient Resource." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient">
      <path value="Patient" />
      <short value="ILCore Patient profile" />
      <definition value="The Patient Profile is based upon the core FHIR Patient Resource" />
    </element>
    <element id="Patient.extension">
      <path value="Patient.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.extension:hmo">
      <path value="Patient.extension" />
      <sliceName value="hmo" />
      <short value="Extension: Israel Core HMO (קופת חולים)" />
      <definition value="A code classifying the person's Israeli HMO" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/ext-il-hmo" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.extension:parentName">
      <path value="Patient.extension" />
      <sliceName value="parentName" />
      <short value="Extension: Administrative Parent Name" />
      <definition value="Extension: The name of a person’s parent, recorded for administrative purposes as part of the person’s demographics (e.g to help with identification). This SHOULD NOT be confused with a parent whose details are recorded for contact purposes (Patient.contact) or as a family member (RelatedPerson). Most systems will use the “father’s name” field as the source of data for this extension. NOTE: This extension replaces the old ParentName extension and is the PREFFERED extension" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/ext-administrative-parent-name" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.extension:birthPlace">
      <path value="Patient.extension" />
      <sliceName value="birthPlace" />
      <short value="Extension: Place of Birth for patient" />
      <definition value="Used mainly to record the birth country code" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/patient-birthPlace" />
      </type>
    </element>
    <element id="Patient.extension:birthPlace.value[x].country">
      <path value="Patient.extension.value[x].country" />
      <min value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-extended-country-codes" />
      </binding>
    </element>
    <element id="Patient.extension:immigration">
      <path value="Patient.extension" />
      <sliceName value="immigration" />
      <short value="Extension: Patient Immigration" />
      <definition value="Extension: Immigration information for a patient - for the purpose of this extension - immigration is an international movement of a person to a destination country in order to settle as permanent resident" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/ext-patient-immigration" />
      </type>
    </element>
    <element id="Patient.extension:birthSex">
      <path value="Patient.extension" />
      <sliceName value="birthSex" />
      <short value="Extension: Person Recorded Sex Or Gender" />
      <definition value="A recorded sex or gender property for the individual" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/individual-recordedSexOrGender" />
      </type>
    </element>
    <element id="Patient.extension:birthSex.extension:value">
      <path value="Patient.extension.extension" />
      <sliceName value="value" />
    </element>
    <element id="Patient.extension:birthSex.extension:value.value[x]">
      <path value="Patient.extension.extension.value[x]" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/administrative-gender" />
      </binding>
    </element>
    <element id="Patient.extension:birthSex.extension:type">
      <path value="Patient.extension.extension" />
      <sliceName value="type" />
    </element>
    <element id="Patient.extension:birthSex.extension:type.value[x]">
      <path value="Patient.extension.extension.value[x]" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="76689-9" />
          <display value="Sex assigned at birth" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-identifier" />
      </type>
    </element>
    <element id="Patient.identifier.system">
      <path value="Patient.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier.value">
      <path value="Patient.identifier.value" />
      <short value="The value that is unique within the system." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:il-id">
      <path value="Patient.identifier" />
      <sliceName value="il-id" />
      <short value="Israeli National Identifier" />
      <definition value="Israeli ID number (9 digit unchangeable number, including leading zeros and includes a control digit), including temporarily identification numbers assigned by Israeli National Insurance" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:il-id.system">
      <path value="Patient.identifier.system" />
      <fixedUri value="http://fhir.health.gov.il/identifier/il-national-id" />
    </element>
    <element id="Patient.identifier:il-id.value">
      <path value="Patient.identifier.value" />
      <short value="An Israeli ID number" />
      <example>
        <label value="Valid Example" />
        <valueString value="000000018" />
      </example>
      <constraint>
        <key value="il-id-chk" />
        <severity value="error" />
        <human value="Israeli ID must be 9-digits with a correct check-digit at the end." />
        <expression value="matches('^[0-9]{9}$') and&#xD;&#xA;substring(8,1).toInteger()=&#xD;&#xA;(10-((substring(0,1).toInteger() +&#xD;&#xA;substring(1,1).toInteger()*2 mod 10 +&#xD;&#xA;substring(1,1).toInteger()*2 div 10 +&#xD;&#xA;substring(2,1).toInteger() +&#xD;&#xA;substring(3,1).toInteger()*2 mod 10 +&#xD;&#xA;substring(3,1).toInteger()*2 div 10 +&#xD;&#xA;substring(4,1).toInteger() +&#xD;&#xA;substring(5,1).toInteger()*2 mod 10 +&#xD;&#xA;substring(5,1).toInteger()*2 div 10 +&#xD;&#xA;substring(6,1).toInteger() +&#xD;&#xA;substring(7,1).toInteger()*2 mod 10 +&#xD;&#xA;substring(7,1).toInteger()*2 div 10) mod 10)) mod 10" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
      </constraint>
    </element>
    <element id="Patient.identifier:il-id.assigner">
      <path value="Patient.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.identifier:pna-id">
      <path value="Patient.identifier" />
      <sliceName value="pna-id" />
      <short value="Palestinian National Identifier" />
      <definition value="Palestinian ID number" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.identifier:pna-id.system">
      <path value="Patient.identifier.system" />
      <fixedUri value="http://fhir.health.gov.il/identifier/pna-national-id" />
    </element>
    <element id="Patient.identifier:pna-id.value">
      <path value="Patient.identifier.value" />
      <short value="A Palestininan ID number" />
      <example>
        <label value="Valid Example" />
        <valueString value="000000018" />
      </example>
    </element>
    <element id="Patient.identifier:ppn">
      <path value="Patient.identifier" />
      <sliceName value="ppn" />
      <short value="Passport Number" />
      <definition value="Passport number" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.identifier:ppn.type">
      <path value="Patient.identifier.type" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
          <code value="PPN" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Patient.identifier:ppn.system">
      <path value="Patient.identifier.system" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/passport-uri" />
      </binding>
    </element>
    <element id="Patient.identifier:ppn.value">
      <path value="Patient.identifier.value" />
      <short value="Passport Number" />
    </element>
    <element id="Patient.identifier:prisoner-id">
      <path value="Patient.identifier" />
      <sliceName value="prisoner-id" />
      <short value="Prisoner Number" />
      <definition value="Israel Prison Service prisoner number (5-6 digits number). A unique identifier for any prisoner currently serving a prison sentence" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:prisoner-id.system">
      <path value="Patient.identifier.system" />
      <fixedUri value="http://fhir.health.gov.il/identifier/il-prisoner-number" />
    </element>
    <element id="Patient.identifier:prisoner-id.value">
      <path value="Patient.identifier.value" />
      <short value="Prisoner Number" />
      <example>
        <label value="Valid Example" />
        <valueString value="123456" />
      </example>
      <constraint>
        <key value="il-prison-num" />
        <severity value="error" />
        <human value="up to 8 digits prisoner number, allowing for hebrew characters" />
        <expression value="matches('^[a-zA-Z0-9_אבגדהוזחטי כלמנסעפצקרתשךףץ]{0,8}$')" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
      </constraint>
    </element>
    <element id="Patient.identifier:prisoner-id.assigner">
      <path value="Patient.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.identifier:enc-il-id">
      <path value="Patient.identifier" />
      <sliceName value="enc-il-id" />
      <short value="National Identifier - MoH encrypted" />
      <definition value="The person's national identifier after applying MoH's standard primary encryption algorithm" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.identifier:enc-il-id.system">
      <path value="Patient.identifier.system" />
      <fixedUri value="http://fhir.health.gov.il/identifier/encrypted-id-primary-moh" />
    </element>
    <element id="Patient.identifier:enc-il-id.value">
      <path value="Patient.identifier.value" />
      <short value="An encrypted identifier" />
      <example>
        <label value="Valid Example" />
        <valueString value="000000018" />
      </example>
    </element>
    <element id="Patient.identifier:enc-il-id.assigner">
      <path value="Patient.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.identifier:entry-permit">
      <path value="Patient.identifier" />
      <sliceName value="entry-permit" />
      <short value="Israeli Temporary entry permit" />
      <definition value="Israeli Temporary entry permit number. For cases in which the State of Israel has issued such a document and this is the main form of identifiaction" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:entry-permit.system">
      <path value="Patient.identifier.system" />
      <fixedUri value="http://fhir.health.gov.il/identifier/il-entry-permit" />
    </element>
    <element id="Patient.identifier:entry-permit.value">
      <path value="Patient.identifier.value" />
      <short value="An Israeli Visa Number" />
      <example>
        <label value="Valid Example" />
        <valueString value="000000018" />
      </example>
    </element>
    <element id="Patient.identifier:entry-permit.assigner">
      <path value="Patient.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.identifier:enc-pna-id">
      <path value="Patient.identifier" />
      <sliceName value="enc-pna-id" />
      <short value="Palestinian ID number" />
      <definition value="Ecoded Palestinian National Identifier" />
      <min value="0" />
      <max value="1" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.identifier:enc-pna-id.system">
      <path value="Patient.identifier.system" />
      <fixedUri value="http://fhir.health.gov.il/identifier/encrypted-pna-id-primary-moh" />
    </element>
    <element id="Patient.identifier:enc-pna-id.value">
      <path value="Patient.identifier.value" />
      <short value="A Palestininan ID number" />
    </element>
    <element id="Patient.identifier:enc-pna-id.assigner">
      <path value="Patient.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="extension('http://hl7.org/fhir/StructureDefinition/language').value" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <constraint>
        <key value="il-patient-name" />
        <severity value="error" />
        <human value="Either Patient.name.given and/or Patient.name.family SHALL be present or a Data Absent Reason Extension SHALL be present." />
        <expression value="(family.exists() or given.exists()) or extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists()" />
        <source value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Patient.name.extension:dataAbsentReason">
      <path value="Patient.name.extension" />
      <sliceName value="dataAbsentReason" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
    </element>
    <element id="Patient.name.family">
      <path value="Patient.name.family" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name.given">
      <path value="Patient.name.given" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name:Hebrew">
      <path value="Patient.name" />
      <sliceName value="Hebrew" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name:Hebrew.extension:dataAbsentReason">
      <path value="Patient.name.extension" />
      <sliceName value="dataAbsentReason" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
    </element>
    <element id="Patient.name:Hebrew.extension:language">
      <path value="Patient.name.extension" />
      <sliceName value="language" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-language" />
      </type>
    </element>
    <element id="Patient.name:Hebrew.extension:language.value[x]">
      <path value="Patient.name.extension.value[x]" />
      <fixedCode value="he" />
    </element>
    <element id="Patient.name:English">
      <path value="Patient.name" />
      <sliceName value="English" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name:English.extension:dataAbsentReason">
      <path value="Patient.name.extension" />
      <sliceName value="dataAbsentReason" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
    </element>
    <element id="Patient.name:English.extension:language">
      <path value="Patient.name.extension" />
      <sliceName value="language" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-language" />
      </type>
    </element>
    <element id="Patient.name:English.extension:language.value[x]">
      <path value="Patient.name.extension.value[x]" />
      <fixedCode value="en" />
    </element>
    <element id="Patient.name:Arabic">
      <path value="Patient.name" />
      <sliceName value="Arabic" />
      <min value="0" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name:Arabic.extension:dataAbsentReason">
      <path value="Patient.name.extension" />
      <sliceName value="dataAbsentReason" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
    </element>
    <element id="Patient.name:Arabic.extension:language">
      <path value="Patient.name.extension" />
      <sliceName value="language" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-language" />
      </type>
    </element>
    <element id="Patient.name:Arabic.extension:language.value[x]">
      <path value="Patient.name.extension.value[x]" />
      <fixedCode value="ar" />
    </element>
    <element id="Patient.telecom.extension:purpose">
      <path value="Patient.telecom.extension" />
      <sliceName value="purpose" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/contactpoint-purpose" />
      </type>
    </element>
    <element id="Patient.telecom.extension:purpose.value[x]">
      <path value="Patient.telecom.extension.value[x]" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-contact-point-purpose" />
      </binding>
    </element>
    <element id="Patient.telecom.system">
      <path value="Patient.telecom.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.telecom.value">
      <path value="Patient.telecom.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.telecom.use">
      <path value="Patient.telecom.use" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.gender">
      <path value="Patient.gender" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <type>
        <code value="Address" />
        <profile value="http://fhir.health.gov.il/StructureDefinition/il-core-address" />
      </type>
    </element>
    <element id="Patient.contact">
      <path value="Patient.contact" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="relationship" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.contact.telecom.extension:purpose">
      <path value="Patient.contact.telecom.extension" />
      <sliceName value="purpose" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/contactpoint-purpose" />
      </type>
    </element>
    <element id="Patient.contact.telecom.extension:purpose.value[x]">
      <path value="Patient.contact.telecom.extension.value[x]" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.health.gov.il/ValueSet/il-core-contact-point-purpose" />
      </binding>
    </element>
    <element id="Patient.contact.organization">
      <path value="Patient.contact.organization" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.contact:parent">
      <path value="Patient.contact" />
      <sliceName value="parent" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Patient.contact:parent.relationship">
      <path value="Patient.contact.relationship" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-RoleCode" />
          <code value="PRN" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Patient.contact:parent.telecom.extension:purpose">
      <path value="Patient.contact.telecom.extension" />
      <sliceName value="purpose" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/contactpoint-purpose" />
      </type>
    </element>
    <element id="Patient.communication.language">
      <path value="Patient.communication.language" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.generalPractitioner">
      <path value="Patient.generalPractitioner" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-practitioner" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-practitioner-role" />
      </type>
    </element>
    <element id="Patient.managingOrganization">
      <path value="Patient.managingOrganization" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-organization" />
      </type>
    </element>
    <element id="Patient.link.other">
      <path value="Patient.link.other" />
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy">
          <valueBoolean value="false" />
        </extension>
        <code value="Reference" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-patient" />
        <targetProfile value="http://fhir.health.gov.il/StructureDefinition/il-core-related-person" />
      </type>
    </element>
  </differential>
</StructureDefinition>