{
  "resourceType": "StructureDefinition",
  "url": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Encounter-ForADT-Master",
  "name": "Encounter-ForADT-Master",
  "status": "active",
  "description": "Dedalus API Framework core profile for Encounter-Master for ADT transactions",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter.meta",
        "path": "Encounter.meta",
        "min": 1
      },
      {
        "id": "Encounter.extension",
        "path": "Encounter.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.extension:healthCharge",
        "path": "Encounter.extension",
        "sliceName": "healthCharge",
        "short": "healthCharge",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/extension-encounter-heathcharge"
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSetUri": "http://apiframework.dedalus.eu/fhir/ValueSet/HealthChargeCodes-ForADT"
        }
      },
      {
        "id": "Encounter.extension:haveAutopsy",
        "path": "Encounter.extension",
        "sliceName": "haveAutopsy",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/extension-encounter-haveAutopsy"
          }
        ]
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "short": "IMP | SS",
        "definition": "inpatient | short stay",
        "comment": "Use code: \"IMP\", display: \"inpatient\" for inpatient admissions, code: \"SS\", display: \"short stay\" for outpatient admissions",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/v3-ActCode"
          }
        }
      },
      {
        "id": "Encounter.class.code",
        "path": "Encounter.class.code",
        "min": 1
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "min": 1,
        "max": "1",
        "fixedCodeableConcept": {
          "coding": [
            {
              "system": "http://apiframework.dedalus.eu/fhir/CodeSystem/EncounterType",
              "code": "MA",
              "display": "Encounter MASTER"
            }
          ],
          "text": "MASTER"
        },
        "binding": {
          "strength": "required",
          "description": "The type of Encounter"
        }
      },
      {
        "id": "Encounter.priority",
        "path": "Encounter.priority",
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://apiframework.dedalus.eu/fhir/ValueSet/AdmissionTypeCodes-ForADT"
          }
        }
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "short": "The patient or group present at the encounter",
        "definition": "The patient or group present at the encounter.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Patient"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Group"
          }
        ]
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "min": 1
      },
      {
        "id": "Encounter.period.start",
        "path": "Encounter.period.start",
        "min": 1
      },
      {
        "id": "Encounter.reason",
        "path": "Encounter.reason",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "id"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Encounter.reason.coding",
        "path": "Encounter.reason.coding",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSetUri": "http://apiframework.dedalus.eu/fhir/ValueSet/EncounterReasonCodes-ForADT"
        }
      },
      {
        "id": "Encounter.reason:cancelReason",
        "path": "Encounter.reason",
        "sliceName": "cancelReason",
        "short": "Reason why the encounter is cancelled",
        "definition": "Reason why the encounter is cancelled",
        "binding": {
          "strength": "preferred",
          "description": "Reason why the encounter is cancelled.",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/EncounterCancelReasonCodes-ForADT"
          }
        }
      },
      {
        "id": "Encounter.reason:cancelReason.id",
        "path": "Encounter.reason.id",
        "fixedString": "cancelReason"
      },
      {
        "id": "Encounter.diagnosis.condition",
        "path": "Encounter.diagnosis.condition",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Procedure-ForADT"
          },
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Condition-ForADT"
          }
        ]
      },
      {
        "id": "Encounter.diagnosis.role",
        "path": "Encounter.diagnosis.role",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Encounter.diagnosis.rank",
        "path": "Encounter.diagnosis.rank",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "mustSupport": true
      },
      {
        "id": "Encounter.hospitalization",
        "path": "Encounter.hospitalization",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Encounter.hospitalization.admitSource",
        "path": "Encounter.hospitalization.admitSource",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://apiframework.dedalus.eu/fhir/ValueSet/AdmissionSourceCodes-ForADT"
          }
        }
      },
      {
        "id": "Encounter.hospitalization.dischargeDisposition",
        "path": "Encounter.hospitalization.dischargeDisposition",
        "binding": {
          "strength": "extensible",
          "valueSetReference": {
            "reference": "http://apiframework.dedalus.eu/fhir/ValueSet/EncounterDischargeDispositionCodes-ForADT"
          }
        }
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/Organization",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Encounter.partOf",
        "path": "Encounter.partOf",
        "comment": "This is also used for associating a child's encounter back to the mother's encounter.\rRefer to the Notes section in the Patient resource for further details.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://apiframework.dedalus.eu/fhir/StructureDefinition/EpisodeOfCare",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      }
    ]
  }
}