ActivityDefinition — Reusable action template
The blueprint of a clinical activity. Once defined, it can be instantiated as a MedicationRequest, ServiceRequest, Task or CommunicationRequest without duplicating the logic.
Purpose of the resource
ActivityDefinition is a declarative template of a reusable clinical action. It
captures intent (prescribe a medication, schedule an exam, send a notification) without itself
being the executed instance. Another resource (PlanDefinition, CarePlan, Task,
MedicationRequest…) references the ActivityDefinition through
instantiatesCanonical, and the $apply operation materialises the
action against a concrete subject.
This indirection gives CDS (Clinical Decision Support) systems a dictionary of actions validated by clinical committees, separate from the instances created in the patient chart.
Key fields
| Field | Type | Cardinality | Role |
|---|---|---|---|
url | uri | 0..1 | Stable canonical URL for the ActivityDefinition. |
version | string | 0..1 | Semantic version of the definition. |
name | string | 0..1 | Technical name (camelCase). |
title | string | 0..1 | Human-readable title. |
status | code | 1..1 | draft | active | retired | unknown. |
experimental | boolean | 0..1 | Test vs production definition. |
subject[x] | CodeableConcept | Reference | canonical | 0..1 | Target subject (Patient, Group, EvidenceVariable…). |
kind | code | 0..1 | Resource type to instantiate (MedicationRequest, ServiceRequest, Task…). |
profile | canonical | 0..1 | Profile the generated instance must conform to. |
code | CodeableConcept | 0..1 | Detailed action code (SNOMED CT, LOINC, RxNorm…). |
intent | code | 0..1 | proposal | plan | order | option. |
priority | code | 0..1 | routine | urgent | asap | stat. |
timing[x] | Timing | Age | Range… | 0..1 | When to execute. |
location | CodeableReference(Location) | 0..1 | Where to execute. |
participant | BackboneElement[] | 0..* | Required actors (clinician, patient, device). |
productReference | productCodeableConcept | Reference | CodeableConcept | 0..1 | Product (Medication, Substance, Device). |
dosage | Dosage[] | 0..* | Posology when the action is an administration. |
dynamicValue | BackboneElement[] | 0..* | FHIRPath/CQL expressions that dynamically set fields during $apply. |
library | canonical[] | 0..* | Referenced logic libraries (CQL). |
JSON example
Minimal example of an ActivityDefinition modelling the administration of a questionnaire:
{
"resourceType": "ActivityDefinition",
"id": "administer-zika-virus-exposure-assessment",
"url": "http://example.org/ActivityDefinition/administer-zika-virus-exposure-assessment",
"version": "5.0.0",
"name": "AdministerZikaVirusExposureAssessment",
"title": "Administer Zika Virus Exposure Assessment",
"status": "draft",
"experimental": true,
"date": "2026-05-15",
"publisher": "HL7 International (FHIR Project)",
"description": "Administer the Zika Virus Exposure Assessment questionnaire to a patient suspected of Zika exposure.",
"kind": "ServiceRequest",
"code": {
"coding": [{
"system": "http://snomed.info/sct",
"code": "171207006",
"display": "Depression assessment"
}]
},
"intent": "order",
"priority": "routine",
"timingTiming": {
"repeat": {
"frequency": 1,
"period": 1,
"periodUnit": "d"
}
}
} $apply operation
The $apply operation is the primary operation on ActivityDefinition:
POST /ActivityDefinition/{id}/$applywith aParametersbody carryingsubject,encounter,context.- The server returns a concrete resource (MedicationRequest, ServiceRequest, Task…) ready to be saved to the chart.
dynamicValueCQL/FHIRPath expressions are evaluated against the subject and injected into the instance.
Common pitfalls
- Missing
kind—$applydoes not know which resource type to materialise. Always specify. - Confusion with PlanDefinition — ActivityDefinition describes ONE action; PlanDefinition orchestrates SEVERAL.
- Incompatible profile — a
profilethat contradictskindwill produce an invalid instance. - Confusion between
codeandproductCodeableConcept—code= action;product= thing administered.
Related resources
- PlanDefinition — orchestration of actions, including ActivityDefinitions.
- Library — carries CQL expressions referenced via
library. - Measure — quality measure sharing the same Clinical Reasoning base.
- Task — often instantiated from an ActivityDefinition.
- FHIR R5 hub.