{
  "resourceType": "StructureDefinition",
  "id": "4aadec1d-824e-4b2b-8f40-36b6ff4850a2",
  "meta": {
    "lastUpdated": "2020-07-22T13:24:07.52+00:00"
  },
  "url": "http://dedalus.test/fhir/fhir/StructureDefinition/MeinPatientenProfil",
  "version": "0.1",
  "name": "MeinPatientenProfil",
  "title": "Patienten-Profil",
  "status": "draft",
  "date": "2020-07-22T13:24:07.1886696+00:00",
  "publisher": "Dedalus HealthCare",
  "description": "Dies ist ein Patienten-Profil mit Pflichtfeldern und erweiterter Adresse",
  "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",
        "constraint": [
          {
            "key": "kvid-for-de",
            "severity": "error",
            "human": "KVID is only set for german Patient",
            "expression": "Patient.identifier.where(system='http://fhir.de/NamingSystem/gkv/kvid-10').exists().not() or  Patient.address.where(country='DE').exists()"
          }
        ]
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.extension:myExtension",
        "path": "Patient.extension",
        "sliceName": "myExtension",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dedalus.test/fhir/StructureDefinition/SpeciesExtension"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.ufp/ValueSet/species"
        }
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.identifier:Kvid-10",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Patient.identifier",
        "sliceName": "Kvid-10",
        "max": "1"
      },
      {
        "id": "Patient.identifier:Kvid-10.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://fhir.de/NamingSystem/gkv/kvid-10"
      },
      {
        "id": "Patient.identifier:Kvid-10.value",
        "path": "Patient.identifier.value",
        "min": 1,
        "constraint": [
          {
            "key": "kvid-check",
            "severity": "warning",
            "human": "KVID Check",
            "expression": "matches('^[A-Z][0-9]{9}$')",
            "xpath": "KVID müssen 10-stellig sein und mit einem Großbuchstaben beginnen"
          }
        ]
      },
      {
        "id": "Patient.identifier:CitizenID",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Patient.identifier",
        "sliceName": "CitizenID",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.identifier:CitizenID.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://fhir.ufp/NamingSystem/ufp-citizen-id"
      },
      {
        "id": "Patient.identifier:CitizenID.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "use"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Patient.name:officialName",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Patient.name",
        "sliceName": "officialName",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.name:officialName.use",
        "path": "Patient.name.use",
        "min": 1,
        "fixedCode": "official"
      },
      {
        "id": "Patient.name:officialName.family",
        "path": "Patient.name.family",
        "min": 1
      },
      {
        "id": "Patient.name:officialName.given",
        "path": "Patient.name.given",
        "min": 1
      },
      {
        "id": "Patient.name:maidenName",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Patient.name",
        "sliceName": "maidenName",
        "max": "1"
      },
      {
        "id": "Patient.name:maidenName.use",
        "path": "Patient.name.use",
        "min": 1,
        "fixedCode": "maiden"
      },
      {
        "id": "Patient.name:maidenName.family",
        "path": "Patient.name.family",
        "min": 1
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "min": 1
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "min": 1,
        "type": [
          {
            "code": "Address",
            "profile": [
              "http://dedalus.test/fhir/StructureDefinition/AdresseMitPlanet"
            ]
          }
        ]
      },
      {
        "id": "Patient.contact",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name",
            "valueString": "Contact"
          }
        ],
        "path": "Patient.contact"
      },
      {
        "id": "Patient.contact.address",
        "path": "Patient.contact.address",
        "type": [
          {
            "code": "Address",
            "profile": [
              "http://dedalus.test/fhir/StructureDefinition/AdresseMitPlanet"
            ]
          }
        ]
      }
    ]
  }
}