Skip to main content

Apply a PlanDefinition

Apply a stored PlanDefinition to a subject. Ovok evaluates the plan and creates the resulting care-planning resources. The operation is based on the FHIR R4 PlanDefinition $apply operation.

MethodPath
POST/fhir/R4/PlanDefinition/:id/$apply

Request​

Send the operation inputs as a FHIR Parameters resource.

curl --request POST \
--url "https://api.sandbox.ovok.com/fhir/R4/PlanDefinition/${PLAN_DEFINITION_ID}/\$apply" \
--header "Authorization: Bearer ${OVOK_TOKEN}" \
--header 'Content-Type: application/fhir+json' \
--data "{\"resourceType\":\"Parameters\",\"parameter\":[{\"name\":\"subject\",\"valueString\":\"Patient/${PATIENT_ID}\"},{\"name\":\"practitioner\",\"valueString\":\"Practitioner/${PRACTITIONER_ID}\"}]}"
ParameterTypeRequiredDescription
subjectstring referenceYesFHIR reference for the subject, such as Patient/:id.
encounterstring referenceNoEncounter context for the application.
practitionerstring referenceNoPractitioner context.
organizationstring referenceNoOrganization context.

Successful response​

The operation returns a generated FHIR CarePlan resource. The exact activities and related request resources depend on the selected PlanDefinition and its actions.

Response fieldDescription
resourceTypeCarePlan.
subjectSubject for whom the plan was applied.
activityPlanned activities produced from the definition, when present.

See the FHIR R4 PlanDefinition $apply operation for the standard operation.