{
  "resourceType": "StructureDefinition",
  "id": "profile-Person",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Person",
  "name": "Person",
  "title": "Person Profile",
  "status": "active",
  "experimental": false,
  "description": "Information about a registered individual's demographics used as a starting point when introducing a recipient",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Person",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Person",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Person",
        "path": "Person"
      },
      {
        "id": "Person.id",
        "path": "Person.id",
        "comment": "This will also be the ODB number",
        "mustSupport": true
      },
      {
        "id": "Person.identifier",
        "path": "Person.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "use"
            },
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Person.identifier:odbNum",
        "path": "Person.identifier",
        "sliceName": "odbNum",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Person.identifier:odbNum.extension:ODBVersion",
        "path": "Person.identifier.extension",
        "sliceName": "ODBVersion",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7canada.ca/ig/baseline/StructureDefinition/ext-identifierversion"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.healthCardVersion"
          }
        ]
      },
      {
        "id": "Person.identifier:odbNum.use",
        "path": "Person.identifier.use",
        "comment": "Distinguishes current ODBNumber from cross-reference numbers",
        "min": 1,
        "patternCode": "official",
        "mustSupport": true
      },
      {
        "id": "Person.identifier:odbNum.system",
        "path": "Person.identifier.system",
        "short": "Distinguishes type of primary identifier",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-ODBTypes"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.idFlag"
          }
        ]
      },
      {
        "id": "Person.identifier:odbNum.value",
        "path": "Person.identifier.value",
        "min": 1,
        "maxLength": 10,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.odbNum"
          }
        ]
      },
      {
        "id": "Person.identifier:xref",
        "path": "Person.identifier",
        "sliceName": "xref",
        "definition": "Alternate PHNs",
        "mustSupport": true
      },
      {
        "id": "Person.identifier:xref.use",
        "path": "Person.identifier.use",
        "comment": "Distinguishes current ODBNumber from cross-reference numbers",
        "min": 1,
        "patternCode": "old",
        "mustSupport": true
      },
      {
        "id": "Person.identifier:xref.system",
        "path": "Person.identifier.system",
        "short": "Distinguishes type of xref identifier",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-ODBTypes"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "CrossReferenceValuesDTO.idType"
          }
        ]
      },
      {
        "id": "Person.identifier:xref.value",
        "path": "Person.identifier.value",
        "min": 1,
        "maxLength": 10,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "CrossReferenceValuesDTO.id"
          }
        ]
      },
      {
        "id": "Person.name",
        "path": "Person.name",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Person.name.family",
        "path": "Person.name.family",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.lastName"
          }
        ]
      },
      {
        "id": "Person.name.given",
        "path": "Person.name.given",
        "comment": "First name is first repetition, middle name is second repetition",
        "min": 1,
        "max": "2",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.firstName, RpdbDTO.middleName"
          }
        ]
      },
      {
        "id": "Person.gender",
        "path": "Person.gender",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-administrative-gender"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.sex"
          }
        ]
      },
      {
        "id": "Person.birthDate",
        "path": "Person.birthDate",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.birthDate"
          }
        ]
      },
      {
        "id": "Person.address",
        "path": "Person.address",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Person.address.line",
        "path": "Person.address.line",
        "short": "First line of an address. Usually will contain the street number and street name. Second line of an address. Usually will contain an apartment number, rural route or other similar information.",
        "min": 1,
        "max": "2",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.address (1st repetition), RpdbDTO.address2 (2nd repetition)"
          }
        ]
      },
      {
        "id": "Person.address.city",
        "path": "Person.address.city",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.city"
          }
        ]
      },
      {
        "id": "Person.address.state",
        "path": "Person.address.state",
        "min": 1,
        "maxLength": 2,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-Province"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.province"
          }
        ]
      },
      {
        "id": "Person.address.postalCode",
        "path": "Person.address.postalCode",
        "min": 1,
        "maxLength": 10,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.postalCode"
          }
        ]
      },
      {
        "id": "Person.address.country",
        "path": "Person.address.country",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-Country"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.country"
          }
        ]
      },
      {
        "id": "Person.communication",
        "path": "Person.communication",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Person.communication.language",
        "path": "Person.communication.language",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-Language",
          "additional": [
            {
              "purpose": "starter",
              "valueSet": "http://hl7.org/fhir/ValueSet/languages"
            }
          ]
        }
      },
      {
        "id": "Person.communication.language.coding",
        "path": "Person.communication.language.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Person.communication.language.coding.system",
        "path": "Person.communication.language.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Person.communication.language.coding.code",
        "path": "Person.communication.language.coding.code",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "RpdbDTO.language"
          }
        ]
      },
      {
        "id": "Person.communication.preferred",
        "path": "Person.communication.preferred",
        "patternBoolean": true,
        "mustSupport": true
      }
    ]
  }
}