US Public Health Profiles Library
1.0.0 - STU1 United States of America flag

US Public Health Profiles Library, published by HL7 Public Health Work Group. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-us-ph-library/ and changes regularly. See the Directory of published versions

: US Public Health PlanDefinition - Alternative Expression - JSON Representation

Active as of 2022-07-31

Raw json | Download

{
  "resourceType" : "PlanDefinition",
  "id" : "us-ph-plandefinition-alt-expression-example",
  "meta" : {
    "profile" : [
      🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-plandefinition"
    ]
  },
  "text" : {
    "status" : "extensions",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: PlanDefinition us-ph-plandefinition-alt-expression-example</b></p><a name=\"us-ph-plandefinition-alt-expression-example\"> </a><a name=\"hcus-ph-plandefinition-alt-expression-example\"> </a><a name=\"us-ph-plandefinition-alt-expression-example-en-US\"> </a><p><b>url</b>: <a href=\"PlanDefinition-us-ph-plandefinition-alt-expression-example.html\">PlanDefinition US Public Health PlanDefinition Alternative Expression Example</a></p><p><b>version</b>: 1.0.0</p><p><b>name</b>: USPublicHealthPlanDefinitionAlternativeExpressionExample</p><p><b>title</b>: US Public Health PlanDefinition Alternative Expression Example</p><p><b>type</b>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/plan-definition-type workflow-definition}\">Workflow Definition</span></p><p><b>status</b>: Active</p><p><b>experimental</b>: true</p><p><b>date</b>: 2022-07-31 12:32:29-0500</p><p><b>publisher</b>: HL7 Public Health Work Group</p><p><b>contact</b>: HL7 Public Health Work Group: <a href=\"http://www.hl7.org/Special/committees/pher\">http://www.hl7.org/Special/committees/pher</a>,<a href=\"mailto:pher@lists.HL7.org\">pher@lists.HL7.org</a></p><p><b>description</b>: </p><div><p>An example PlanDefinition</p>\n</div><p><b>jurisdiction</b>: <span title=\"Codes:{urn:iso:std:iso:3166 US}\">United States of America</span></p><p><b>effectivePeriod</b>: 2020-12-01 --&gt; (ongoing)</p><h3>RelatedArtifacts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Label</b></td><td><b>Resource</b></td></tr><tr><td style=\"display: none\">*</td><td>Depends On</td><td>RCTC Value Set Library of Trigger Codes</td><td><code>http://example.org/fhir/Library/library-rctc-example</code></td></tr></table><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>start-workflow</blockquote><p><b>description</b>: This action represents the start of the reporting workflow in response to the encounter-start event.</p><p><b>textEquivalent</b>: Start the reporting workflow in response to an encounter-start event</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions initiate-reporting-workflow}\">Initiate a reporting workflow</span></p><blockquote><p><b>trigger</b></p><blockquote><p><b>id</b></p>encounter-start</blockquote><p><b>US Public Health Named Event Type Extension</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-triggerdefinition-namedevents encounter-start}\">Indicates the start of an encounter</span></p><p><b>type</b>: Named Event</p><p><b>name</b>: encounter-start</p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>patient</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Patient/{{context.patientId}}</p><p><b>type</b>: Patient</p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>encounter</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Encounter/{{context.encounterId}}</p><p><b>type</b>: Encounter</p></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td><td><b>Offset[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>check-suspected-disorder</td><td>Before Start</td><td>No display for Duration  (value: 1; system: http://unitsofmeasure.org; code: h)</td></tr></table></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>check-suspected-disorder</blockquote><p><b>description</b>: This action represents the start of the check suspected disorder reporting workflow in response to the encounter-start event.</p><p><b>textEquivalent</b>: Check suspected disorders for immediate reportability and setup jobs for future reportability checks.</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions execute-reporting-workflow}\">Execute a series of actions to accomplish reporting</span></p><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>is-encounter-suspected-disorder</blockquote><p><b>description</b>: This action represents the check for suspected disorder reportability to create the patients eICR.</p><p><b>textEquivalent</b>: Check Trigger Codes based on Suspected Reportable Value set.</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions check-trigger-codes}\">Evaluate candidate patient's data against trigger codes to determine reportability</span></p><blockquote><p><b>condition</b></p><p><b>kind</b>: Applicability</p><h3>Expressions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>FHIRPath</td><td>%modifiedConditions.exists() or %modifiedLabResults.exists() or %modifiedMedicationOrders.exists()</td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>modifiedConditions</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Condition?patient=Patient/{{context.patientId}}</p><p><b>type</b>: Condition</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-sdtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>modifiedLabResults</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Observation?patient=Patient/{{context.patientId}}</p><p><b>type</b>: Observation</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>value</td><td><code>http://example.org/fhir/ValueSet/valueset-sdtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>modifiedMedicationOrders</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: MedicationRequest?patient=Patient/{{context.patientId}}</p><p><b>type</b>: MedicationRequest</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>medication</td><td><code>http://example.org/fhir/ValueSet/valueset-sdtc-example</code></td></tr></table></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td></tr><tr><td style=\"display: none\">*</td><td>create-eicr</td><td>Before Start</td></tr></table></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>continue-check-reportable</blockquote><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions evaluate-condition}\">Evaluate condition to determine reportability</span></p><blockquote><p><b>condition</b></p><p><b>kind</b>: Applicability</p><h3>Expressions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>FHIRPath</td><td>%encounter.where((status = 'in-progress' and period.start + 1 day * %normalReportingDuration &gt;= now()) or (status = 'finished' and period.end + 72 hours &gt;= now())).select(true)</td></tr></table></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td><td><b>Offset[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>check-reportable</td><td>Before Start</td><td>No display for Duration  (value: 6; system: http://unitsofmeasure.org; code: h)</td></tr></table></blockquote></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>check-reportable</blockquote><p><b>description</b>: This action represents the check for suspected reportability of the eICR.</p><p><b>textEquivalent</b>: Check Reportability and setup jobs for future reportability checks.</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions execute-reporting-workflow}\">Execute a series of actions to accomplish reporting</span></p><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>is-encounter-reportable</blockquote><p><b>description</b>: This action represents the check for reportability to create the patients eICR.</p><p><b>textEquivalent</b>: Check Trigger Codes based on RCTC Value sets.</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions check-trigger-codes}\">Evaluate candidate patient's data against trigger codes to determine reportability</span></p><blockquote><p><b>condition</b></p><p><b>kind</b>: Applicability</p><h3>Expressions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>FHIRPath</td><td>%encounter.where(period.start + 1 day * %normalReportingDuration &gt;= now()).select(true) and (%conditions.exists() or %encounters.exists() or %immunizations.exists() or %procedures.exists() or %procedureOrders.exists() or %labOrders.exists() or %labTests.exists() or %labResults.exists() or %medicationAdministrations.exists() or %medicationOrders.exists() or %medicationDispenses.exists())</td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>conditions</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Condition?patient=Patient/{{context.patientId}}</p><p><b>type</b>: Condition</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-dxtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>encounters</blockquote><p><b>US Public Health Related Data Extension</b>: encounter</p><p><b>type</b>: Encounter</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>reasonCode</td><td><code>http://example.org/fhir/ValueSet/valueset-dxtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>immunizations</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Immunization?patient=Patient/{{context.patientId}}</p><p><b>type</b>: Immunization</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>vaccineCode</td><td><code>http://example.org/fhir/ValueSet/valueset-mrtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>labOrders</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: ServiceRequest?patient=Patient/{{context.patientId}}</p><p><b>type</b>: ServiceRequest</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-lotc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>labTests</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Observation?patient=Patient/{{context.patientId}}</p><p><b>type</b>: Observation</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-lotc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>diagnosticOrders</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: DiagnosticReport?patient=Patient/{{context.patientId}}</p><p><b>type</b>: DiagnosticReport</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-lotc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>procedureOrders</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: ServiceRequest?patient=Patient/{{context.patientId}}</p><p><b>type</b>: ServiceRequest</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-pctc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>procedures</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: Procedure?patient=Patient/{{context.patientId}}</p><p><b>type</b>: Procedure</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-pctc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>medicationOrders</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: MedicationRequest?patient=Patient/{{context.patientId}}</p><p><b>type</b>: MedicationRequest</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>medication</td><td><code>http://example.org/fhir/ValueSet/valueset-mrtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>medicationDispenses</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: MedicationDispense?patient=Patient/{{context.patientId}}</p><p><b>type</b>: MedicationDispense</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>medication</td><td><code>http://example.org/fhir/ValueSet/valueset-mrtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>medicationAdministrations</blockquote><p><b>US Public Health FHIR Query Pattern Extension</b>: MedicationAdministration?patient=Patient/{{context.patientId}}</p><p><b>type</b>: MedicationAdministration</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>medication</td><td><code>http://example.org/fhir/ValueSet/valueset-mrtc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>labResults</blockquote><p><b>US Public Health Related Data Extension</b>: labTests</p><p><b>type</b>: Observation</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>value</td><td><code>http://example.org/fhir/ValueSet/valueset-ostc-example</code></td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>diagnosticResults</blockquote><p><b>US Public Health Related Data Extension</b>: diagnosticOrders</p><p><b>type</b>: DiagnosticReport</p><h3>CodeFilters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Path</b></td><td><b>ValueSet</b></td></tr><tr><td style=\"display: none\">*</td><td>code</td><td><code>http://example.org/fhir/ValueSet/valueset-ostc-example</code></td></tr></table></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td></tr><tr><td style=\"display: none\">*</td><td>create-eicr</td><td>Before Start</td></tr></table></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>check-update-eicr</blockquote><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions evaluate-condition}\">Evaluate condition to determine reportability</span></p><blockquote><p><b>condition</b></p><p><b>kind</b>: Applicability</p><h3>Expressions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>FHIRPath</td><td>((%lasteicr.last().entry[2].resource as Bundle).entry.first().resource as Composition).date &lt; now() - 72 hours</td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>lasteicr</blockquote><p><b>US Public Health Related Data Extension</b>: eicrreport</p><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-document-bundle.html\">US Public Health Document Bundle</a></p></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td></tr><tr><td style=\"display: none\">*</td><td>create-eicr</td><td>Before Start</td></tr></table></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>is-encounter-in-progress</blockquote><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions evaluate-condition}\">Evaluate condition to determine reportability</span></p><blockquote><p><b>condition</b></p><p><b>kind</b>: Applicability</p><h3>Expressions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>FHIRPath</td><td>%inprogressencounter.where(status = 'in-progress' and period.start + 1 day * %normalReportingDuration &gt;= now() or (status = 'finished' and period.end + 72 hours &gt;= now())).exists()</td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>inprogressencounter</blockquote><p><b>US Public Health Related Data Extension</b>: encounter</p><p><b>type</b>: Encounter</p></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td><td><b>Offset[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>check-reportable</td><td>Before Start</td><td>No display for Duration  (value: 6; system: http://unitsofmeasure.org; code: h)</td></tr></table></blockquote></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>create-eicr</blockquote><p><b>description</b>: This action represents the creation of the eICR. It subsequently calls validate.</p><p><b>textEquivalent</b>: Create eICR</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions create-report}\">Create a Report containing Patient's data for patients who passed the check-reportability test</span></p><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>patientdata</blockquote><p><b>US Public Health Related Data Extension</b>: patient</p><p><b>type</b>: Patient</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-patient.html\">US Core Patient Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>conditiondata</blockquote><p><b>US Public Health Related Data Extension</b>: conditions</p><p><b>type</b>: Condition</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-condition-encounter-diagnosis.html\">US Core Condition Encounter Diagnosis Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>encounterdata</blockquote><p><b>US Public Health Related Data Extension</b>: encounter</p><p><b>type</b>: Encounter</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-encounter.html\">US Core Encounter Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>mrdata</blockquote><p><b>US Public Health Related Data Extension</b>: medicationOrders</p><p><b>type</b>: MedicationRequest</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-medicationrequest.html\">US Core MedicationRequest Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>immzdata</blockquote><p><b>US Public Health Related Data Extension</b>: immunizations</p><p><b>type</b>: Immunization</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-immunization.html\">US Core Immunization Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>procdata</blockquote><p><b>US Public Health Related Data Extension</b>: procedures</p><p><b>type</b>: Procedure</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-procedure.html\">US Core Procedure Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>labResultdata</blockquote><p><b>US Public Health Related Data Extension</b>: labResults</p><p><b>type</b>: Observation</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-observation-lab.html\">US Core Laboratory Result Observation Profile</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>labOrderdata</blockquote><p><b>US Public Health Related Data Extension</b>: labOrders</p><p><b>type</b>: ServiceRequest</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/R4/servicerequest.html\">ServiceRequest</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>diagnosticResultdata</blockquote><p><b>US Public Health Related Data Extension</b>: diagnosticResults</p><p><b>type</b>: DiagnosticReport</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-diagnosticreport-lab.html\">US Core DiagnosticReport Profile for Laboratory Results Reporting</a></p></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>diagnosticOrderdata</blockquote><p><b>US Public Health Related Data Extension</b>: diagnosticOrders</p><p><b>type</b>: DiagnosticReport</p><p><b>profile</b>: <a href=\"http://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-diagnosticreport-lab.html\">US Core DiagnosticReport Profile for Laboratory Results Reporting</a></p></blockquote><blockquote><p><b>output</b></p><blockquote><p><b>id</b></p>eicrreport</blockquote><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-document-bundle.html\">US Public Health Document Bundle</a></p></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td></tr><tr><td style=\"display: none\">*</td><td>validate-eicr</td><td>Before Start</td></tr></table><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>anonymize-report</blockquote><p><b>US Public Health Trust Service Endpoint Extension</b>: <a href=\"Endpoint-us-ph-endpoint-pha.html\">Endpoint PHAReceiver</a></p><p><b>description</b>: This action is used to anonymize a identifiable report</p><p><b>textEquivalent</b>: Anonymize the report.</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions anonymize-report}\">Anonymize the report before submitting the report</span></p><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>report-to-be-anonymized</blockquote><p><b>US Public Health Related Data Extension</b>: output-report</p><p><b>type</b>: Bundle</p></blockquote><blockquote><p><b>output</b></p><blockquote><p><b>id</b></p>anonymized-report</blockquote><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-reporting-bundle.html\">US Public Health Reporting Bundle</a></p></blockquote></blockquote></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>validate-eicr</blockquote><p><b>description</b>: This action represents the validation of the eICR. It subsequently calls route-and-send.</p><p><b>textEquivalent</b>: Validate eICR</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions validate-report}\">Validate Report against specified profiles and terminologies.</span></p><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>generatedeicrreport</blockquote><p><b>US Public Health Related Data Extension</b>: eicrreport</p><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-document-bundle.html\">US Public Health Document Bundle</a></p></blockquote><blockquote><p><b>output</b></p><blockquote><p><b>id</b></p>valideicrreport</blockquote><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-document-bundle.html\">US Public Health Document Bundle</a></p></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td></tr><tr><td style=\"display: none\">*</td><td>route-and-send-eicr</td><td>Before Start</td></tr></table></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>route-and-send-eicr</blockquote><p><b>description</b>: This action represents the routing and sending of the eICR.</p><p><b>textEquivalent</b>: Route and send eICR</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions submit-report}\">Submit the report to specified endpoint</span></p><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>validatedeicrreport</blockquote><p><b>US Public Health Related Data Extension</b>: valideicrreport</p><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-document-bundle.html\">US Public Health Document Bundle</a></p></blockquote><blockquote><p><b>output</b></p><blockquote><p><b>id</b></p>submittedeicrreport</blockquote><p><b>type</b>: Bundle</p><p><b>profile</b>: <a href=\"StructureDefinition-us-ph-document-bundle.html\">US Public Health Document Bundle</a></p></blockquote></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>encounter-modified</blockquote><p><b>description</b>: This action represents the start of the reporting workflow in response to the encounter-modified event</p><p><b>textEquivalent</b>: Start the reporting workflow in response to an encounter-modified event</p><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions initiate-reporting-workflow}\">Initiate a reporting workflow</span></p><blockquote><p><b>trigger</b></p><blockquote><p><b>id</b></p>encounter-modified-trigger</blockquote><p><b>US Public Health Named Event Type Extension</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-triggerdefinition-namedevents encounter-modified}\">Indicates modifications to data elements of an encounter</span></p><p><b>type</b>: Named Event</p><p><b>name</b>: encounter-modified</p></blockquote><blockquote><p><b>condition</b></p><p><b>kind</b>: Applicability</p><h3>Expressions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Language</b></td><td><b>Expression</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>FHIRPath</td><td>%encounter.where(period.start + 1 day * %normalReportingDuration &lt; now()).select(true)</td></tr></table></blockquote><h3>RelatedActions</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>ActionId</b></td><td><b>Relationship</b></td></tr><tr><td style=\"display: none\">*</td><td>create-eicr</td><td>Before Start</td></tr></table></blockquote></div>"
  },
  "url" : "http://example.org/fhir/PlanDefinition/us-ph-plandefinition-alt-expression-example",
  "version" : "1.0.0",
  "name" : "USPublicHealthPlanDefinitionAlternativeExpressionExample",
  "title" : "US Public Health PlanDefinition Alternative Expression Example",
  "type" : {
    "coding" : [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/plan-definition-type",
        "code" : "workflow-definition",
        "display" : "Workflow Definition"
      }
    ]
  },
  "status" : "active",
  "experimental" : true,
  "date" : "2022-07-31T12:32:29.858-05:00",
  "publisher" : "HL7 Public Health Work Group",
  "contact" : [
    {
      "name" : "HL7 Public Health Work Group",
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/pher"
        },
        {
          "system" : "email",
          "value" : "pher@lists.HL7.org"
        }
      ]
    }
  ],
  "description" : "An example PlanDefinition",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "US"
        }
      ]
    }
  ],
  "effectivePeriod" : {
    "start" : "2020-12-01"
  },
  "relatedArtifact" : [
    {
      "type" : "depends-on",
      "label" : "RCTC Value Set Library of Trigger Codes",
      "resource" : "http://example.org/fhir/Library/library-rctc-example"
    }
  ],
  "action" : [
    {
      "id" : "start-workflow",
      "description" : "This action represents the start of the reporting workflow in response to the encounter-start event.",
      "textEquivalent" : "Start the reporting workflow in response to an encounter-start event",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "initiate-reporting-workflow",
              "display" : "Initiate a reporting workflow"
            }
          ]
        }
      ],
      "trigger" : [
        {
          "id" : "encounter-start",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-named-eventtype-extension",
              "valueCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-triggerdefinition-namedevents",
                    "code" : "encounter-start",
                    "display" : "Indicates the start of an encounter"
                  }
                ]
              }
            }
          ],
          "type" : "named-event",
          "name" : "encounter-start"
        }
      ],
      "input" : [
        {
          "id" : "patient",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
              "valueString" : "Patient/{{context.patientId}}"
            }
          ],
          "type" : "Patient"
        },
        {
          "id" : "encounter",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
              "valueString" : "Encounter/{{context.encounterId}}"
            }
          ],
          "type" : "Encounter"
        }
      ],
      "relatedAction" : [
        {
          "actionId" : "check-suspected-disorder",
          "relationship" : "before-start",
          "offsetDuration" : {
            "value" : 1,
            "system" : "http://unitsofmeasure.org",
            "code" : "h"
          }
        }
      ]
    },
    {
      "id" : "check-suspected-disorder",
      "description" : "This action represents the start of the check suspected disorder reporting workflow in response to the encounter-start event.",
      "textEquivalent" : "Check suspected disorders for immediate reportability and setup jobs for future reportability checks.",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "execute-reporting-workflow"
            }
          ]
        }
      ],
      "action" : [
        {
          "id" : "is-encounter-suspected-disorder",
          "description" : "This action represents the check for suspected disorder reportability to create the patients eICR.",
          "textEquivalent" : "Check Trigger Codes based on Suspected Reportable Value set.",
          "code" : [
            {
              "coding" : [
                {
                  "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
                  "code" : "check-trigger-codes"
                }
              ]
            }
          ],
          "condition" : [
            {
              "kind" : "applicability",
              "expression" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-alternative-expression-extension",
                    "valueExpression" : {
                      "language" : "text/cql-identifier",
                      "expression" : "Is Suspected Disorder?",
                      "reference" : "http://example.org/fhir/Library/RuleFilters|1.0.0"
                    }
                  }
                ],
                "language" : "text/fhirpath",
                "expression" : "%modifiedConditions.exists() or %modifiedLabResults.exists() or %modifiedMedicationOrders.exists()"
              }
            }
          ],
          "input" : [
            {
              "id" : "modifiedConditions",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "Condition?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "Condition",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-sdtc-example"
                }
              ]
            },
            {
              "id" : "modifiedLabResults",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "Observation?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "Observation",
              "codeFilter" : [
                {
                  "path" : "value",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-sdtc-example"
                }
              ]
            },
            {
              "id" : "modifiedMedicationOrders",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "MedicationRequest?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "MedicationRequest",
              "codeFilter" : [
                {
                  "path" : "medication",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-sdtc-example"
                }
              ]
            }
          ],
          "relatedAction" : [
            {
              "actionId" : "create-eicr",
              "relationship" : "before-start"
            }
          ]
        },
        {
          "id" : "continue-check-reportable",
          "code" : [
            {
              "coding" : [
                {
                  "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
                  "code" : "evaluate-condition"
                }
              ]
            }
          ],
          "condition" : [
            {
              "kind" : "applicability",
              "expression" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-alternative-expression-extension",
                    "valueExpression" : {
                      "language" : "text/cql-identifier",
                      "expression" : "Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?",
                      "reference" : "http://example.org/fhir/Library/RuleFilters|1.0.0"
                    }
                  }
                ],
                "language" : "text/fhirpath",
                "expression" : "%encounter.where((status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now()) or (status = 'finished' and period.end + 72 hours >= now())).select(true)"
              }
            }
          ],
          "relatedAction" : [
            {
              "actionId" : "check-reportable",
              "relationship" : "before-start",
              "offsetDuration" : {
                "value" : 6,
                "system" : "http://unitsofmeasure.org",
                "code" : "h"
              }
            }
          ]
        }
      ]
    },
    {
      "id" : "check-reportable",
      "description" : "This action represents the check for suspected reportability of the eICR.",
      "textEquivalent" : "Check Reportability and setup jobs for future reportability checks.",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "execute-reporting-workflow"
            }
          ]
        }
      ],
      "action" : [
        {
          "id" : "is-encounter-reportable",
          "description" : "This action represents the check for reportability to create the patients eICR.",
          "textEquivalent" : "Check Trigger Codes based on RCTC Value sets.",
          "code" : [
            {
              "coding" : [
                {
                  "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
                  "code" : "check-trigger-codes"
                }
              ]
            }
          ],
          "condition" : [
            {
              "kind" : "applicability",
              "expression" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-alternative-expression-extension",
                    "valueExpression" : {
                      "language" : "text/cql-identifier",
                      "expression" : "Is Encounter Reportable and Within Normal Reporting Duration?",
                      "reference" : "http://example.org/fhir/Library/RuleFilters|1.0.0"
                    }
                  }
                ],
                "language" : "text/fhirpath",
                "expression" : "%encounter.where(period.start + 1 day * %normalReportingDuration >= now()).select(true) and (%conditions.exists() or %encounters.exists() or %immunizations.exists() or %procedures.exists() or %procedureOrders.exists() or %labOrders.exists() or %labTests.exists() or %labResults.exists() or %medicationAdministrations.exists() or %medicationOrders.exists() or %medicationDispenses.exists())"
              }
            }
          ],
          "input" : [
            {
              "id" : "conditions",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "Condition?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "Condition",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-dxtc-example"
                }
              ]
            },
            {
              "id" : "encounters",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
                  "valueString" : "encounter"
                }
              ],
              "type" : "Encounter",
              "codeFilter" : [
                {
                  "path" : "reasonCode",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-dxtc-example"
                }
              ]
            },
            {
              "id" : "immunizations",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "Immunization?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "Immunization",
              "codeFilter" : [
                {
                  "path" : "vaccineCode",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-mrtc-example"
                }
              ]
            },
            {
              "id" : "labOrders",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "ServiceRequest?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "ServiceRequest",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-lotc-example"
                }
              ]
            },
            {
              "id" : "labTests",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "Observation?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "Observation",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-lotc-example"
                }
              ]
            },
            {
              "id" : "diagnosticOrders",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "DiagnosticReport?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "DiagnosticReport",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-lotc-example"
                }
              ]
            },
            {
              "id" : "procedureOrders",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "ServiceRequest?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "ServiceRequest",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-pctc-example"
                }
              ]
            },
            {
              "id" : "procedures",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "Procedure?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "Procedure",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-pctc-example"
                }
              ]
            },
            {
              "id" : "medicationOrders",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "MedicationRequest?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "MedicationRequest",
              "codeFilter" : [
                {
                  "path" : "medication",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-mrtc-example"
                }
              ]
            },
            {
              "id" : "medicationDispenses",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "MedicationDispense?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "MedicationDispense",
              "codeFilter" : [
                {
                  "path" : "medication",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-mrtc-example"
                }
              ]
            },
            {
              "id" : "medicationAdministrations",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-fhirquerypattern-extension",
                  "valueString" : "MedicationAdministration?patient=Patient/{{context.patientId}}"
                }
              ],
              "type" : "MedicationAdministration",
              "codeFilter" : [
                {
                  "path" : "medication",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-mrtc-example"
                }
              ]
            },
            {
              "id" : "labResults",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
                  "valueString" : "labTests"
                }
              ],
              "type" : "Observation",
              "codeFilter" : [
                {
                  "path" : "value",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-ostc-example"
                }
              ]
            },
            {
              "id" : "diagnosticResults",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
                  "valueString" : "diagnosticOrders"
                }
              ],
              "type" : "DiagnosticReport",
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/fhir/ValueSet/valueset-ostc-example"
                }
              ]
            }
          ],
          "relatedAction" : [
            {
              "actionId" : "create-eicr",
              "relationship" : "before-start"
            }
          ]
        },
        {
          "id" : "check-update-eicr",
          "code" : [
            {
              "coding" : [
                {
                  "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
                  "code" : "evaluate-condition"
                }
              ]
            }
          ],
          "condition" : [
            {
              "kind" : "applicability",
              "expression" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-alternative-expression-extension",
                    "valueExpression" : {
                      "language" : "text/cql-identifier",
                      "expression" : "Most recent eICR sent over 72 hours ago?",
                      "reference" : "http://example.org/fhir/Library/RuleFilters|1.0.0"
                    }
                  }
                ],
                "language" : "text/fhirpath",
                "expression" : "((%lasteicr.last().entry[2].resource as Bundle).entry.first().resource as Composition).date < now() - 72 hours"
              }
            }
          ],
          "input" : [
            {
              "id" : "lasteicr",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
                  "valueString" : "eicrreport"
                }
              ],
              "type" : "Bundle",
              "profile" : [
                🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle"
              ]
            }
          ],
          "relatedAction" : [
            {
              "actionId" : "create-eicr",
              "relationship" : "before-start"
            }
          ]
        },
        {
          "id" : "is-encounter-in-progress",
          "code" : [
            {
              "coding" : [
                {
                  "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
                  "code" : "evaluate-condition"
                }
              ]
            }
          ],
          "condition" : [
            {
              "kind" : "applicability",
              "expression" : {
                "extension" : [
                  {
                    "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-alternative-expression-extension",
                    "valueExpression" : {
                      "language" : "text/cql-identifier",
                      "expression" : "Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?",
                      "reference" : "http://example.org/fhir/Library/RuleFilters|1.0.0"
                    }
                  }
                ],
                "language" : "text/fhirpath",
                "expression" : "%inprogressencounter.where(status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now() or (status = 'finished' and period.end + 72 hours >= now())).exists()"
              }
            }
          ],
          "input" : [
            {
              "id" : "inprogressencounter",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
                  "valueString" : "encounter"
                }
              ],
              "type" : "Encounter"
            }
          ],
          "relatedAction" : [
            {
              "actionId" : "check-reportable",
              "relationship" : "before-start",
              "offsetDuration" : {
                "value" : 6,
                "system" : "http://unitsofmeasure.org",
                "code" : "h"
              }
            }
          ]
        }
      ]
    },
    {
      "id" : "create-eicr",
      "description" : "This action represents the creation of the eICR. It subsequently calls validate.",
      "textEquivalent" : "Create eICR",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "create-report"
            }
          ]
        }
      ],
      "input" : [
        {
          "id" : "patientdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "patient"
            }
          ],
          "type" : "Patient",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
          ]
        },
        {
          "id" : "conditiondata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "conditions"
            }
          ],
          "type" : "Condition",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-encounter-diagnosis"
          ]
        },
        {
          "id" : "encounterdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "encounter"
            }
          ],
          "type" : "Encounter",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"
          ]
        },
        {
          "id" : "mrdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "medicationOrders"
            }
          ],
          "type" : "MedicationRequest",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"
          ]
        },
        {
          "id" : "immzdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "immunizations"
            }
          ],
          "type" : "Immunization",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"
          ]
        },
        {
          "id" : "procdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "procedures"
            }
          ],
          "type" : "Procedure",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"
          ]
        },
        {
          "id" : "labResultdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "labResults"
            }
          ],
          "type" : "Observation",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"
          ]
        },
        {
          "id" : "labOrderdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "labOrders"
            }
          ],
          "type" : "ServiceRequest",
          "profile" : [
            🔗 "http://hl7.org/fhir/StructureDefinition/ServiceRequest"
          ]
        },
        {
          "id" : "diagnosticResultdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "diagnosticResults"
            }
          ],
          "type" : "DiagnosticReport",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"
          ]
        },
        {
          "id" : "diagnosticOrderdata",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "diagnosticOrders"
            }
          ],
          "type" : "DiagnosticReport",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"
          ]
        }
      ],
      "output" : [
        {
          "id" : "eicrreport",
          "type" : "Bundle",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle"
          ]
        }
      ],
      "relatedAction" : [
        {
          "actionId" : "validate-eicr",
          "relationship" : "before-start"
        }
      ],
      "action" : [
        {
          "id" : "anonymize-report",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-trust-service-endpoint-extension",
              "valueReference" : {
                🔗 "reference" : "Endpoint/us-ph-endpoint-pha"
              }
            }
          ],
          "description" : "This action is used to anonymize a identifiable report",
          "textEquivalent" : "Anonymize the report.",
          "code" : [
            {
              "coding" : [
                {
                  "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
                  "code" : "anonymize-report"
                }
              ]
            }
          ],
          "input" : [
            {
              "id" : "report-to-be-anonymized",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
                  "valueString" : "output-report"
                }
              ],
              "type" : "Bundle"
            }
          ],
          "output" : [
            {
              "id" : "anonymized-report",
              "type" : "Bundle",
              "profile" : [
                🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-reporting-bundle"
              ]
            }
          ]
        }
      ]
    },
    {
      "id" : "validate-eicr",
      "description" : "This action represents the validation of the eICR. It subsequently calls route-and-send.",
      "textEquivalent" : "Validate eICR",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "validate-report"
            }
          ]
        }
      ],
      "input" : [
        {
          "id" : "generatedeicrreport",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "eicrreport"
            }
          ],
          "type" : "Bundle",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle"
          ]
        }
      ],
      "output" : [
        {
          "id" : "valideicrreport",
          "type" : "Bundle",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle"
          ]
        }
      ],
      "relatedAction" : [
        {
          "actionId" : "route-and-send-eicr",
          "relationship" : "before-start"
        }
      ]
    },
    {
      "id" : "route-and-send-eicr",
      "description" : "This action represents the routing and sending of the eICR.",
      "textEquivalent" : "Route and send eICR",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "submit-report"
            }
          ]
        }
      ],
      "input" : [
        {
          "id" : "validatedeicrreport",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension",
              "valueString" : "valideicrreport"
            }
          ],
          "type" : "Bundle",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle"
          ]
        }
      ],
      "output" : [
        {
          "id" : "submittedeicrreport",
          "type" : "Bundle",
          "profile" : [
            🔗 "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle"
          ]
        }
      ]
    },
    {
      "id" : "encounter-modified",
      "description" : "This action represents the start of the reporting workflow in response to the encounter-modified event",
      "textEquivalent" : "Start the reporting workflow in response to an encounter-modified event",
      "code" : [
        {
          "coding" : [
            {
              "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions",
              "code" : "initiate-reporting-workflow",
              "display" : "Initiate a reporting workflow"
            }
          ]
        }
      ],
      "trigger" : [
        {
          "id" : "encounter-modified-trigger",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-named-eventtype-extension",
              "valueCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-triggerdefinition-namedevents",
                    "code" : "encounter-modified",
                    "display" : "Indicates modifications to data elements of an encounter"
                  }
                ]
              }
            }
          ],
          "type" : "named-event",
          "name" : "encounter-modified"
        }
      ],
      "condition" : [
        {
          "kind" : "applicability",
          "expression" : {
            "extension" : [
              {
                "url" : "http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-alternative-expression-extension",
                "valueExpression" : {
                  "language" : "text/cql-identifier",
                  "expression" : "Is Encounter Longer Than Normal Reporting Duration?",
                  "reference" : "http://example.org/fhir/Library/RuleFilters|1.0.0"
                }
              }
            ],
            "language" : "text/fhirpath",
            "expression" : "%encounter.where(period.start + 1 day * %normalReportingDuration < now()).select(true)"
          }
        }
      ],
      "relatedAction" : [
        {
          "actionId" : "create-eicr",
          "relationship" : "before-start"
        }
      ]
    }
  ]
}