<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-patient" />
  <meta>
    <lastUpdated value="2021-03-24T21:20:44.957+00:00" />
  </meta>
  <url value="https://fhir.infoway-inforoute.ca/StructureDefinition/profile-patient-DataConnector" />
  <version value="0.1.1" />
  <name value="DCPatientProfile" />
  <title value="Patient Profile" />
  <status value="draft" />
  <date value="2021-02-05T18:57:01.4075744+00:00" />
  <publisher value="Canada Health Infoway" />
  <description value="Proposed constraints and extensions on the Patient Resource for New Brunswick" />
  <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="Patient Profile" />
      <definition value="The Patient Profile is based upon the draft core Canadian Baseline Patient Profile" />
      <constraint>
        <key value="mds-1" />
        <severity value="error" />
        <human value="Must have [identifier of type JHN] or [address and phone]" />
        <expression value="(identifier.where(type.coding.code='JHN').exists()) or ((address.exists()) and (telecom.exists()))" />
        <source value="http://hl7.org/fhir/ca/core/StructureDefinition/profile-patient-DataConnector" />
      </constraint>
      <mustSupport value="true" />
      <isModifier value="false" />
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <comment value="NB expects to support:&#xD;&#xA;Health Card Number (JHN - called PHN or HCN by NB)&#xD;&#xA;Medicare Number (possibly JPID or MC (from HL7 terminology&#xD;&#xA;myHealthNB number (called DID by NB, not sure what it maps to from HL7 terminology)." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier.type">
      <path value="Patient.identifier.type" />
      <min value="1" />
      <example>
        <label value="Pattern" />
        <valueCodeableConcept>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
            <code value="MR" />
          </coding>
        </valueCodeableConcept>
      </example>
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier.system">
      <path value="Patient.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
      <isModifier value="false" />
    </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" />
      <isModifier value="false" />
    </element>
    <element id="Patient.identifier:JPID">
      <path value="Patient.identifier" />
      <sliceName value="JPID" />
      <short value="Jurisdictional Person Identification" />
      <definition value="Federal patient and person identifiers used by all jurisdictions across Canada" />
      <mustSupport value="false" />
    </element>
    <element id="Patient.identifier:JPID.type">
      <path value="Patient.identifier.type" />
      <short value="Jurisdictional Person Identification" />
      <min value="1" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v2-0203" />
          <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" />
      <example>
        <label value="DID - myHealthNB Number" />
        <valueUri value="https://fhir.infoway-inforoute.ca/NamingSystem/ca-nb-did-id" />
      </example>
    </element>
    <element id="Patient.identifier:JPID.value">
      <path value="Patient.identifier.value" />
      <short value="Jurisdictional Person identification number" />
      <min 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>
      <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" />
      <min value="1" />
      <example>
        <label value="NB Health Card" />
        <valueUri value="https://simplifier.net/canadianuriregistry/ca-nb-patient-healthcare-id" />
      </example>
      <mustSupport value="true" />
    </element>
    <element id="Patient.identifier:JHN.value">
      <path value="Patient.identifier.value" />
      <min value="1" />
      <example>
        <label value="NB Health Card" />
        <valueString value="111222333" />
      </example>
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <min value="1" />
      <constraint>
        <key value="ca-core-name" />
        <severity value="error" />
        <human value="One of Patient.name.given or Patient.name.family SHALL be present" />
        <expression value="family.exists() or given.exists()" />
        <xpath value="f:given or f:family" />
        <source value="http://hl7.org/fhir/ca/core/StructureDefinition/profile-patient" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Patient.name.family">
      <path value="Patient.name.family" />
      <mapping>
        <identity value="v2-PID" />
        <map value="PID-5.1" />
      </mapping>
    </element>
    <element id="Patient.name.given">
      <path value="Patient.name.given" />
      <mapping>
        <identity value="v2-PID" />
        <map value="PID-2 + PID-3" />
      </mapping>
    </element>
    <element id="Patient.telecom">
      <path value="Patient.telecom" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.telecom.system">
      <path value="Patient.telecom.system" />
      <min value="1" />
    </element>
    <element id="Patient.telecom.value">
      <path value="Patient.telecom.value" />
      <min value="1" />
    </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.)  However, because these observations are infrequently recorded, defaulting to the administrative gender is common practice.  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.  See the Patient Gender and Sex section for additional information about communicating patient gender and sex.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Implementation note:  Set as mandatory.  If no value is available from a client registry, the value should be sent as Unknown." />
      <min value="1" />
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address.extension">
      <path value="Patient.address.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.address.extension:preferred">
      <path value="Patient.address.extension" />
      <sliceName value="preferred" />
      <short value="HL7 Preferred Address Flag extension" />
      <definition value="Flag denoting whether parent address item is preferred" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/iso21090-preferred" />
      </type>
    </element>
    <element id="Patient.address.extension:noFixedAddress">
      <path value="Patient.address.extension" />
      <sliceName value="noFixedAddress" />
      <short value="No Fixed Address indicator" />
      <definition value="Flag indicating that there is an assertion that there is no fixed address" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-nofixedaddress" />
      </type>
    </element>
    <element id="Patient.address.extension:noFixedAddress.value[x]">
      <path value="Patient.address.extension.value[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Patient.address.line">
      <path value="Patient.address.line" />
      <min value="1" />
    </element>
    <element id="Patient.address.city">
      <path value="Patient.address.city" />
      <min value="1" />
    </element>
    <element id="Patient.address.postalCode">
      <path value="Patient.address.postalCode" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>