PlanDefinition — Orchestrating clinical actions
The backbone of a protocol, care pathway or order set. Combines ActivityDefinition, ECA (Event-Condition-Action) rules and CQL libraries to dynamically generate a CarePlan or a RequestOrchestration.
Purpose of the resource
PlanDefinition represents a template of ordered actions — protocol, order set, pathway, ECA rule. Its scope is broader than ActivityDefinition: a PlanDefinition can trigger other nested PlanDefinitions, instantiate several ActivityDefinitions in parallel, and carry conditional rules.
Typical use cases:
- Order set — bundle of medical orders for a given situation (ICU admission, suspected stroke).
- Clinical protocol — sequence of assessments and treatments to apply.
- CDS rule — trigger (Observation, MedicationRequest) + condition (CQL) + actions.
- Care pathway — structured journey for a condition (diabetes, heart failure).
Key fields
| Field | Type | Cardinality | Role |
|---|---|---|---|
url | uri | 0..1 | Stable canonical URL. |
identifier | Identifier[] | 0..* | Business identifiers. |
version | string | 0..1 | Semantic version. |
name | string | 0..1 | Technical name. |
title | string | 0..1 | Human-readable title. |
type | CodeableConcept | 0..1 | order-set | clinical-protocol | eca-rule | workflow-definition. |
status | code | 1..1 | draft | active | retired | unknown. |
subject[x] | CodeableConcept | Reference | canonical | 0..1 | Default subject. |
goal | BackboneElement[] | 0..* | Clinical goals to reach. |
actor | BackboneElement[] | 0..* | Plan actors (role, qualification). |
action | BackboneElement[] | 0..* | Actions to execute (see below). |
library | canonical[] | 0..* | CQL libraries. |
Action model
The action field is recursive and carries the orchestration logic:
trigger— when to fire (TriggerDefinition: named event, data condition, scheduling).condition— CQL/FHIRPath precondition (applicability,start,stop).input/output— required and produced data.relatedAction— dependency with another action (before, after, concurrent).selectionBehavior—any | all | all-or-none | exactly-one | at-most-one | one-or-more.requiredBehavior—must | could | must-unless-documented.cardinalityBehavior—single | multiple.definitionCanonical— points to ActivityDefinition, Questionnaire, or another PlanDefinition.- Nested
action— for sub-protocols.
JSON example
{
"resourceType": "PlanDefinition",
"id": "low-suicide-risk-order-set",
"url": "http://example.org/PlanDefinition/low-suicide-risk-order-set",
"version": "5.0.0",
"name": "LowSuicideRiskOrderSet",
"title": "Low Suicide Risk Order Set",
"type": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/plan-definition-type",
"code": "order-set",
"display": "Order Set"
}]
},
"status": "active",
"experimental": true,
"date": "2026-05-15",
"publisher": "HL7 International (Clinical Decision Support WG)",
"action": [{
"title": "Suicide Risk Assessment",
"definitionCanonical": "http://example.org/ActivityDefinition/suicide-risk-assessment"
}]
} $apply operation
The $apply operation materialises a PlanDefinition for a subject and context:
POST /PlanDefinition/{id}/$applywithsubject,encounter,practitioner,organization.- The server evaluates
trigger,conditionanddynamicValue. - It returns a CarePlan or a RequestOrchestration aggregating the concrete resources (MedicationRequest, ServiceRequest, Task…).
Common pitfalls
- Actions without
title— clinicians do not know what to tick in the order set. - Unversioned CQL — the
librarymust pin a version for reproducibility. - Circular relatedAction — evaluation of the plan loops.
- Missing
selectionBehavioron a group — default isany, rarely what is intended.
Related resources
- ActivityDefinition — atomic actions composed.
- Library — referenced CQL logic.
- RequestOrchestration — output of
$apply. - CarePlan — instantiated care plan.
- FHIR R5 hub.