{
  "resourceType": "StructureDefinition",
  "id": "EPCommunicationRequest-0534125c-ab0a-4688-b64c-b2520cc615cd",
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest",
  "version": "1.2.0",
  "name": "EPCommunicationRequest",
  "status": "active",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "CommunicationRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/CommunicationRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "CommunicationRequest",
        "path": "CommunicationRequest",
        "short": "Asking to send the lab result to another health professional or the patient",
        "condition": [
          "val-recipientOnePatient",
          "val-recipientNotPrescriber"
        ],
        "constraint": [
          {
            "key": "val-recipientOnePatient",
            "severity": "error",
            "human": "SHALL contains max. 1 patient",
            "expression": "recipient.reference.where(startsWith('Patient')).count()<=1",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          },
          {
            "key": "val-recipientNotPrescriber",
            "severity": "error",
            "human": "The prescriber SHALL NOT be put in the CommunicationRequest recipients",
            "expression": "requester.reference.subsetOf(recipient.reference)=false",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          }
        ]
      },
      {
        "id": "CommunicationRequest.meta",
        "path": "CommunicationRequest.meta",
        "min": 1
      },
      {
        "id": "CommunicationRequest.meta.id",
        "path": "CommunicationRequest.meta.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.meta.versionId",
        "path": "CommunicationRequest.meta.versionId",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.meta.lastUpdated",
        "path": "CommunicationRequest.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.meta.source",
        "path": "CommunicationRequest.meta.source",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.meta.profile",
        "path": "CommunicationRequest.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
      },
      {
        "id": "CommunicationRequest.meta.security",
        "path": "CommunicationRequest.meta.security",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.meta.tag",
        "path": "CommunicationRequest.meta.tag",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.implicitRules",
        "path": "CommunicationRequest.implicitRules",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.language",
        "path": "CommunicationRequest.language",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.text",
        "path": "CommunicationRequest.text",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.contained",
        "path": "CommunicationRequest.contained",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.identifier",
        "path": "CommunicationRequest.identifier",
        "short": "An identifier for the communication request",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPSimpleIdentifier"
            ]
          }
        ]
      },
      {
        "id": "CommunicationRequest.basedOn",
        "path": "CommunicationRequest.basedOn",
        "short": "The prescription",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescription"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "CommunicationRequest.basedOn.id",
        "path": "CommunicationRequest.basedOn.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.basedOn.reference",
        "path": "CommunicationRequest.basedOn.reference",
        "short": "Reference to the CarePlan by its fullURL",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:d00069b7-1fc8-4397-bc7c-c9571319d890"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          }
        ]
      },
      {
        "id": "CommunicationRequest.basedOn.type",
        "path": "CommunicationRequest.basedOn.type",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.basedOn.identifier",
        "path": "CommunicationRequest.basedOn.identifier",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.basedOn.display",
        "path": "CommunicationRequest.basedOn.display",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.replaces",
        "path": "CommunicationRequest.replaces",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.groupIdentifier",
        "path": "CommunicationRequest.groupIdentifier",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.status",
        "path": "CommunicationRequest.status",
        "fixedCode": "active"
      },
      {
        "id": "CommunicationRequest.statusReason",
        "path": "CommunicationRequest.statusReason",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.category",
        "path": "CommunicationRequest.category",
        "definition": "Constant",
        "min": 1,
        "max": "1"
      },
      {
        "id": "CommunicationRequest.category.id",
        "path": "CommunicationRequest.category.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.category.coding",
        "path": "CommunicationRequest.category.coding",
        "min": 1,
        "max": "1",
        "patternCoding": {
          "code": "LAB_RESULT",
          "system": "https://www.esante.lu/fhir-spec/CodeSystem/EPrescCategories"
        }
      },
      {
        "id": "CommunicationRequest.category.coding.id",
        "path": "CommunicationRequest.category.coding.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.category.coding.system",
        "path": "CommunicationRequest.category.coding.system",
        "min": 1
      },
      {
        "id": "CommunicationRequest.category.coding.version",
        "path": "CommunicationRequest.category.coding.version",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.category.coding.code",
        "path": "CommunicationRequest.category.coding.code",
        "min": 1
      },
      {
        "id": "CommunicationRequest.category.coding.display",
        "path": "CommunicationRequest.category.coding.display",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.category.coding.userSelected",
        "path": "CommunicationRequest.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.category.text",
        "path": "CommunicationRequest.category.text",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.priority",
        "path": "CommunicationRequest.priority",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.doNotPerform",
        "path": "CommunicationRequest.doNotPerform",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.medium",
        "path": "CommunicationRequest.medium",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.subject",
        "path": "CommunicationRequest.subject",
        "short": "The patient",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "CommunicationRequest.subject.id",
        "path": "CommunicationRequest.subject.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.subject.reference",
        "path": "CommunicationRequest.subject.reference",
        "short": "Reference to a patient from the Bundle",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:43b25517-9ab1-4a3b-96b0-809e7f118c41"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          }
        ]
      },
      {
        "id": "CommunicationRequest.subject.type",
        "path": "CommunicationRequest.subject.type",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.subject.identifier",
        "path": "CommunicationRequest.subject.identifier",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.subject.display",
        "path": "CommunicationRequest.subject.display",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.about",
        "path": "CommunicationRequest.about",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.encounter",
        "path": "CommunicationRequest.encounter",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.payload",
        "path": "CommunicationRequest.payload",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.occurrence[x]",
        "path": "CommunicationRequest.occurrence[x]",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.authoredOn",
        "path": "CommunicationRequest.authoredOn",
        "min": 1,
        "condition": [
          "val-dateDayPrecision"
        ],
        "constraint": [
          {
            "key": "val-dateDayPrecision",
            "severity": "error",
            "human": "Shall be precise to the day",
            "expression": "toString().length()=10",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          }
        ]
      },
      {
        "id": "CommunicationRequest.requester",
        "path": "CommunicationRequest.requester",
        "short": "The prescriber",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPractitioner"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "CommunicationRequest.requester.id",
        "path": "CommunicationRequest.requester.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.requester.reference",
        "path": "CommunicationRequest.requester.reference",
        "short": "A reference to the prescriber",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:759d46a4-b0a2-429e-a426-ce7be8e0736e"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          }
        ]
      },
      {
        "id": "CommunicationRequest.requester.type",
        "path": "CommunicationRequest.requester.type",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.requester.identifier",
        "path": "CommunicationRequest.requester.identifier",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.requester.display",
        "path": "CommunicationRequest.requester.display",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.recipient",
        "path": "CommunicationRequest.recipient",
        "short": "A patient or health professional who shall receive a copy of the results",
        "definition": "A practitioner shall be referenced referenced, and thus provided in the Buldle. The patient shall be referenced as well in the Bundle. The prescriber SHALL NOT be present as he will always receive results anyway. See examples.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPatient",
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPPractitionerUnk"
            ]
          }
        ]
      },
      {
        "id": "CommunicationRequest.recipient.id",
        "path": "CommunicationRequest.recipient.id",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.recipient.reference",
        "path": "CommunicationRequest.recipient.reference",
        "min": 1,
        "example": [
          {
            "label": "Example for a patient",
            "valueString": "urn:uuid:43b25517-9ab1-4a3b-96b0-809e7f118c41"
          },
          {
            "label": "Example for another health professional",
            "valueString": "urn:uuid:9ae67594-b37f-40e5-9373-d3d26537da6e"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/EPCommunicationRequest"
          }
        ]
      },
      {
        "id": "CommunicationRequest.recipient.type",
        "path": "CommunicationRequest.recipient.type",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.recipient.identifier",
        "path": "CommunicationRequest.recipient.identifier",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.recipient.display",
        "path": "CommunicationRequest.recipient.display",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.sender",
        "path": "CommunicationRequest.sender",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.reasonCode",
        "path": "CommunicationRequest.reasonCode",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.reasonReference",
        "path": "CommunicationRequest.reasonReference",
        "max": "0"
      },
      {
        "id": "CommunicationRequest.note",
        "path": "CommunicationRequest.note",
        "max": "0"
      }
    ]
  }
}