type: exampleresource: PlanDefinitionexample: plandefinition-example-episode-of-care
PlanDefinition Example: plandefinition-example-episode-of-care
Example XML
<?xml version="1.0" encoding="UTF-8"?>
<PlanDefinition xmlns="http://hl7.org/fhir">
<identifier>
<system value="urn:ietf:rfc:3986"/>
<value value="urn:oid:2.16.840.1.113883.4.642.11.11"/>
</identifier>
<status value="draft"/>
<action>
<title value="Create an episode of care to link the related events"/>
<trigger>
<type value="named-event"/>
<name value="process-episodes"/>
</trigger>
<condition>
<kind value="applicability"/>
<expression>
<language value="text/cql-expression"/>
<expression value="ShouldCreateEpisodeOfCare"/>
</expression>
</condition>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/action-type"/>
<code value="create"/>
</coding>
</type>
<definitionCanonical value="http://example.org/fhir/ActivityDefinition/episode-of-care"/>
<!-- Sub action to link related encounters to the new episode of care -->
<action>
<title value="Link related encounters"/>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/action-type"/>
<code value="update"/>
</coding>
</type>
<definitionCanonical>
<extension>
<url value="cqf-expression"/>
<valueExpression>
<language value="text/cql-expression"/>
<expression value="RelatedEncounters"/>
</valueExpression>
</extension>
</definitionCanonical>
<dynamicValue>
<path value="episodeOfCare"/> <!-- This is the path to the episodeOfCare element of the related encounter -->
<expression>
<language value="text/cql-expression"/>
<expression value="%parent_target"/> <!-- This assumes the ability to "assign" a reference -->
</expression>
</dynamicValue>
</action>
</action>
</PlanDefinition>