ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

GuidanceResponse — Output of a decision engine

The counterpart of the $apply operation (PlanDefinition / ActivityDefinition) and of CDS Hooks: a formalised trace of the guidance returned to the clinical user.

Purpose of the resource

GuidanceResponse captures the response of a guidance module — CQL engine, CDS Hooks hook, external service — when given a clinical context. It links the initial request, the evaluated module, the input data and the produced recommendations.

In practice, GuidanceResponse is rarely created by hand: it is a by-product of $apply on a PlanDefinition or of the JSON response of a CDS Hooks service.

Key fields

FieldTypeCardinalityRole
requestIdentifierIdentifier0..1Logical id of the initial request.
identifierIdentifier[]0..*Business identifiers.
module[x]uri | canonical | CodeableConcept1..1Evaluated guidance module (canonical PlanDefinition).
statuscode1..1success | data-requested | data-required | in-progress | failure | entered-in-error.
subjectReference(Patient | Group)0..1Evaluated subject.
encounterReference(Encounter)0..1Evaluation context.
occurrenceDateTimedateTime0..1When the guidance was produced.
performerReference(Device)0..1Engine that produced the response.
reasonCodeableReference[]0..*Why the guidance was requested.
evaluationMessageReference(OperationOutcome)[]0..*Evaluation messages (errors, warnings).
outputParametersReference(Parameters)0..1Output parameters.
resultReference(Appointment | CarePlan | RequestOrchestration…)[]0..*Produced resources (recommendations).
dataRequirementDataRequirement[]0..*Missing data needed for evaluation.

JSON example

json guidanceresponse-example.json
{
  "resourceType": "GuidanceResponse",
  "id": "example",
  "requestIdentifier": {
    "system": "urn:ietf:rfc:3986",
    "value": "guidancereq-001"
  },
  "moduleCanonical": "http://example.org/PlanDefinition/cdc-opioid-guidance",
  "status": "success",
  "subject": { "reference": "Patient/example" },
  "occurrenceDateTime": "2026-05-15T10:32:00Z",
  "performer": { "reference": "Device/cds-engine" },
  "reason": [{
    "concept": {
      "coding": [{
        "system": "http://snomed.info/sct",
        "code": "182888003",
        "display": "Medication requested"
      }]
    }
  }],
  "result": [{
    "reference": "CarePlan/cdc-opioid-care-plan"
  }]
}

CDS Hooks linkage

CDS Hooks is the lightweight HTTP protocol published by HL7 that lets an EHR call an external service when the user opens a clinical context (patient-view, medication-prescribe…). The service responds with JSON cards. GuidanceResponse is the FHIR projection of that response: each card can be stored for audit or reuse.

Common pitfalls

  • Ignoring status=data-required — the caller must interpret dataRequirement and replay the evaluation with the missing data.
  • Confusion with OperationOutcome — GuidanceResponse carries guidance, OperationOutcome carries technical messages. Both may coexist.
  • Unversioned module — traceability collapses if module does not pin a stable version.