{
  "resourceType": "StructureDefinition",
  "url": "http://em.lynjon.es/fhir/StructureDefinition/TrainingPatient",
  "version": "0.1",
  "name": "TrainingPatient",
  "title": "Training Patient",
  "status": "draft",
  "date": "2020-07-22",
  "publisher": "EJ",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "cda",
      "uri": "http://hl7.org/v3/cda",
      "name": "CDA (R2)"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "loinc",
      "uri": "http://loinc.org",
      "name": "LOINC code for the element"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "definition": "A Patient Profile as part of training."
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.extension:birthPlace",
        "path": "Patient.extension",
        "sliceName": "birthPlace",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.extension:occupation",
        "path": "Patient.extension",
        "sliceName": "occupation",
        "definition": "Occupation of the Patient.",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://em.lynjon.es/fhir/StructureDefinition/Occupation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:sliceOfficialIdentifier",
        "path": "Patient.identifier",
        "sliceName": "sliceOfficialIdentifier",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.identifier:sliceOfficialIdentifier.use",
        "path": "Patient.identifier.use",
        "fixedCode": "official"
      },
      {
        "id": "Patient.identifier:sliceOfficialIdentifier.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://hopsitalone"
      },
      {
        "id": "Patient.identifier:sliceOfficialIdentifier.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:sliceHospitalIdentifier",
        "path": "Patient.identifier",
        "sliceName": "sliceHospitalIdentifier"
      },
      {
        "id": "Patient.identifier:sliceHospitalIdentifier.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "https://hospitaltwo"
      },
      {
        "id": "Patient.identifier:sliceHospitalIdentifier.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "type": [
          {
            "code": "HumanName",
            "profile": [
              "http://em.lynjon.es/fhir/StructureDefinition/MyHumanName"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "mustSupport": true
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.birthDate.extension",
        "path": "Patient.birthDate.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.birthDate.extension:birthTime",
        "path": "Patient.birthDate.extension",
        "sliceName": "birthTime",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthTime"
            ]
          }
        ]
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "constraint": [
          {
            "key": "ej1-addr",
            "severity": "error",
            "human": "Temp address must include a time period.",
            "expression": "(use = 'temp') implies period.exists()",
            "source": "http://em.lynjon.es/fhir/StructureDefinition/TrainingPatient"
          }
        ]
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "condition": [
          "ej1-addr"
        ]
      },
      {
        "id": "Patient.address.period",
        "path": "Patient.address.period",
        "condition": [
          "ej1-addr"
        ]
      },
      {
        "id": "Patient.contact",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Contact"
          }
        ],
        "path": "Patient.contact"
      }
    ]
  }
}