{
  "resourceType": "StructureDefinition",
  "id": "mirjams-course-patient-4",
  "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://mirjams.examples.org/StructureDefinition/mirjams-course-patient-4",
  "version": "0.1.0",
  "name": "MirjamsCoursePatient4",
  "title": "Mirjam's Course Patient Profile",
  "status": "active",
  "description": "Patient profile for the \"Formal constraints\" exercise from Mirjam's Data Modeling course, where a FHIRPath constraint is added",
  "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://mirjams.examples.org/StructureDefinition/mirjams-course-patient-3",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "definition": "Patient profile for exercise 4b in Mirjam's Profiling course, where a FHIRPath constraint is added"
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "constraint": [
          {
            "key": "addr-1",
            "severity": "error",
            "human": "You have to fill in the period of use, when you fill in a temporary address",
            "expression": "(use = 'temp') implies period.exists()"
          }
        ]
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "condition": [
          "addr-1"
        ]
      },
      {
        "id": "Patient.address.period",
        "path": "Patient.address.period",
        "condition": [
          "addr-1"
        ]
      }
    ]
  }
}