{
  "resourceType": "StructureDefinition",
  "id": "profile-patient",
  "url": "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-patient",
  "version": "1.1.1",
  "name": "PatientProfile",
  "title": "Patient Profile",
  "status": "draft",
  "date": "2026-01-09",
  "publisher": "HL7 Canada - FHIR Implementation Work Group",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "https://infocentral.infoway-inforoute.ca/en/collaboration/wg/fhir-implementations"
        }
      ]
    }
  ],
  "description": "Proposed constraints and extensions on the Patient Resource as scoped to human patients",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "CA"
        }
      ]
    }
  ],
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "cda",
      "uri": "http://hl7.org/v3/cda",
      "name": "CDA (R2)"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "loinc",
      "uri": "http://loinc.org",
      "name": "LOINC code for the element"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "short": "Patient Profile",
        "definition": "The Patient Profile is based upon the core FHIR Patient Resource",
        "isModifier": false
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.extension:aboriginalidentitygroup",
        "path": "Patient.extension",
        "sliceName": "aboriginalidentitygroup",
        "short": "Extension: Aboriginal Identity Group",
        "definition": "A code classifying the person's aboriginal identity",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-aboriginalidentitygroup"
            ]
          }
        ]
      },
      {
        "id": "Patient.extension:aboriginalidentityindicator",
        "path": "Patient.extension",
        "sliceName": "aboriginalidentityindicator",
        "short": "Extension: Aboriginal Identity Indicator",
        "definition": "A code classifying the person's self identity as an aboriginal person",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-aboriginalidentityindicator"
            ]
          }
        ]
      },
      {
        "id": "Patient.extension:birthsex",
        "path": "Patient.extension",
        "sliceName": "birthsex",
        "short": "Extension: Sex at Birth",
        "definition": "A code classifying the person's sex assigned at birth  as specified by the [TODO: assigning authority]. This extension aligns with the C-CDA Birth Sex Observation (LOINC 76689-9)",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-patientbirthsex"
            ]
          }
        ]
      },
      {
        "id": "Patient.extension:ethnicity",
        "path": "Patient.extension",
        "sliceName": "ethnicity",
        "short": "Extension: ethnicity extension",
        "definition": "A code classifying the person's ethnic group or ethnicity as the category of people who identify with each other, usually on the basis of a presumed common genealogy or ancestry or on other similarities.",
        "comment": "This attribute is based on the belief of the person or the person reporting the attribute, not on any formal analysis of genetic, genealogical or historical relationships as these would need to be captured as observations.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-ethnicity"
            ]
          }
        ],
        "isModifier": false,
        "mapping": [
          {
            "identity": "HL7v2",
            "map": "PID.22 [Ethnic Group]",
            "comment": "This field further defines the patient's ancestry.  Refer to User-defined Table 0189 - Ethnic Group in Chapter 2C, Code Tables, for suggested values."
          },
          {
            "identity": "rim",
            "map": "Person.ethnicGroupCode",
            "comment": "A code classifying the person into a named category of humans sharing a common real or presumed heritage"
          },
          {
            "identity": "CDA",
            "map": "/ClinicalDocument/recordTarget/patientRole/patient/sdtc:ethnicGroupCode",
            "comment": "This CDA R2 SDTC ethnicGroupCode extension is used to record additional ethnicity groups for the recordTarget or subjectPerson"
          }
        ]
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "open"
        },
        "min": 0,
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/profile-identifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier.type",
        "path": "Patient.identifier.type",
        "comment": "The slice provided below is one example of an identifier type and has been socialized because of a Canadian extension on that identifier type. It is not required, and the slicing is open meaning that other types can be provided."
      },
      {
        "id": "Patient.identifier.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "isModifier": false
      },
      {
        "id": "Patient.identifier.value",
        "path": "Patient.identifier.value",
        "short": "The value that is unique within the system.",
        "min": 1,
        "isModifier": false
      },
      {
        "id": "Patient.identifier:JHN",
        "path": "Patient.identifier",
        "sliceName": "JHN",
        "short": "Jurisdictional Health Number",
        "definition": "Federal patient and person health numbers used by all jurisdictions across Canada"
      },
      {
        "id": "Patient.identifier:JHN.extension",
        "path": "Patient.identifier.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.identifier:JHN.extension:versionCode",
        "path": "Patient.identifier.extension",
        "sliceName": "versionCode",
        "short": "Health Number Version Code",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-identifierversion"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier:JHN.type",
        "path": "Patient.identifier.type",
        "min": 1,
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
              "code": "JHN"
            }
          ]
        }
      },
      {
        "id": "Patient.identifier:JHN.system",
        "path": "Patient.identifier.system",
        "short": "A Health Number Naming System from the Canadian URI Registry",
        "min": 1
      },
      {
        "id": "Patient.identifier:JHN.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 0,
        "constraint": [
          {
            "key": "ipa-pat-2",
            "severity": "error",
            "human": "Either Patient.name.given and/or Patient.name.family and/or Patient.name.text SHALL be present or a Data Absent Reason Extension SHALL be present.",
            "expression": "(family.exists() or given.exists() or text.exists()) xor extension.where(url='http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists()",
            "xpath": "(/f:name/f:extension/@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason' and not(/f:name/f:family or /f:name/f:given or /f:name/f:text)) or (not(/f:name/f:extension/@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason') and (/f:name/f:family or /f:name/f:given or /f:name/f:text))"
          }
        ]
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family"
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given"
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom"
      },
      {
        "id": "Patient.telecom.system",
        "path": "Patient.telecom.system",
        "min": 1
      },
      {
        "id": "Patient.telecom.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.address",
        "path": "Patient.address"
      },
      {
        "id": "Patient.address.extension",
        "path": "Patient.address.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.address.extension:preferred",
        "path": "Patient.address.extension",
        "sliceName": "preferred",
        "short": "HL7 Preferred Address Flag extension",
        "definition": "Flag denoting whether parent address item is preferred",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/iso21090-preferred"
            ]
          }
        ]
      },
      {
        "id": "Patient.address.extension:noFixedAddress",
        "path": "Patient.address.extension",
        "sliceName": "noFixedAddress",
        "short": "No Fixed Address indicator",
        "definition": "Flag indicating that there is an assertion that there is no fixed address",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/ca/baseline/StructureDefinition/ext-nofixedaddress"
            ]
          }
        ]
      }
    ]
  }
}