<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="patientExample" />
  <url value="http://examplefhir.org/StructureDefinition/patient-ca-ps" />
  <name value="PatientExample" />
  <title value="Patient Example" />
  <status value="draft" />
  <experimental value="false" />
  <date value="2022-01-11T16:00:00-08:00" />
  <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.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="This element employs the constraints on identifier put forth in the CA Baseline using a profiled data type." />
      <type>
        <code value="Identifier" />
        <profile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-identifier" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier.type">
      <path value="Patient.identifier.type" />
      <example>
        <label value="Pattern" />
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="MR" />
          </coding>
        </valueCodeableConcept>
      </example>
    </element>
    <element id="Patient.identifier.system">
      <path value="Patient.identifier.system" />
      <min value="1" />
    </element>
    <element id="Patient.identifier.value">
      <path value="Patient.identifier.value" />
      <short value="The value that is unique within the system." />
      <min value="1" />
    </element>
    <element id="Patient.identifier:PPN">
      <path value="Patient.identifier" />
      <sliceName value="PPN" />
      <short value="Canada Passport Number" />
    </element>
    <element id="Patient.identifier:PPN.type">
      <path value="Patient.identifier.type" />
      <short value="Passport number identifier type" />
      <min value="1" />
      <max value="1" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
          <code value="PPN" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Patient.identifier:PPN.system">
      <path value="Patient.identifier.system" />
      <short value="A Canadian passport number Naming System from the Canadian URI Registry" />
      <min value="1" />
      <max value="1" />
      <fixedUri value="https://fhir.infoway-inforoute.ca/NamingSystem/ca-passport-number" />
    </element>
    <element id="Patient.identifier:PPN.value">
      <path value="Patient.identifier.value" />
      <short value="A Canadian passport number" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Patient.identifier:JPID">
      <path value="Patient.identifier" />
      <sliceName value="JPID" />
      <short value="Jurisdictional Person Identification" />
      <definition value="A jurisdictionally assigned identifier that is distinct from a Jurisdictional Health Number" />
      <comment value="One example of a JPID is an identifier assigned to a patient by a jurisdictional health record (e.g., myHealthNB)" />
    </element>
    <element id="Patient.identifier:JPID.type">
      <path value="Patient.identifier.type" />
      <short value="Jurisdictional Person Identification" />
      <comment value="This identifier type has been requested to be added to the HL7 v2 0204 Identifier Type Table. The system will be updated after the value has been added by the appropriate HL7 Working Group" />
      <min value="1" />
      <max value="1" />
      <fixedCodeableConcept>
        <coding>
          <code value="JPID" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Patient.identifier:JPID.system">
      <path value="Patient.identifier.system" />
      <short value="Jurisdictional Person identification Naming System from the Canadian URI Registry" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Patient.identifier:JPID.value">
      <path value="Patient.identifier.value" />
      <short value="Jurisdictional Person identification number" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Patient.identifier:JHN">
      <path value="Patient.identifier" />
      <sliceName value="JHN" />
      <short value="Jurisdictional Health Number" />
      <definition value="Federal patient and person health numbers used by all jurisdictions across Canada" />
    </element>
    <element id="Patient.identifier:JHN.extension">
      <path value="Patient.identifier.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.identifier:JHN.extension:versionCode">
      <path value="Patient.identifier.extension" />
      <sliceName value="versionCode" />
      <short value="Health Number Version Code" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-identifierversion" />
      </type>
    </element>
    <element id="Patient.identifier:JHN.type">
      <path value="Patient.identifier.type" />
      <min value="1" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
          <code value="JHN" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Patient.identifier:JHN.system">
      <path value="Patient.identifier.system" />
      <short value="A Health Number Naming System from the Canadian URI Registry" />
      <min value="1" />
    </element>
    <element id="Patient.identifier:JHN.value">
      <path value="Patient.identifier.value" />
      <min value="1" />
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <requirements value="Need to be able to track the patient by multiple names. Examples are your official name and a partner name.&#xD;&#xA;The Alphabetic representation of the name SHALL be always provided" />
      <min value="1" />
      <constraint>
        <key value="cabaseline-pat-1" />
        <severity value="error" />
        <human value="Patient.name.given or Patient.name.family or both SHALL be present" />
        <expression value="family.exists() or given.exists()" />
        <xpath value="f:given or f:family" />
      </constraint>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>