{
  "resourceType": "StructureDefinition",
  "url": "https://cloudconnect.cognisantmd.com/fhir/StructureDefinition/Patient",
  "name": "Patient",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "description": "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",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient.id",
        "path": "Patient.id",
        "min": 1,
        "definition": "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/'."
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "type.coding.code"
            }
          ],
          "rules": "open"
        },
        "definition": "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": 1
      },
      {
        "id": "Patient.identifier:MRN",
        "path": "Patient.identifier",
        "sliceName": "MR",
        "short": "Medical record number",
        "comment": "Patient ID in the EMR/EHR",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.identifier:MR.type.coding.system",
        "path": "Patient.identifier.type.coding.system",
        "sliceName": "MR",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v2-0203"
      },
      {
        "id": "Patient.identifier:MR.system",
        "path": "Patient.identifier.system"
      },
      {
        "id": "Patient.identifier:JHN",
        "path": "Patient.identifier",
        "sliceName": "JHN",
        "short": "Jursidictional Health Number (JHN)",
        "definition": "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 )",
        "mappings": []
      },
      {
        "id": "Patient.identifier:JHN.system",
        "path": "Patient.identifier.system",
        "definition": "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'"
      },
      {
        "id": "Patient.identifier:JHN.type.coding.system",
        "path": "Patient.identifier.type.coding.system",
        "sliceName": "JHN",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v2-0203"
      },
      {
        "id": "Patient.identifier:JHN.type.coding.code",
        "sliceName": "JHN",
        "path": "Patient.identifier.type.coding.code",
        "fixedCode": "JHN"
      },
      {
        "id": "Patient.identifier:JHN.extension:ext-identifier-hcn-version-code.url",
        "path": "Patient.identifier.extension.url",
        "definition": "The extension Ontario version code value for the health card number.",
        "fixedUri": "http://ehealthontario.ca/API/fhir/StructureDefinition/ext-identifier-hcn-version-code"
      },
      {
        "id": "Patient.identifier:JHN.extension:ext-identifier-hcn-version-code.valueString",
        "path": "Patient.identifier.extension.valueString",
        "definition": "The two-character Ontario version code value for the health card number.",
        "mustSupport": true,
        "min": "0",
        "max": "1"
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "mustSupport": true
      },
      {
        "id": "Patient.name.prefix",
        "path": "Patient.name.prefix",
        "mustSupport": true,
        "max": "1"
      },
      {
        "id": "Patient.name.suffix",
        "path": "Patient.name.suffix",
        "mustSupport": true,
        "max": "1"
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "mustSupport": true
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "mustSupport": true,
        "definition": "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."
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "mustSupport": true
      },
      {
        "id": "Patient.deceased[x]",
        "path": "Patient.deceased[x]",
        "definition": "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": true
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "mustSupport": true
      },
      {
        "id": "Patient.communication",
        "path": "Patient.communication",
        "definition": "A list of the patient's languages.",
        "mustSupport": true
      },
      {
        "id": "Patient.communication.language",
        "path": "Patient.communication.language",
        "definition": "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": true
      },
      {
        "id": "Patient.communication.preferred",
        "path": "Patient.communication.preferred",
        "definition": "Indicates the patient's preferred spoken language when true."
      },
      {
        "id": "Patient.generalPractitioner",
        "path": "Patient.generalPractitioner",
        "definition": "A reference to the Practitioner designated as the primary care provider for the patient.",
        "type": [
          {
            "code": "Reference",
            "aggregation": [
              "referenced"
            ],
            "versioning": "independent"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "definition": "These patient extensions may optionally be used for patient-specific online booking customization.",
        "min": 1
      },
      {
        "id": "Patient.extension:oab-allowed",
        "path": "Patient.extension",
        "sliceName": "https://ocean.cognisantmd.com/svc/fhir/v1/StructureDefinition/oab-allowed",
        "short": "oab-allowed",
        "definition": "Boolean 'true' or 'false' indicating whether OAB is permitted for this patient. Default is 'true'."
      },
      {
        "id": "Patient.extension:oab-min-days-before-rebooking",
        "path": "Patient.extension",
        "sliceName": "https://ocean.cognisantmd.com/svc/fhir/v1/StructureDefinition/oab-min-days-before-rebooking",
        "short": "oab-min-days-before-rebooking",
        "definition": "Enforces a minimum number of days that the patient must wait until being permitted to book online again."
      },
      {
        "id": "Patient.extension:oab-min-appointment-duration",
        "path": "Patient.extension",
        "sliceName": "https://ocean.cognisantmd.com/svc/fhir/v1/StructureDefinition/oab-min-appointment-duration",
        "short": "oab-min-appointment-duration",
        "definition": "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."
      }
    ]
  }
}