<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CA-eReC-Patient" />
  <url value="http://fhir.infoway-inforoute.ca/io/CA-pipeline-test/StructureDefinition/CA-eReC-Patient" />
  <name value="Patient" />
  <status value="draft" />
  <description value="The Patient resources contain demographics and other administrative information about the individual who is the subject of the referral." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/patient-ca-core" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <mustSupport value="false" />
    </element>
    <element id="Patient.identifier.type">
      <path value="Patient.identifier.type" />
      <min value="1" />
      <mustSupport value="true" />
    </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" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:JHN">
      <path value="Patient.identifier" />
      <sliceName value="JHN" />
      <short value="Jurisdictional Health Number" />
      <definition value="Patient and person health numbers used by all jurisdictions across Canada" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Patient.identifier:JHN.extension:versionCode">
      <path value="Patient.identifier.extension" />
      <sliceName value="versionCode" />
      <short value="Health Number Version Code" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-HCNV-code-EXT" />
      </type>
    </element>
    <element id="Patient.identifier:JHN.type">
      <path value="Patient.identifier.type" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
          <code value="JHN" />
          <display value="Jurisdictional Health Number" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:JHN.system">
      <path value="Patient.identifier.system" />
      <short value="A Health Number Naming System from the Canadian URI Registry" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:JHN.value">
      <path value="Patient.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:MRN">
      <path value="Patient.identifier" />
      <sliceName value="MRN" />
      <short value="Medical Record Number" />
      <definition value="A local patient identifier from the submitting PoS System" />
      <comment value="Some jurisdictions may consider the MRN identifier type to be an alternative to the JHN identifier type under certain scenarios. These business rules are outside the scope of this profile, however the slice is socialized to prepare implementers for potential use of this pattern within certain jurisdictions" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="Patient.identifier:MRN.type">
      <path value="Patient.identifier.type" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
          <code value="MR" />
          <display value="Medical Record Number" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:MRN.system">
      <path value="Patient.identifier.system" />
      <short value="An identifier for the system supplying the MRN" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:MRN.value">
      <path value="Patient.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <min value="0" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.name.family">
      <path value="Patient.name.family" />
      <min value="0" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.name.given">
      <path value="Patient.name.given" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.telecom">
      <path value="Patient.telecom" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.telecom.system">
      <path value="Patient.telecom.system" />
      <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" />
      <comment value="The gender might not match the biological sex as determined by genetics or the individual's preferred identification. Note that for both humans and particularly animals, there are other legitimate possibilities than male and female, though the vast majority of systems and contexts only support male and female.  Systems providing decision support or enforcing business rules should ideally do this on the basis of Observations dealing with the specific sex or gender aspect of interest (anatomical, chromosomal, social, etc.).  Where such defaulting occurs, rule enforcement should allow for the variation between administrative and biological, chromosomal and other gender aspects.  For example, an alert about a hysterectomy on a male should be handled as a warning or overridable error, not a &quot;hard&quot; error." />
      <mustSupport value="true" />
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address.text">
      <path value="Patient.address.text" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address.postalCode">
      <path value="Patient.address.postalCode" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address.country">
      <path value="Patient.address.country" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.maritalStatus">
      <path value="Patient.maritalStatus" />
      <comment value="MAY be used to identify the maritalStatus of the patient" />
    </element>
    <element id="Patient.contact">
      <path value="Patient.contact" />
      <comment value="MAY be used to identify alternate contacts for the patient" />
    </element>
    <element id="Patient.contact.relationship">
      <path value="Patient.contact.relationship" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/patient-contact-relationship" />
      </binding>
    </element>
    <element id="Patient.contact.name">
      <path value="Patient.contact.name" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.contact.telecom">
      <path value="Patient.contact.telecom" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.communication">
      <path value="Patient.communication" />
      <comment value="where applicable, SHOULD be used to identify the preferred communication language for the patient" />
    </element>
    <element id="Patient.communication.extension">
      <path value="Patient.communication.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.communication.extension:CommunicationBarrier">
      <path value="Patient.communication.extension" />
      <sliceName value="CommunicationBarrier" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ext-CommunicationBarrier" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.communication.extension:CommunicationBarrier.value[x]">
      <path value="Patient.communication.extension.value[x]" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/communication-barrier" />
      </binding>
    </element>
    <element id="Patient.communication.extension:CommunicationBarrier.value[x].code">
      <path value="Patient.communication.extension.value[x].code" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <description value="Contains codes required to identify if the patient speaks/understands an offical language (english/french), or if she/he does not and an interpretor is required." />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/communication-barrier" />
      </binding>
    </element>
    <element id="Patient.communication.language">
      <path value="Patient.communication.language" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/human-language" />
      </binding>
    </element>
    <element id="Patient.communication.preferred">
      <path value="Patient.communication.preferred" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.generalPractitioner">
      <path value="Patient.generalPractitioner" />
      <comment value="where applicable, SHOULD be used to identify patients primary care provider" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Practitioner" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole" />
        <targetProfile value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Organization" />
      </type>
    </element>
    <element id="Patient.generalPractitioner.reference">
      <path value="Patient.generalPractitioner.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.generalPractitioner.identifier">
      <path value="Patient.generalPractitioner.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.generalPractitioner.identifier.system">
      <path value="Patient.generalPractitioner.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.generalPractitioner.identifier.value">
      <path value="Patient.generalPractitioner.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>