PackagesCanonicalsLogsProblems
    Packages
    de.gematik.erp-servicerequest@1.2.0-rc2
    https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container
{
  "description": "Bundle, which contains all resources of a message",
  "_filename": "StructureDefinition-erp-service-request-message-container.json",
  "package_name": "de.gematik.erp-servicerequest",
  "date": "2025-01-01",
  "derivation": "constraint",
  "publisher": "gematik GmbH",
  "fhirVersion": "4.0.1",
  "name": "ERPServiceRequestMessageContainer",
  "abstract": false,
  "type": "Bundle",
  "experimental": "false",
  "resourceType": "StructureDefinition",
  "title": "ERP Service Request Message Container",
  "package_version": "1.2.0-rc2",
  "status": "draft",
  "id": "4301b316-7981-4dff-b372-e7d496a76c25",
  "kind": "resource",
  "url": "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container",
  "version": "1.2",
  "differential": {
    "element": [ {
      "id": "Bundle",
      "path": "Bundle",
      "constraint": [ {
        "key": "service-request-message-container-1",
        "human": "If the Message is a copy then the focus of the MessageHeader must be a Bundle, otherwise a ServiceRequest.",
        "source": "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container",
        "severity": "error",
        "expression": "(Bundle.entry[0].resource.event.code = 'eRezept_Rezeptanforderung;NachrichtKopie' implies (Bundle.entry[0].resource.focus.all($this.resolve() is Bundle))) and (Bundle.entry[0].resource.event.code != 'eRezept_Rezeptanforderung;NachrichtKopie' implies Bundle.entry[0].resource.focus.all($this.resolve() is ServiceRequest))"
      }, {
        "key": "service-request-message-container-2",
        "human": "If the the Prescription-ServiceRequest contains the health-care service as a reference, then the e-mail contact must be present.",
        "source": "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container",
        "severity": "error",
        "expression": "Bundle.entry.resource.children().reference.where($this.startsWith('ServiceRequest')).all(($this.resolve().supportingInfo.where($this.type = 'Organization').exists() and $this.resolve().code.coding.code = 'prescription-request')implies $this.resolve().supportingInfo.where($this.type = 'Organization').reference.resolve().contact.telecom.where(system = 'email').exists())"
      }, {
        "key": "service-request-message-container-3",
        "human": "If the the Prescription-ServiceRequest contains the health-care service as a reference, then the organization must have the respective type.",
        "source": "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container",
        "severity": "error",
        "expression": "Bundle.entry.resource.children().reference.where($this.startsWith('ServiceRequest')).all(($this.resolve().code.coding.code = 'prescription-request' and $this.resolve().supportingInfo.where($this.type = 'Organization').exists()) implies $this.resolve().supportingInfo.where($this.type = 'Organization').reference.resolve().type.coding.code = '1.2.276.0.76.4.245')"
      }, {
        "key": "service-request-message-container-4",
        "human": "If the the Prescription-ServiceRequest is active, not Zyto and the requester is a pharmacy, then the Healthcare Service to receive a copy must be stated.",
        "source": "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container",
        "severity": "error",
        "expression": "(Bundle.entry[0].resource.event.code != 'eRezept_ParenteraleZubereitung;Rezeptanfrage') implies Bundle.entry.resource.children().reference.where($this.startsWith('ServiceRequest')).all(($this.resolve().code.coding.code = 'prescription-request' and $this.resolve().status = 'active' and $this.resolve().requester.resolve().type.coding.code = '1.2.276.0.76.4.54') implies $this.resolve().supportingInfo.where($this.type = 'Organization').exists())"
      }, {
        "key": "service-request-message-container-5",
        "human": "If the the Dispense-ServiceRequest is active then the requester must be a Health Care Service.",
        "source": "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container",
        "severity": "error",
        "expression": "Bundle.entry.resource.children().reference.where($this.startsWith('ServiceRequest')).all(($this.resolve().code.coding.code = 'dispense-request' and $this.resolve().status = 'active') implies $this.resolve().requester.resolve().type.coding.code = '1.2.276.0.76.4.245')"
      } ]
    }, {
      "id": "Bundle.entry:MessageHeader",
      "path": "Bundle.entry",
      "sliceName": "MessageHeader"
    }, {
      "id": "Bundle.entry:MessageHeader.resource",
      "path": "Bundle.entry.resource",
      "type": [ {
        "code": "MessageHeader",
        "profile": [ "https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-request-header" ]
      } ]
    } ]
  },
  "baseDefinition": "https://gematik.de/fhir/atf/StructureDefinition/bundle-app-transport-framework"
}