{
  "resourceType": "StructureDefinition",
  "id": "PatientPSAB",
  "url": "https://www.alberta.ca/fhir/psab/StructureDefinition/PatientPSAB",
  "version": "1.2.0",
  "name": "PatientPSAB",
  "title": "Patient (PS-AB)",
  "status": "draft",
  "description": "This profile defines a set of constraints to the FHIR Patient resource for use in Alberta Patient Summaries (PS-AB). It re-profiles the PS-CA Patient profile and refines constraints applied to the Patient resource by the PS-CA project to represent the minimum expectations for the Patient resource when used in the PS-AB Composition profile or in one of the referred resources.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://fhir.infoway-inforoute.ca/io/psca/StructureDefinition/patient-ca-ps",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "comment": "Patient resources included in Alberta Patient Summary Document Bundles have rules that certain attributes are not to be contained in Patient resource. These are mechanically enforced through invariants at the PS-AB Bundle level."
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "min": 1
      },
      {
        "id": "Patient.extension:individual-recordedSexOrGender",
        "path": "Patient.extension",
        "sliceName": "individual-recordedSexOrGender",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.extension:individual-recordedSexOrGender.extension:value",
        "path": "Patient.extension.extension",
        "sliceName": "value"
      },
      {
        "id": "Patient.extension:individual-recordedSexOrGender.extension:value.value[x]",
        "path": "Patient.extension.extension.value[x]",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.alberta.ca/fhir/ValueSet/administrative-gender-ab"
        }
      },
      {
        "id": "Patient.extension:individual-recordedSexOrGender.extension:type",
        "path": "Patient.extension.extension",
        "sliceName": "type"
      },
      {
        "id": "Patient.extension:individual-recordedSexOrGender.extension:type.value[x]",
        "path": "Patient.extension.extension.value[x]",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.alberta.ca/fhir/ValueSet/recorded-sex-or-gender-type-AB"
        }
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "min": 1
      },
      {
        "id": "Patient.identifier:JHN",
        "path": "Patient.identifier",
        "sliceName": "JHN",
        "sliceIsConstraining": true,
        "comment": "Patients must have at least an AB ULI identifier or another provincial JHN identifier. Implementers supplying ULIs shall use identifier.system of https://fhir.infoway-inforoute.ca/NamingSystem/ca-ab-patient-healthcare-id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:JHN.type",
        "path": "Patient.identifier.type",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:JHN.system",
        "path": "Patient.identifier.system",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:JHN.value",
        "path": "Patient.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Patient.name.text",
        "path": "Patient.name.text",
        "comment": "Mandatory String: Max Character length: 200",
        "min": 1
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "min": 1
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Patient.telecom:Phone",
        "path": "Patient.telecom",
        "sliceName": "Phone",
        "min": 0,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "Patient.telecom:Phone.system",
        "path": "Patient.telecom.system",
        "min": 1,
        "fixedCode": "phone"
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "mustSupport": true
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "comment": "Assumed to be current home address if Address is present but no Use value is provided"
      },
      {
        "id": "Patient.address.type",
        "path": "Patient.address.type",
        "comment": "Valid values: postal / physical / both. Assumed to be 'both' if no value is provided"
      },
      {
        "id": "Patient.address.line",
        "path": "Patient.address.line",
        "min": 1
      },
      {
        "id": "Patient.address.city",
        "path": "Patient.address.city",
        "min": 1
      },
      {
        "id": "Patient.address.state",
        "path": "Patient.address.state",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.address.postalCode",
        "path": "Patient.address.postalCode",
        "min": 1
      },
      {
        "id": "Patient.contact.relationship",
        "path": "Patient.contact.relationship",
        "binding": {
          "strength": "extensible",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/personalrelationshipcodes"
        }
      },
      {
        "id": "Patient.contact.name",
        "path": "Patient.contact.name",
        "min": 1
      }
    ]
  }
}