{
  "resourceType": "StructureDefinition",
  "id": "TestCoursePatient",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Individuals"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    }
  ],
  "url": "http://test.examples.org/StructureDefinition/test-course-patient",
  "version": "0.1.0",
  "name": "TestCoursePatientFirely",
  "title": "TestCoursePatientFirely",
  "status": "active",
  "description": "Patient profile for exercise 2 in Mirjam's Profiling course",
  "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": "This is the profile for Patient that results from completing the second exercise of the Profiling training course."
      },
      {
        "id": "Patient.extension:birthPlace",
        "path": "Patient.extension",
        "sliceName": "birthPlace",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.extension:occupationFirelyExtension",
        "path": "Patient.extension",
        "sliceName": "occupationFirelyExtension",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://example.org/fhir/StructureDefinition/OccupationFirelyExtension"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.extension:occupationFirelyExtension.value[x]",
        "path": "Patient.extension.value[x]",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://example.org/fhir/ValueSet/occupation"
        }
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:NationalRegistry",
        "path": "Patient.identifier",
        "sliceName": "NationalRegistry",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.identifier:NationalRegistry.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://national.registry.org/ids"
      },
      {
        "id": "Patient.identifier:NationalRegistry.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:HospitalId",
        "path": "Patient.identifier",
        "sliceName": "HospitalId"
      },
      {
        "id": "Patient.identifier:HospitalId.system",
        "path": "Patient.identifier.system",
        "fixedUri": "http://example.org/testvalue"
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "type": [
          {
            "code": "HumanName",
            "profile": [
              "https://example.org/fhir/StructureDefinition/TrainingHumanName"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "mustSupport": true
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given",
        "max": "3",
        "mustSupport": true
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "use"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Patient.telecom:privateDetails",
        "path": "Patient.telecom",
        "sliceName": "privateDetails",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.telecom:privateDetails.system",
        "path": "Patient.telecom.system",
        "min": 1
      },
      {
        "id": "Patient.telecom:privateDetails.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom:privateDetails.use",
        "path": "Patient.telecom.use",
        "min": 1,
        "fixedCode": "home"
      },
      {
        "id": "Patient.telecom:workDetails",
        "path": "Patient.telecom",
        "sliceName": "workDetails",
        "max": "1"
      },
      {
        "id": "Patient.telecom:workDetails.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom:workDetails.use",
        "path": "Patient.telecom.use",
        "min": 1,
        "fixedCode": "work"
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "mustSupport": true
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "constraint": [
          {
            "key": "training-3",
            "severity": "error",
            "human": "Fill in the Period!!",
            "expression": "(use = 'temp') implies period.exists()"
          }
        ]
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "condition": [
          "training-3"
        ]
      },
      {
        "id": "Patient.address.period",
        "path": "Patient.address.period",
        "condition": [
          "training-3"
        ]
      }
    ]
  }
}