View raw Markdown
type: operationresource: PlanDefinitionoperation: apply

plandefinition $apply

Apply

Description: The apply operation applies a PlanDefinition to a given subject or group of subjects, instantiating applicable actions and returning the results as bundles of request resources.

Comments: The result of this operation is a Bundle for each subject, where the Bundle contains Request resources that are the direct result of applying the PlanDefinition to that subject. The Bundle will have entries for each of the applicable actions in the PlanDefinition based on evaluating the applicability condition in context, and producing Request resources based on the definition element for each applicable action.

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 entry to the Bundle. The resulting Bundle may be any combination of Request resources, including CarePlan, RequestOrchestration, and individual Request resources such as ServiceRequest and MedicationRequest.

Note that to preserve the structure of the PlanDefinition, systems may choose to return the results in a RequestOrchestration. In this case, the individual request resources will have an intent of option, meaning the their intent is governed by the RequestOrchestraiont.

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. Note that result of this operation is transient (i.e. none of the resources created by the operation are persisted in the server, they are all returned as entries in the result Bundle(s)). The result effectively represents a proposed set of activities, and it is up to the caller to determine whether and how those activities are actually carried out and/or persisted.

Affects State: false

System: false

Type: true

Instance: true

URL: http://hl7.org/fhir/build/OperationDefinition/PlanDefinition-apply

Parameters