{
  "resourceType": "StructureDefinition",
  "id": "cz-patient",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Individuals"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    }
  ],
  "url": "https://ncez.mzcr.cz/standards/fhir/ig/core/StructureDefinition/cz-patient",
  "version": "0.5.0",
  "name": "CZ_Patient",
  "title": "Patient (CZ)",
  "status": "active",
  "publisher": "Národní centrum elektronického zdravotnictví (NCEZ)",
  "contact": [
    {
      "name": "Národní centrum elektronického zdravotnictví (NCEZ)",
      "telecom": [
        {
          "system": "url",
          "value": "https://ncez.mzcr.cz"
        }
      ]
    }
  ],
  "description": "Information about an individual receiving health care services",
  "jurisdiction": [
    {
      "coding": [
        {
          "code": "CZ",
          "system": "urn:iso:std:iso:3166",
          "display": "Czechia"
        }
      ]
    }
  ],
  "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.language",
        "path": "Patient.language",
        "patternCode": "cs_CZ"
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Patient.extension:nationality",
        "path": "Patient.extension",
        "sliceName": "nationality",
        "short": "Nationality/Státní občanství",
        "definition": "Státní občanství dle zákona 186/2013. Státní občanství, jak je uváděno na oficiálních dokladech k prokázání identity.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-nationality"
            ]
          }
        ]
      },
      {
        "id": "Patient.extension:nationality.extension:code",
        "path": "Patient.extension.extension",
        "sliceName": "code"
      },
      {
        "id": "Patient.extension:nationality.extension:code.valueCodeableConcept",
        "path": "Patient.extension.extension.valueCodeableConcept",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://www.hl7.org/fhir/valueset-country.html"
        }
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "definition": "An identifier for this patient.\r\n\r\nTypically, when National birth Id (RC) is available it is used. Organizations will most likely want to also include a local identifier, using its own system. A type can be added if needed.",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:RC",
        "path": "Patient.identifier",
        "sliceName": "RC",
        "definition": "An identifier for this patient according to National Birth Registry\r\n\r\nWhen needed to express a RC, it SHALL be done according to these guidelines. Other ways to identify a patient using coding systems remain also possible.",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:RC.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "https://ncez.mzcr.cz/standards/fhir/sid/rcis"
      },
      {
        "id": "Patient.identifier:RC.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:RID",
        "path": "Patient.identifier",
        "sliceName": "RID",
        "definition": "An unique patient identifier (resortní identifikátor) according to the National Patient Register",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:RID.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "https://ncez.mzcr.cz/standards/fhir/sid/rid"
      },
      {
        "id": "Patient.identifier:RID.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "definition": "A name associated with the individual. \n\nIt is RECOMMENDED to give at least one familyname and at least one given name when possible and define an 'official' use. When names are given, a consumer SHALL NOT ignore it.",
        "requirements": "Need to be able to track the patient by multiple names. Examples are your official name and a alias or nickname.\r\nThe Alphabetic representation of the name SHALL be always provided",
        "min": 1,
        "constraint": [
          {
            "key": "cz-pat-1",
            "severity": "error",
            "human": "Patient.name.given, Patient.name.family nebo Patient.name.text MUSÍ být uveden",
            "expression": "family.exists() or given.exists() or text.exists()",
            "xpath": "f:given or f:family or f:text",
            "source": "https://ncez.mzcr.cz/standards/fhir/ig/core/StructureDefinition/cz-patient"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.name.text",
        "path": "Patient.name.text",
        "definition": "Text representation of the full name. Due to the cultural variance around the world a consuming system may not know how to present the name correctly; moreover not all the parts of the name go in given or family. Creators are therefore strongly encouraged to provide through this element a presented version of the name. Future versions of this guide may require this element",
        "mustSupport": true
      },
      {
        "id": "Patient.name.family",
        "path": "Patient.name.family",
        "mustSupport": true
      },
      {
        "id": "Patient.name.given",
        "path": "Patient.name.given",
        "mustSupport": true
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "definition": "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.\n\nIt is RECOMMENDED to at least add one phone or email address with clear indication using the .use element whether it is home use, private use,...",
        "mustSupport": true,
        "slicing": {
          "description": "Information about an individual receiving health care services",
          "ordered": false,
          "rules": "closed"
        },
        "min": 0,
        "max": 3
      },
      {
        "id": "Patient.telecom:HomePhone",
        "path": "Patient.telecom",
        "sliceName": "HomePhone",
        "min": "1",
        "max": "1"
      },
      {
        "id": "Patient.telecom:HomePhone.system",
        "path": "Patient.telecom.system",
        "min": "1",
        "fixedCode": "phone"
      },
      {
        "id": "Patient.telecom:HomePhone.value",
        "path": "Patient.telecom.value",
        "min": "1"
      },
      {
        "id": "Patient.telecom:HomePhone.use",
        "path": "Patient.telecom.use",
        "min": "1",
        "fixedCode": "home"
      },
      {
        "id": "Patient.telecom:WorkPhone",
        "path": "Patient.telecom",
        "sliceName": "WorkPhone",
        "min": "0",
        "max": "1"
      },
      {
        "id": "Patient.telecom:WorkPhone.system",
        "path": "Patient.telecom.system",
        "min": "1",
        "fixedCode": "phone"
      },
      {
        "id": "Patient.telecom:WorkPhone.value",
        "path": "Patient.telecom.value",
        "min": "1"
      },
      {
        "id": "Patient.telecom:WorkPhone.use",
        "path": "Patient.telecom.use",
        "min": "1",
        "fixedCode": "work"
      },
      {
        "id": "Patient.telecom:Email",
        "path": "Patient.telecom",
        "sliceName": "Email",
        "min": "0",
        "max": "1"
      },
      {
        "id": "Patient.telecom:Email.system",
        "path": "Patient.telecom.system",
        "min": "1",
        "fixedCode": "email"
      },
      {
        "id": "Patient.telecom:Email.value",
        "path": "Patient.telecom.value",
        "min": "1"
      },
      {
        "id": "Patient.telecom:Email.use",
        "path": "Patient.telecom.use",
        "max": "1"
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://ncez.mzcr.cz/standards/fhir/ig/core/ValueSet/cz-administrative-gender-vs"
        }
      },
      {
        "id": "Patient.deceased[x]",
        "path": "Patient.deceased[x]",
        "mustSupport": true
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "definition": "An address for the individual. \n\nIt is RECOMMENDED to include an address when available. When needed to express the availablity of a Patient at home (e.g. only Wednesdays), another solution will be defined.",
        "mustSupport": true
      },
      {
        "id": "Patient.contact.relationship",
        "path": "Patient.contact.relationship",
        "binding": {
          "strength": "required",
          "valueSet": "https://ncez.mzcr.cz/standards/fhir/ig/core/ValueSet/cz-contactperson-relation-vs"
        }
      },
      {
        "id": "Patient.contact.gender",
        "path": "Patient.contact.gender",
        "binding": {
          "strength": "required",
          "valueSet": "https://ncez.mzcr.cz/standards/fhir/ig/core/ValueSet/cz-administrative-gender-vs"
        }
      },
      {
        "id": "Patient.link",
        "path": "Patient.link",
        "slicing": {
          "description": "Information about an individual receiving health care services",
          "ordered": false,
          "rules": "closed"
        },
        "min": 1,
        "max": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.link:ReferencedBy",
        "path": "Patient.link",
        "sliceName": "ReferencedBy",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.link:ReferencedBy.type",
        "path": "Patient.link.type",
        "fixedCode": "replaced-by",
        "min": "1"
      }
    ]
  }
}