{
  "resourceType": "StructureDefinition",
  "id": "eipatient",
  "meta": {
    "lastUpdated": "2019-12-13T03:23:22.509+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "pa"
    }
  ],
  "url": "http://www.agfa.com/ei/fhir/eipatient",
  "version": "1.3-beta",
  "name": "Enterprise Imaging Patient",
  "status": "active",
  "date": "2017-07-24T09:42:06.4413463+00:00",
  "description": "Enterprise Imaing customized Patient resoruce definition.",
  "fhirVersion": "3.0.1",
  "mapping": [
    {
      "identity": "agfa-ei-model",
      "name": "Enterprise Imaing Data Model"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient.identifier.type",
        "path": "Patient.identifier.type",
        "short": "PAT_CODE|PAT_MEDICALRECORDNR",
        "binding": {
          "strength": "extensible",
          "valueSetReference": {
            "reference": "http://www.agfa.com/ei/fhir/ValueSet/ei-vs-patient-type"
          }
        },
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT_ID#PAT_ID_TYPE_CODE"
          }
        ]
      },
      {
        "id": "Patient.identifier.system",
        "path": "Patient.identifier.system",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ID_ISSUER#ENTITY_UID",
            "comment": "entity uid"
          }
        ]
      },
      {
        "id": "Patient.identifier.value",
        "path": "Patient.identifier.value",
        "min": 1,
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT_ID#PAT_ID",
            "comment": "patient id"
          }
        ]
      },
      {
        "id": "Patient.identifier.period",
        "path": "Patient.identifier.period",
        "max": "0"
      },
      {
        "id": "Patient.identifier.assigner.reference",
        "path": "Patient.identifier.assigner.reference",
        "max": "0"
      },
      {
        "id": "Patient.identifier.assigner.identifier",
        "path": "Patient.identifier.assigner.identifier",
        "max": "0"
      },
      {
        "id": "Patient.identifier.assigner.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Patient.identifier.assigner.display",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ID_ISSUER#ENTITY_ID",
            "comment": "issue of the patient id"
          }
        ]
      },
      {
        "id": "Patient.active",
        "path": "Patient.active",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT#ACTIVE"
          }
        ]
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "max": "6"
      },
      {
        "id": "Patient.name.use",
        "path": "Patient.name.use",
        "short": "official | maiden",
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://www.agfa.com/ei/fhir/ValueSet/ei-name-use"
          }
        },
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT#PAT_NAME_FK | PATIENT#MAIDEN_NAME_FK"
          }
        ]
      },
      {
        "id": "Patient.name.text",
        "path": "Patient.name.text",
        "comment": "Display name based on system setting."
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "mustSupport": false,
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PERSON_NAME#FAMILY_NAME"
          }
        ]
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PERSON_NAME#GIVEN_NAME | PERSON_NAME#MIDDLE_NAME"
          }
        ]
      },
      {
        "id": "Patient.name.prefix",
        "path": "Patient.name.prefix",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PERSON_NAME_PREFIX"
          }
        ]
      },
      {
        "id": "Patient.name.suffix",
        "path": "Patient.name.suffix",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PERSON_NAME#NAME_SUFFIX"
          }
        ]
      },
      {
        "id": "Patient.name.period",
        "path": "Patient.name.period",
        "max": "0"
      },
      {
        "id": "Patient.telecom.system",
        "path": "Patient.telecom.system",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_TYPE"
          }
        ]
      },
      {
        "id": "Patient.telecom.value",
        "path": "Patient.telecom.value",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#EMAIL | COMMUNICATION_CHANNEL#TELEPHONE_NUMBER"
          }
        ]
      },
      {
        "id": "Patient.telecom.use",
        "path": "Patient.telecom.use",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_TYPE"
          }
        ]
      },
      {
        "id": "Patient.telecom.rank",
        "path": "Patient.telecom.rank",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#PREFERRED",
            "comment": "1 =  PREFERRED, others sort by type and name."
          }
        ]
      },
      {
        "id": "Patient.telecom.period",
        "path": "Patient.telecom.period",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#VALID_FROM | COMMUNICATION_CHANNEL#VALID_TILL"
          }
        ]
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "binding": {
          "strength": "required",
          "valueSetUri": "http://hl7.org/fhir/ValueSet/administrative-gender"
        },
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT#PAT_SEX"
          }
        ]
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "patternDate": "2017-07-20",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT#PAT_BIRTHDATE",
            "comment": "YYYY-MM-DD"
          }
        ]
      },
      {
        "id": "Patient.deceased[x]:deceasedDateTime",
        "path": "Patient.deceasedDateTime",
        "sliceName": "deceasedDateTime",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT#PAT_DECEASEDDATE"
          }
        ]
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL"
          }
        ]
      },
      {
        "id": "Patient.address.type",
        "path": "Patient.address.type",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_TYPE"
          }
        ]
      },
      {
        "id": "Patient.address.text",
        "path": "Patient.address.text",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "formated patient addresss info",
            "comment": "formated patient addresss info"
          }
        ]
      },
      {
        "id": "Patient.address.line",
        "path": "Patient.address.line",
        "max": "4",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#ADDRESS_LINE(X)",
            "comment": "1-4"
          }
        ]
      },
      {
        "id": "Patient.address.city",
        "path": "Patient.address.city",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "MUNICIPALITY"
          }
        ]
      },
      {
        "id": "Patient.address.district",
        "path": "Patient.address.district",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#ADDRESS_LINE(4)"
          }
        ]
      },
      {
        "id": "Patient.address.state",
        "path": "Patient.address.state",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#ADDRESS_LINE(3)"
          }
        ]
      },
      {
        "id": "Patient.address.postalCode",
        "path": "Patient.address.postalCode",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "MUNICIPALITY#ZIP"
          }
        ]
      },
      {
        "id": "Patient.address.country",
        "path": "Patient.address.country",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#COUNTRY"
          }
        ]
      },
      {
        "id": "Patient.address.period",
        "path": "Patient.address.period",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "COMMUNICATION_CHANNEL#VALID_FROM | COMMUNICATION_CHANNEL#VALID_TILL"
          }
        ]
      },
      {
        "id": "Patient.maritalStatus",
        "path": "Patient.maritalStatus",
        "max": "0"
      },
      {
        "id": "Patient.multipleBirth[x]",
        "path": "Patient.multipleBirth[x]",
        "max": "0"
      },
      {
        "id": "Patient.photo",
        "path": "Patient.photo",
        "max": "0"
      },
      {
        "id": "Patient.contact",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Contact"
          }
        ],
        "path": "Patient.contact",
        "max": "0"
      },
      {
        "id": "Patient.animal",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Animal"
          }
        ],
        "path": "Patient.animal",
        "max": "0"
      },
      {
        "id": "Patient.communication",
        "path": "Patient.communication",
        "max": "0"
      },
      {
        "id": "Patient.generalPractitioner",
        "path": "Patient.generalPractitioner",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner"
          },
          {
            "code": "Reference",
            "targetProfile": "http://www.agfa.com/ei/fhir/StructureDefinition/ei-practitioner"
          }
        ],
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "PATIENT#PROFESSIONAL"
          }
        ]
      },
      {
        "id": "Patient.managingOrganization",
        "path": "Patient.managingOrganization",
        "max": "0"
      },
      {
        "id": "Patient.link",
        "path": "Patient.link",
        "max": "1"
      },
      {
        "id": "Patient.link.other",
        "path": "Patient.link.other",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://www.agfa.com/ei/fhir/eipatient"
          }
        ],
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "patient_merge#merged_patient",
            "comment": "with type replaces"
          }
        ]
      }
    ]
  }
}