{
  "resourceType": "StructureDefinition",
  "url": "https://example.org/fhir/StructureDefinition/MyPatient",
  "name": "MyPatient",
  "status": "draft",
  "description": "Excercise profile FP034_EX02",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "definition": "Excercise profile FP034_EX02"
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Patient.extension:occupation",
        "path": "Patient.extension",
        "sliceName": "occupation",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://example.org/fhir/StructureDefinition/MyExtension"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.extension:occupation.value[x]",
        "path": "Patient.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.code"
            }
          ],
          "rules": "open"
        },
        "binding": {
          "strength": "preferred",
          "valueSet": "http://mysample.org/fhir/ValueSet/Occupations"
        }
      },
      {
        "id": "Patient.extension:occupation.value[x].coding.system",
        "path": "Patient.extension.value[x].coding.system",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://mysample.org/fhir/ValueSet/Occupations"
        }
      },
      {
        "id": "Patient.extension:birthplace",
        "path": "Patient.extension",
        "sliceName": "birthplace",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:officialIdentifier",
        "path": "Patient.identifier",
        "sliceName": "officialIdentifier",
        "short": "The official national identifier for this patient",
        "fixedIdentifier": {
          "use": "official",
          "system": "http://national.registry.org/ids"
        }
      },
      {
        "id": "Patient.identifier:officialIdentifier.system",
        "path": "Patient.identifier.system",
        "min": 1
      },
      {
        "id": "Patient.identifier:officialIdentifier.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:hospitalIdentifier",
        "path": "Patient.identifier",
        "sliceName": "hospitalIdentifier",
        "max": "1",
        "fixedIdentifier": {
          "use": "secondary",
          "system": "http://myhospital.registry.org/ids"
        }
      },
      {
        "id": "Patient.identifier:hospitalIdentifier.system",
        "path": "Patient.identifier.system",
        "min": 1
      },
      {
        "id": "Patient.identifier:hospitalIdentifier.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "type": [
          {
            "code": "HumanName",
            "profile": [
              "https://example.org/fhir/StructureDefinition/MyHumanName"
            ]
          }
        ],
        "mustSupport": false
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "use"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.telecom:privateInfo",
        "path": "Patient.telecom",
        "sliceName": "privateInfo",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.telecom:privateInfo.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom:privateInfo.use",
        "path": "Patient.telecom.use",
        "min": 1,
        "fixedCode": "home"
      },
      {
        "id": "Patient.telecom:workInfo",
        "path": "Patient.telecom",
        "sliceName": "workInfo",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.telecom:workInfo.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom:workInfo.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.birthDate.extension",
        "path": "Patient.birthDate.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Patient.birthDate.extension:myExtension",
        "path": "Patient.birthDate.extension",
        "sliceName": "myExtension",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthTime"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.birthDate.extension:myExtension.value[x]",
        "path": "Patient.birthDate.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "constraint": [
          {
            "key": "my-constraint-adress-temp",
            "severity": "error",
            "human": "Temporär adress måste vara tidsbegränsad",
            "expression": "(use = 'temp') implies period.exists()"
          }
        ]
      },
      {
        "id": "Patient.address.use",
        "path": "Patient.address.use",
        "condition": [
          "my-constraint-adress-temp"
        ]
      },
      {
        "id": "Patient.address.period",
        "path": "Patient.address.period",
        "condition": [
          "my-constraint-adress-temp"
        ]
      }
    ]
  }
}