{
  "resourceType": "StructureDefinition",
  "id": "profile-patient-contribution",
  "url": "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-patient-contribution",
  "name": "PCRPatientContribution",
  "title": "PCR Patient Contribution Profile",
  "status": "active",
  "description": "This profile is for PCR Contributions.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient.meta.lastUpdated",
        "path": "Patient.meta.lastUpdated",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier.use",
        "path": "Patient.identifier.use",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier.type",
        "path": "Patient.identifier.type",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ontariohealth.ca/fhir/pcr/ValueSet/pcr-patient-identifier-type"
        }
      },
      {
        "id": "Patient.identifier.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier.value",
        "path": "Patient.identifier.value",
        "short": "Maximum of 40 characters or 10 characters for HCNs",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.active",
        "path": "Patient.active",
        "mustSupport": true
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.name.use",
        "path": "Patient.name.use",
        "mustSupport": true
      },
      {
        "id": "Patient.name.text",
        "path": "Patient.name.text",
        "mustSupport": true
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "short": "Maximum length of 75 characters",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given",
        "slicing": {
          "discriminator": [
            {
              "type": "exists",
              "path": "extension('http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier')"
            }
          ],
          "description": "by extension('http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier')",
          "rules": "open"
        },
        "short": "Maximum length of 50 characters",
        "mustSupport": true
      },
      {
        "id": "Patient.name.given:given-first",
        "path": "Patient.name.given",
        "sliceName": "given-first",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.name.given:given-first.extension",
        "path": "Patient.name.given.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Patient.name.given:given-first.extension:EN-qualifier",
        "path": "Patient.name.given.extension",
        "sliceName": "EN-qualifier",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.name.given:given-middle",
        "path": "Patient.name.given",
        "sliceName": "given-middle",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.name.given:given-middle.extension",
        "path": "Patient.name.given.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Patient.name.given:given-middle.extension:EN-qualifier",
        "path": "Patient.name.given.extension",
        "sliceName": "EN-qualifier",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.name.given:given-middle.extension:EN-qualifier.value[x]",
        "path": "Patient.name.given.extension.value[x]",
        "fixedCode": "MID"
      },
      {
        "id": "Patient.name.prefix",
        "path": "Patient.name.prefix",
        "short": "Maximum length of 20 characters",
        "mustSupport": true
      },
      {
        "id": "Patient.name.suffix",
        "path": "Patient.name.suffix",
        "short": "Maximum length of 50 characters",
        "mustSupport": true
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "mustSupport": true
      },
      {
        "id": "Patient.telecom.system",
        "path": "Patient.telecom.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.telecom.value",
        "path": "Patient.telecom.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.telecom.use",
        "path": "Patient.telecom.use",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.telecom.rank",
        "path": "Patient.telecom.rank",
        "mustSupport": true
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "mustSupport": true
      },
      {
        "id": "Patient.deceased[x]",
        "path": "Patient.deceased[x]",
        "mustSupport": true
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "constraint": [
          {
            "key": "CANUSStateRequired",
            "severity": "error",
            "human": "If the country is CAN or USA, then the state and postalCode must exist",
            "expression": "(country = 'USA' or country = 'CAN') implies (state.exists() and postalCode.exists())",
            "source": "http://ontariohealth.ca/fhir/pcr/StructureDefinition/profile-patient-contribution"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.address.type",
        "path": "Patient.address.type",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.address.text",
        "path": "Patient.address.text",
        "short": "Maximum length of 250 characters",
        "mustSupport": true
      },
      {
        "id": "Patient.address.line",
        "path": "Patient.address.line",
        "short": "Maximum length of 80 characters",
        "min": 1,
        "max": "4",
        "mustSupport": true
      },
      {
        "id": "Patient.address.city",
        "path": "Patient.address.city",
        "short": "Maximum length of 10 characters",
        "mustSupport": true
      },
      {
        "id": "Patient.address.state",
        "path": "Patient.address.state",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ontariohealth.ca/fhir/pcr/ValueSet/province-state-code"
        }
      },
      {
        "id": "Patient.address.postalCode",
        "path": "Patient.address.postalCode",
        "mustSupport": true
      },
      {
        "id": "Patient.address.country",
        "path": "Patient.address.country",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://hl7.org/fhir/ValueSet/iso3166-1-3"
        }
      },
      {
        "id": "Patient.maritalStatus",
        "path": "Patient.maritalStatus",
        "mustSupport": true
      },
      {
        "id": "Patient.multipleBirth[x]",
        "path": "Patient.multipleBirth[x]",
        "mustSupport": true
      },
      {
        "id": "Patient.contact",
        "path": "Patient.contact",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.relationship",
        "path": "Patient.contact.relationship",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.name",
        "path": "Patient.contact.name",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.name.text",
        "path": "Patient.contact.name.text",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.telecom",
        "path": "Patient.contact.telecom",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.telecom.system",
        "path": "Patient.contact.telecom.system",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.telecom.value",
        "path": "Patient.contact.telecom.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.contact.telecom.use",
        "path": "Patient.contact.telecom.use",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.telecom.rank",
        "path": "Patient.contact.telecom.rank",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.address",
        "path": "Patient.contact.address",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.address.text",
        "path": "Patient.contact.address.text",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.gender",
        "path": "Patient.contact.gender",
        "mustSupport": true
      },
      {
        "id": "Patient.communication",
        "path": "Patient.communication",
        "mustSupport": true
      },
      {
        "id": "Patient.communication.language",
        "path": "Patient.communication.language",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ontariohealth.ca/fhir/pcr/ValueSet/human-language"
        }
      },
      {
        "id": "Patient.communication.preferred",
        "path": "Patient.communication.preferred",
        "mustSupport": true
      },
      {
        "id": "Patient.link",
        "path": "Patient.link",
        "mustSupport": true
      }
    ]
  }
}