{
  "resourceType": "StructureDefinition",
  "id": "PLMedicalEvent",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2019-08-06T15:11:02.083+00:00",
    "security": [
      {
        "system": "https://hl7.org/fhir/R4/v3/ConfidentialityClassification/vs.html",
        "userSelected": false
      }
    ]
  },
  "text": {
    "status": "empty",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" />"
  },
  "url": "https://ezdrowie.gov.pl/fhir/StructureDefinition/PLMedicalEvent",
  "name": "PLMedicalEvent",
  "status": "draft",
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "snapshot": {},
  "differential": {
    "element": [
      {
        "id": "Encounter",
        "path": "Encounter",
        "short": "Zdarzenie Medyczne"
      },
      {
        "id": "Encounter.meta",
        "path": "Encounter.meta",
        "min": 1
      },
      {
        "id": "Encounter.meta.security",
        "path": "Encounter.meta.security",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[2].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventSecurityLabels"
        }
      },
      {
        "id": "Encounter.meta.security.system",
        "path": "Encounter.meta.security.system",
        "min": 1,
        "fixedUri": "https://ezdrowie.gov.pl/fhir/CodeSystem/PLCodeSystemSecurityLabels"
      },
      {
        "id": "Encounter.meta.security.code",
        "path": "Encounter.meta.security.code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[4].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLSecurityLabels"
        }
      },
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.identifier.system",
        "path": "Encounter.identifier.system",
        "min": 1
      },
      {
        "id": "Encounter.identifier.value",
        "path": "Encounter.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "short": "in-progress | onleave | finished",
        "definition": "in-progress | onleave | finished",
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[8].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventStatus"
        }
      },
      {
        "id": "Encounter.statusHistory.status",
        "path": "Encounter.statusHistory.status",
        "short": "onleave",
        "definition": "onleave",
        "fixedCode": "onleave"
      },
      {
        "id": "Encounter.statusHistory.period.start",
        "path": "Encounter.statusHistory.period.start",
        "min": 1
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[11].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventClass"
        }
      },
      {
        "id": "Encounter.class.system",
        "path": "Encounter.class.system",
        "min": 1,
        "fixedUri": "https://ezdrowie.gov.pl/fhir/CodeSystem/PLMedicalEventCodeSystemClass"
      },
      {
        "id": "Encounter.class.code",
        "path": "Encounter.class.code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[13].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventClass"
        }
      },
      {
        "id": "Encounter.class.display",
        "path": "Encounter.class.display",
        "min": 1
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient"
          }
        ]
      },
      {
        "id": "Encounter.subject.extension",
        "path": "Encounter.subject.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.subject.extension:insurance",
        "path": "Encounter.subject.extension",
        "sliceName": "insurance",
        "type": [
          {
            "code": "Extension",
            "profile": "https://ezdrowie.gov.pl/fhir/StructureDefinition/PLInsuranceReference"
          }
        ]
      },
      {
        "id": "Encounter.subject.identifier",
        "path": "Encounter.subject.identifier",
        "min": 1
      },
      {
        "id": "Encounter.subject.identifier.system",
        "path": "Encounter.subject.identifier.system",
        "min": 1
      },
      {
        "id": "Encounter.subject.identifier.value",
        "path": "Encounter.subject.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.episodeOfCare",
        "path": "Encounter.episodeOfCare",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.episodeOfCare.identifier",
        "path": "Encounter.episodeOfCare.identifier",
        "min": 1
      },
      {
        "id": "Encounter.episodeOfCare.identifier.system",
        "path": "Encounter.episodeOfCare.identifier.system",
        "min": 1
      },
      {
        "id": "Encounter.episodeOfCare.identifier.value",
        "path": "Encounter.episodeOfCare.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.basedOn",
        "path": "Encounter.basedOn",
        "max": "1"
      },
      {
        "id": "Encounter.basedOn.identifier",
        "path": "Encounter.basedOn.identifier",
        "min": 1
      },
      {
        "id": "Encounter.basedOn.identifier.system",
        "path": "Encounter.basedOn.identifier.system",
        "min": 1
      },
      {
        "id": "Encounter.basedOn.identifier.value",
        "path": "Encounter.basedOn.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.participant",
        "path": "Encounter.participant",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.participant.extension",
        "path": "Encounter.participant.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.participant.extension:specialty",
        "path": "Encounter.participant.extension",
        "sliceName": "specialty",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "https://ezdrowie.gov.pl/fhir/StructureDefinition/PLSpecialty"
          }
        ]
      },
      {
        "id": "Encounter.participant.extension:specialty.value[x].system",
        "path": "Encounter.participant.extension.value[x].system",
        "min": 1,
        "fixedUri": "https://ezdrowie.gov.pl/fhir/CodeSystem/PLCodeSystemMedicalEventStaffRole"
      },
      {
        "id": "Encounter.participant.extension:specialty.value[x].code",
        "path": "Encounter.participant.extension.value[x].code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[33].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventStaffRole"
        }
      },
      {
        "id": "Encounter.participant.individual",
        "path": "Encounter.participant.individual",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner"
          }
        ]
      },
      {
        "id": "Encounter.participant.individual.identifier",
        "path": "Encounter.participant.individual.identifier",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual.identifier.system",
        "path": "Encounter.participant.individual.identifier.system",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual.identifier.value",
        "path": "Encounter.participant.individual.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "min": 1
      },
      {
        "id": "Encounter.period.start",
        "path": "Encounter.period.start",
        "min": 1
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "max": "1"
      },
      {
        "id": "Encounter.hospitalization.admitSource",
        "path": "Encounter.hospitalization.admitSource",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[41].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventAdmitSource"
        }
      },
      {
        "id": "Encounter.hospitalization.admitSource.coding",
        "path": "Encounter.hospitalization.admitSource.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.hospitalization.admitSource.coding.system",
        "path": "Encounter.hospitalization.admitSource.coding.system",
        "min": 1,
        "fixedUri": "https://ezdrowie.gov.pl/fhir/CodeSystem/PLMedicalEventCodeSystemAdmitSource"
      },
      {
        "id": "Encounter.hospitalization.admitSource.coding.code",
        "path": "Encounter.hospitalization.admitSource.coding.code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSetUnknownType_StructureDefinition.differential.element[44].binding": "https://ezdrowie.gov.pl/fhir/ValueSet/PLMedicalEventAdmitSource"
        }
      },
      {
        "id": "Encounter.hospitalization.dischargeDisposition.coding",
        "path": "Encounter.hospitalization.dischargeDisposition.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.hospitalization.dischargeDisposition.coding.system",
        "path": "Encounter.hospitalization.dischargeDisposition.coding.system",
        "min": 1,
        "fixedUri": "urn:oid:2.16.840.1.113883.3.4424.11.3.21"
      },
      {
        "id": "Encounter.hospitalization.dischargeDisposition.coding.code",
        "path": "Encounter.hospitalization.dischargeDisposition.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "min": 1
      },
      {
        "id": "Encounter.serviceProvider.extension",
        "path": "Encounter.serviceProvider.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.serviceProvider.extension:payor",
        "path": "Encounter.serviceProvider.extension",
        "sliceName": "payor",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": "https://ezdrowie.gov.pl/fhir/StructureDefinition/PLPayorReference"
          }
        ]
      },
      {
        "id": "Encounter.serviceProvider.identifier",
        "path": "Encounter.serviceProvider.identifier",
        "min": 1
      },
      {
        "id": "Encounter.serviceProvider.identifier.system",
        "path": "Encounter.serviceProvider.identifier.system",
        "min": 1
      },
      {
        "id": "Encounter.serviceProvider.identifier.value",
        "path": "Encounter.serviceProvider.identifier.value",
        "min": 1
      }
    ]
  }
}