{
  "resourceType": "StructureDefinition",
  "meta": {
    "lastUpdated": "2017-12-14T14:25:59.179+00:00"
  },
  "url": "http://clinicalsite.org/fhir/StructureDefinition/patient-soa",
  "name": "patient-soa",
  "status": "draft",
  "experimental": true,
  "date": "2017-12-11T14:32:21.758+00:00",
  "description": "A patient resource containing the minimally required data for Subject Management",
  "fhirVersion": "3.0.1",
  "mapping": [
    {
      "identity": "V2 ADT",
      "name": "HL7 V2"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "PID"
          }
        ]
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type.coding.code"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:PID",
        "path": "Patient.identifier",
        "sliceName": "PID",
        "min": 1,
        "max": "1",
        "constraint": [
          {
            "key": "pat-soa-1",
            "severity": "warning",
            "human": "All patient identifier systems should match the pattern \"http://.*/NamingSystem/patient-identifier\"",
            "expression": "system.matches(\"http://.*/NamingSystem/patient-identifier\")"
          }
        ]
      },
      {
        "id": "Patient.identifier:PID.type.coding.system",
        "path": "Patient.identifier.type.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/v2/0203",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "fixed value"
          }
        ]
      },
      {
        "id": "Patient.identifier:PID.type.coding.code",
        "path": "Patient.identifier.type.coding.code",
        "min": 1,
        "fixedCode": "MR",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "fixed value"
          }
        ]
      },
      {
        "id": "Patient.identifier:PID.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "constraint": [
          {
            "key": "pat-soa-1",
            "severity": "warning",
            "human": "All patient identifier systems should match the pattern \".*/NamingSystem/patient-identifier\". Please refer to the Implementation Guide for details.",
            "expression": "matches(\".*/NamingSystem/patient-identifier\")"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "site dependent fixed value"
          }
        ]
      },
      {
        "id": "Patient.identifier:PID.value",
        "path": "Patient.identifier.value",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "PID.#3.1"
          }
        ]
      },
      {
        "id": "Patient.active",
        "path": "Patient.active",
        "definition": "All patients should be set to \"active\" unless they have been cancelled or merged",
        "mustSupport": true
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "PID.#5.1"
          }
        ]
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "PID.#5.2"
          }
        ]
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "PID.#8 (mapping required)"
          }
        ]
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "PID.#7.1 (formatting required)"
          }
        ]
      },
      {
        "id": "Patient.animal",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Animal"
          }
        ],
        "path": "Patient.animal",
        "definition": "This project only deals with human patients",
        "max": "0"
      },
      {
        "id": "Patient.link",
        "path": "Patient.link",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "V2 ADT",
            "map": "refer to implementation guide"
          }
        ]
      },
      {
        "id": "Patient.link.other.reference",
        "path": "Patient.link.other.reference",
        "mustSupport": true
      },
      {
        "id": "Patient.link.type",
        "path": "Patient.link.type",
        "definition": "When two patients are merged, the merged patient should be updated with a reference (replaced-by) to the remaining patient and the remaining patient should be updated with a reference (replaces) to the merged patient.",
        "mustSupport": true
      }
    ]
  }
}