<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://cloudconnect.cognisantmd.com/fhir/StructureDefinition/Patient" />
  <name value="Patient" />
  <status value="draft" />
  <description value="Note: these constraints extend the Canadian Baseline profile as a baseDefinition but avoid using it directly, due to a broken link in the Canadian registry: http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-patient" />
  <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.id">
      <path value="Patient.id" />
      <definition value="The logical 'Patient ID' for the FHIR server (e.g. Patient/12120001). It is expected to match the EMR/EHR's MRN (database ID). Do not prefix the ID value here with 'Patient/'." />
      <min value="1" />
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="type.coding.code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="A patient resource may have multiple identifiers, particularly the EMR's Patient ID (MR / MRN), the health card number (JHN). An insurance number or student number may also be included. All of these identifiers could be used by Ocean during a check-in process or upload request." />
      <min value="1" />
    </element>
    <element id="Patient.identifier:MRN">
      <path value="Patient.identifier" />
      <sliceName value="MR" />
      <short value="Medical record number" />
      <comment value="Patient ID in the EMR/EHR" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Patient.identifier:MR.type.coding.system">
      <path value="Patient.identifier.type.coding.system" />
      <sliceName value="MR" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v2-0203" />
    </element>
    <element id="Patient.identifier:MR.system">
      <path value="Patient.identifier.system" />
    </element>
    <element id="Patient.identifier:JHN">
      <path value="Patient.identifier" />
      <sliceName value="JHN" />
      <short value="Jursidictional Health Number (JHN)" />
      <definition value="Federal or provincial health number. The system identifies the province. Ontario version codes are stored as an extension ( http://ehealthontario.ca/API/fhir/StructureDefinition/ext-identifier-hcn-version-code )" />
    </element>
    <element id="Patient.identifier:JHN.system">
      <path value="Patient.identifier.system" />
      <definition value="The system for the JHN, i.e. the province or territory of the HN. The system is used to record the province of the HN. e.g. for Ontario, the system is 'https://fhir.infoway-inforoute.ca/NamingSystem/ca-on-patient-hcn'" />
    </element>
    <element id="Patient.identifier:JHN.type.coding.system">
      <path value="Patient.identifier.type.coding.system" />
      <sliceName value="JHN" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v2-0203" />
    </element>
    <element id="Patient.identifier:JHN.type.coding.code">
      <path value="Patient.identifier.type.coding.code" />
      <sliceName value="JHN" />
      <fixedCode value="JHN" />
    </element>
    <element id="Patient.identifier:JHN.extension:ext-identifier-hcn-version-code.url">
      <path value="Patient.identifier.extension.url" />
      <definition value="The extension Ontario version code value for the health card number." />
      <fixedUri value="http://ehealthontario.ca/API/fhir/StructureDefinition/ext-identifier-hcn-version-code" />
    </element>
    <element id="Patient.identifier:JHN.extension:ext-identifier-hcn-version-code.valueString">
      <path value="Patient.identifier.extension.valueString" />
      <definition value="The two-character Ontario version code value for the health card number." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name.prefix">
      <path value="Patient.name.prefix" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.name.suffix">
      <path value="Patient.name.suffix" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.telecom">
      <path value="Patient.telecom" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.gender">
      <path value="Patient.gender" />
      <definition value="When present, must be male | female | other | unknown as in the FHIR core 'AdministrativeGender' standard. Some EMRs use a single M/F/O 'sex' field for historical reasons, which can be mapped to this value." />
      <mustSupport value="true" />
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.deceased[x]">
      <path value="Patient.deceased[x]" />
      <definition value="An indicator that the patient has died. The patient is assumed alive when no deceased value is provided. Deceased patients will be excluded from implicit Ocean actions such as reminders and schedule synchronization." />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.contact.name">
      <path value="Patient.contact.name" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Patient.communication">
      <path value="Patient.communication" />
      <definition value="A list of the patient's languages." />
      <mustSupport value="true" />
    </element>
    <element id="Patient.communication.language">
      <path value="Patient.communication.language" />
      <definition value="A language spoken by the patient; codes for English should be 'eng' and French should be 'fra' with system http://terminology.hl7.org/CodeSystem/iso639-3 (ISO 639-3)" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.communication.preferred">
      <path value="Patient.communication.preferred" />
      <definition value="Indicates the patient's preferred spoken language when true." />
    </element>
    <element id="Patient.generalPractitioner">
      <path value="Patient.generalPractitioner" />
      <definition value="A reference to the Practitioner designated as the primary care provider for the patient." />
      <type>
        <code value="Reference" />
        <aggregation value="referenced" />
        <versioning value="independent" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Patient.extension">
      <path value="Patient.extension" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="These patient extensions may optionally be used for patient-specific online booking customization." />
      <min value="1" />
    </element>
    <element id="Patient.extension:oab-allowed">
      <path value="Patient.extension" />
      <sliceName value="https://ocean.cognisantmd.com/svc/fhir/v1/StructureDefinition/oab-allowed" />
      <short value="oab-allowed" />
      <definition value="Boolean 'true' or 'false' indicating whether OAB is permitted for this patient. Default is 'true'." />
    </element>
    <element id="Patient.extension:oab-min-days-before-rebooking">
      <path value="Patient.extension" />
      <sliceName value="https://ocean.cognisantmd.com/svc/fhir/v1/StructureDefinition/oab-min-days-before-rebooking" />
      <short value="oab-min-days-before-rebooking" />
      <definition value="Enforces a minimum number of days that the patient must wait until being permitted to book online again." />
    </element>
    <element id="Patient.extension:oab-min-appointment-duration">
      <path value="Patient.extension" />
      <sliceName value="https://ocean.cognisantmd.com/svc/fhir/v1/StructureDefinition/oab-min-appointment-duration" />
      <short value="oab-min-appointment-duration" />
      <definition value="Enforces a minimum duration (in minutes) for all appointments booked online for this patient. For example, an appointment that is normally 10 minutes in duration will be padded to 20 when this value is 20." />
    </element>
  </differential>
</StructureDefinition>