Apply

$applyoperation

The apply operation applies a PlanDefinition to a given context

TypeInstance

Implementation Notes

The result of this operation is a CarePlan resource with a single activity represented by a RequestGroup. The RequestGroup will have actions for each of the applicable actions in the plan based on evaluating the applicability condition in context. For each applicable action, the definition is applied as described in the $apply operation of the ActivityDefinition resource, and the resulting resource is added as an activity to the CarePlan. If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the PlanDefinition and ActivityDefinition resource documentation

Metadata

ID
PlanDefinition-apply
Applies to Resources
PlanDefinition

Input Parameters (10)

planDefinition0..1PlanDefinition

The plan definition to be applied. If the operation is invoked at the instance level, this parameter is not allowed; if the operation is invoked at the type level, this parameter is required

subject1..*stringrequired

The subject(s) that is/are the target of the plan to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined

Search type: reference
encounter0..1string

The encounter in context, if any

Search type: reference
practitioner0..1string

The practitioner applying the plan definition

Search type: reference
organization0..1string

The organization applying the plan definition

Search type: reference
userType0..1CodeableConcept

The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)

userLanguage0..1CodeableConcept

Preferred language of the person using the system

userTaskContext0..1CodeableConcept

The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources

setting0..1CodeableConcept

The current setting of the request (inpatient, outpatient, etc.)

settingContext0..1CodeableConcept

Additional detail about the setting of the request, if any

Output Parameters (1)

return1..1CarePlanrequired

The CarePlan that is the result of applying the plan definition