HL7 FHIR® Implementation Guide: Electronic Case Reporting (eCR) - US Realm
2.1.2 - STU 2 United States of America flag

This page is part of the electronic Case Reporting (eCR) (v2.1.2: STU 2) based on FHIR (HL7® FHIR® Standard) R4. This is the current published version. For a full list of available versions, see the Directory of published versions

: eRSD PlanDefinition Instance Example - TTL Representation

Active as of 2020-07-31

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:PlanDefinition ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "plandefinition-ersd-instance-example"] ; # 
  fhir:meta [
    ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/ersd-plandefinition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/ersd-plandefinition>     ] )
  ] ; # 
  fhir:text [
fhir:status [ fhir:v "extensions" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: PlanDefinition plandefinition-ersd-instance-example</b></p><a name=\"plandefinition-ersd-instance-example\"> </a><a name=\"hcplandefinition-ersd-instance-example\"> </a><a name=\"plandefinition-ersd-instance-example-en-US\"> </a><p><b>Variable</b>: <span title=\"text/fhirpath\"><code>14</code></span>(<b>normalReportingDuration</b>)</p><p><b>url</b>: <a href=\"PlanDefinition-plandefinition-ersd-instance-example.html\">PlanDefinition eRSD PlanDefinition Instance Example</a></p><p><b>identifier</b>: <a href=\"http://terminology.hl7.org/6.0.2/NamingSystem-uri.html\" title=\"As defined by RFC 3986 (http://www.ietf.org/rfc/rfc3986.txt)(with many schemes defined in many RFCs). For OIDs and UUIDs, use the URN form (urn:oid:(note: lowercase) and urn:uuid:). See http://www.ietf.org/rfc/rfc3001.txt and http://www.ietf.org/rfc/rfc4122.txt \r\n\r\nThis oid is used as an identifier II.root to indicate the the extension is an absolute URI (technically, an IRI). Typically, this is used for OIDs and GUIDs. Note that when this OID is used with OIDs and GUIDs, the II.extension should start with urn:oid or urn:uuid: \r\n\r\nNote that this OID is created to aid with interconversion between CDA and FHIR - FHIR uses urn:ietf:rfc:3986 as equivalent to this OID. URIs as identifiers appear more commonly in FHIR.\r\n\r\nThis OID may also be used in CD.codeSystem.\">Uniform Resource Identifier (URI)</a>/urn:oid:2.16.840.1.113883.4.642.40.46.34.3</p><p><b>version</b>: 2.1.2</p><p><b>name</b>: PlanDefinition_eRSD_Instance_Example</p><p><b>title</b>: eRSD PlanDefinition Instance 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>: 2020-07-31 12:32:29-0500</p><p><b>publisher</b>: HL7 International / Public Health</p><p><b>contact</b>: HL7 International / Public Health: <a href=\"http://www.hl7.org/Special/committees/pher\">http://www.hl7.org/Special/committees/pher</a></p><p><b>description</b>: </p><div><p>An example ersd 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><a href=\"Bundle-bundle-ersd-specification-example.html\">Reportable Condition Trigger Codes (RCTC) Example Library</a></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/ecr/CodeSystem/us-ph-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/ecr/CodeSystem/us-ph-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/ecr/CodeSystem/us-ph-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/ecr/CodeSystem/us-ph-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><a href=\"ValueSet-valueset-sdtc-example.html\">Example Suspected Disorder Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-lotc-example.html\">Example Lab Order Test Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-mrtc-example.html\">Example Medications Triggers for Public Health Reporting</a></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/ecr/CodeSystem/us-ph-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; comparator: &lt;=; 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/ecr/CodeSystem/us-ph-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/ecr/CodeSystem/us-ph-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><a href=\"ValueSet-valueset-dxtc-example.html\">Example Diagnosis Problem Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-dxtc-example.html\">Example Diagnosis Problem Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-mrtc-example.html\">Example Medications Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-lotc-example.html\">Example Lab Order Test Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-lotc-example.html\">Example Lab Order Test Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-lotc-example.html\">Example Lab Order Test Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-pctc-example.html\">Example Procedure Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-pctc-example.html\">Example Procedure Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-mrtc-example.html\">Example Medications Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-mrtc-example.html\">Example Medications Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-mrtc-example.html\">Example Medications Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-ostc-example.html\">Example Organism Substance Triggers for Public Health Reporting</a></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><a href=\"ValueSet-valueset-ostc-example.html\">Example Organism Substance Triggers for Public Health Reporting</a></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/ecr/CodeSystem/us-ph-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-eicr-document-bundle.html\">eICR 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/ecr/CodeSystem/us-ph-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; comparator: &lt;=; system: http://unitsofmeasure.org; code: h)</td></tr></table></blockquote><blockquote><p><b>action</b></p><blockquote><p><b>id</b></p>is-encounter-completed</blockquote><p><b>code</b>: <span title=\"Codes:{http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions complete-reporting}\">Complete reporting for the patient</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>%completedEncounter.exists(status = 'finished')</td></tr></table></blockquote><blockquote><p><b>input</b></p><blockquote><p><b>id</b></p>completedEncounter</blockquote><p><b>US Public Health Related Data Extension</b>: encounter</p><p><b>type</b>: Encounter</p></blockquote></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/ecr/CodeSystem/us-ph-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/STU4/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/STU4/StructureDefinition-us-core-condition.html\">US Core Condition 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/STU4/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/STU4/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/STU4/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/STU4/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/STU4/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/STU4/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/STU4/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-eicr-document-bundle.html\">eICR 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><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/ecr/CodeSystem/us-ph-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-eicr-document-bundle.html\">eICR 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-eicr-document-bundle.html\">eICR 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/ecr/CodeSystem/us-ph-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-eicr-document-bundle.html\">eICR 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-eicr-document-bundle.html\">eICR 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/ecr/CodeSystem/us-ph-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/ecr/CodeSystem/us-ph-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>"
  ] ; # 
  fhir:extension ( [
fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/variable"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:name [ fhir:v "normalReportingDuration" ] ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "14" ]     ]
  ] ) ; # 
  fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/PlanDefinition/plandefinition-ersd-instance-example"^^xsd:anyURI] ; # 
  fhir:identifier ( [
fhir:system [ fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ] ;
fhir:value [ fhir:v "urn:oid:2.16.840.1.113883.4.642.40.46.34.3" ]
  ] ) ; # 
  fhir:version [ fhir:v "2.1.2"] ; # 
  fhir:name [ fhir:v "PlanDefinition_eRSD_Instance_Example"] ; # 
  fhir:title [ fhir:v "eRSD PlanDefinition Instance Example"] ; # 
  fhir:type [
    ( fhir:coding [
fhir:system [ fhir:v "http://terminology.hl7.org/CodeSystem/plan-definition-type"^^xsd:anyURI ] ;
fhir:code [ fhir:v "workflow-definition" ] ;
fhir:display [ fhir:v "Workflow Definition" ]     ] )
  ] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:experimental [ fhir:v "true"^^xsd:boolean] ; # 
  fhir:date [ fhir:v "2020-07-31T12:32:29.858-05:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "HL7 International / Public Health"] ; # 
  fhir:contact ( [
fhir:name [ fhir:v "HL7 International / Public Health" ] ;
    ( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "http://www.hl7.org/Special/committees/pher" ]     ] )
  ] ) ; # 
  fhir:description [ fhir:v "An example ersd PlanDefinition"] ; # 
  fhir:jurisdiction ( [
    ( fhir:coding [
fhir:system [ fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ] ;
fhir:code [ fhir:v "US" ] ;
fhir:display [ fhir:v "United States of America" ]     ] ) ;
fhir:text [ fhir:v "United States of America" ]
  ] ) ; # 
  fhir:effectivePeriod [
fhir:start [ fhir:v "2020-12-01"^^xsd:date ]
  ] ; # 
  fhir:relatedArtifact ( [
fhir:type [ fhir:v "depends-on" ] ;
fhir:label [ fhir:v "RCTC Value Set Library of Trigger Codes" ] ;
fhir:resource [
fhir:v "http://hl7.org/fhir/us/ecr/Library/library-rctc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/Library/library-rctc-example>     ]
  ] ) ; # 
  fhir:action ( [
fhir:id [ fhir:v "start-workflow" ] ;
fhir:description [ fhir:v "This action represents the start of the reporting workflow in response to the encounter-start event." ] ;
fhir:textEquivalent [ fhir:v "Start the reporting workflow in response to an encounter-start event" ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "initiate-reporting-workflow" ] ;
fhir:display [ fhir:v "Initiate a reporting workflow" ]       ] )     ] ) ;
    ( fhir:trigger [
fhir:id [ fhir:v "encounter-start" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-named-eventtype-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
          ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-triggerdefinition-namedevents"^^xsd:anyURI ] ;
fhir:code [ fhir:v "encounter-start" ] ;
fhir:display [ fhir:v "Indicates the start of an encounter" ]           ] )         ]       ] ) ;
fhir:type [ fhir:v "named-event" ] ;
fhir:name [ fhir:v "encounter-start" ]     ] ) ;
    ( fhir:input [
fhir:id [ fhir:v "patient" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Patient/{{context.patientId}}" ]       ] ) ;
fhir:type [ fhir:v "Patient" ]     ] [
fhir:id [ fhir:v "encounter" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Encounter/{{context.encounterId}}" ]       ] ) ;
fhir:type [ fhir:v "Encounter" ]     ] ) ;
    ( fhir:relatedAction [
fhir:actionId [ fhir:v "check-suspected-disorder" ] ;
fhir:relationship [ fhir:v "before-start" ] ;
fhir:offset [
a fhir:Duration ;
fhir:value [ fhir:v "1"^^xsd:decimal ] ;
fhir:system [ fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ] ;
fhir:code [ fhir:v "h" ]       ]     ] )
  ] [
fhir:id [ fhir:v "check-suspected-disorder" ] ;
fhir:description [ fhir:v "This action represents the start of the check suspected disorder reporting workflow in response to the encounter-start event." ] ;
fhir:textEquivalent [ fhir:v "Check suspected disorders for immediate reportability and setup jobs for future reportability checks." ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "execute-reporting-workflow" ]       ] )     ] ) ;
    ( fhir:action [
fhir:id [ fhir:v "is-encounter-suspected-disorder" ] ;
fhir:description [ fhir:v "This action represents the check for suspected disorder reportability to create the patients eICR." ] ;
fhir:textEquivalent [ fhir:v "Check Trigger Codes based on Suspected Reportable Value set." ] ;
      ( fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "check-trigger-codes" ]         ] )       ] ) ;
      ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Is Suspected Disorder?" ] ;
fhir:reference [ fhir:v "http://hl7.org/fhir/us/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]             ]           ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "%modifiedConditions.exists() or %modifiedLabResults.exists() or %modifiedMedicationOrders.exists()" ]         ]       ] ) ;
      ( fhir:input [
fhir:id [ fhir:v "modifiedConditions" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Condition?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "Condition" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-sdtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-sdtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "modifiedLabResults" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Observation?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "Observation" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "value" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example>           ]         ] )       ] [
fhir:id [ fhir:v "modifiedMedicationOrders" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "MedicationRequest?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "MedicationRequest" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "medication" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example>           ]         ] )       ] ) ;
      ( fhir:relatedAction [
fhir:actionId [ fhir:v "create-eicr" ] ;
fhir:relationship [ fhir:v "before-start" ]       ] )     ] [
fhir:id [ fhir:v "continue-check-reportable" ] ;
      ( fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "evaluate-condition" ]         ] )       ] ) ;
      ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?" ] ;
fhir:reference [ fhir:v "http://hl7.org/fhir/us/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]             ]           ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "%encounter.where((status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now()) or (status = 'finished' and period.end + 72 hours >= now())).select(true)" ]         ]       ] ) ;
      ( fhir:relatedAction [
fhir:actionId [ fhir:v "check-reportable" ] ;
fhir:relationship [ fhir:v "before-start" ] ;
fhir:offset [
a fhir:Duration ;
fhir:value [ fhir:v "6"^^xsd:decimal ] ;
fhir:comparator [ fhir:v "<=" ] ;
fhir:system [ fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ] ;
fhir:code [ fhir:v "h" ]         ]       ] )     ] )
  ] [
fhir:id [ fhir:v "check-reportable" ] ;
fhir:description [ fhir:v "This action represents the check for suspected reportability of the eICR." ] ;
fhir:textEquivalent [ fhir:v "Check Reportability and setup jobs for future reportability checks." ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "execute-reporting-workflow" ]       ] )     ] ) ;
    ( fhir:action [
fhir:id [ fhir:v "is-encounter-reportable" ] ;
fhir:description [ fhir:v "This action represents the check for reportability to create the patients eICR." ] ;
fhir:textEquivalent [ fhir:v "Check Trigger Codes based on RCTC Value sets." ] ;
      ( fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "check-trigger-codes" ]         ] )       ] ) ;
      ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Is Encounter Reportable and Within Normal Reporting Duration?" ] ;
fhir:reference [ fhir:v "http://hl7.org/fhir/us/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]             ]           ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "%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())" ]         ]       ] ) ;
      ( fhir:input [
fhir:id [ fhir:v "conditions" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Condition?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "Condition" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-dxtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-dxtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "encounters" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "encounter" ]         ] ) ;
fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "reasonCode" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-dxtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-dxtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "immunizations" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Immunization?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "Immunization" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "vaccineCode" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "labOrders" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "ServiceRequest?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "ServiceRequest" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example>           ]         ] )       ] [
fhir:id [ fhir:v "labTests" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Observation?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "Observation" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example>           ]         ] )       ] [
fhir:id [ fhir:v "diagnosticOrders" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "DiagnosticReport?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example>           ]         ] )       ] [
fhir:id [ fhir:v "procedureOrders" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "ServiceRequest?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "ServiceRequest" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-pctc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-pctc-example>           ]         ] )       ] [
fhir:id [ fhir:v "procedures" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "Procedure?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "Procedure" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-pctc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-pctc-example>           ]         ] )       ] [
fhir:id [ fhir:v "medicationOrders" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "MedicationRequest?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "MedicationRequest" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "medication" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "medicationDispenses" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "MedicationDispense?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "MedicationDispense" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "medication" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "medicationAdministrations" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-fhirquerypattern-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "MedicationAdministration?patient=Patient/{{context.patientId}}" ]         ] ) ;
fhir:type [ fhir:v "MedicationAdministration" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "medication" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example>           ]         ] )       ] [
fhir:id [ fhir:v "labResults" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "labTests" ]         ] ) ;
fhir:type [ fhir:v "Observation" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "value" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-ostc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-ostc-example>           ]         ] )       ] [
fhir:id [ fhir:v "diagnosticResults" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "diagnosticOrders" ]         ] ) ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
        ( fhir:codeFilter [
fhir:path [ fhir:v "code" ] ;
fhir:valueSet [
fhir:v "http://hl7.org/fhir/us/ecr/ValueSet/valueset-ostc-example"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/ValueSet/valueset-ostc-example>           ]         ] )       ] ) ;
      ( fhir:relatedAction [
fhir:actionId [ fhir:v "create-eicr" ] ;
fhir:relationship [ fhir:v "before-start" ]       ] )     ] [
fhir:id [ fhir:v "check-update-eicr" ] ;
      ( fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "evaluate-condition" ]         ] )       ] ) ;
      ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Most recent eICR sent over 72 hours ago?" ] ;
fhir:reference [ fhir:v "http://hl7.org/fhir/us/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]             ]           ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "((%lasteicr.last().entry[2].resource as Bundle).entry.first().resource as Composition).date < now() - 72 hours" ]         ]       ] ) ;
      ( fhir:input [
fhir:id [ fhir:v "lasteicr" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "eicrreport" ]         ] ) ;
fhir:type [ fhir:v "Bundle" ] ;
        ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle>         ] )       ] ) ;
      ( fhir:relatedAction [
fhir:actionId [ fhir:v "create-eicr" ] ;
fhir:relationship [ fhir:v "before-start" ]       ] )     ] [
fhir:id [ fhir:v "is-encounter-in-progress" ] ;
      ( fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "evaluate-condition" ]         ] )       ] ) ;
      ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?" ] ;
fhir:reference [ fhir:v "http://hl7.org/fhir/us/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]             ]           ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "%inprogressencounter.where(status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now() or (status = 'finished' and period.end + 72 hours >= now())).exists()" ]         ]       ] ) ;
      ( fhir:input [
fhir:id [ fhir:v "inprogressencounter" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "encounter" ]         ] ) ;
fhir:type [ fhir:v "Encounter" ]       ] ) ;
      ( fhir:relatedAction [
fhir:actionId [ fhir:v "check-reportable" ] ;
fhir:relationship [ fhir:v "before-start" ] ;
fhir:offset [
a fhir:Duration ;
fhir:value [ fhir:v "6"^^xsd:decimal ] ;
fhir:comparator [ fhir:v "<=" ] ;
fhir:system [ fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ] ;
fhir:code [ fhir:v "h" ]         ]       ] )     ] [
fhir:id [ fhir:v "is-encounter-completed" ] ;
      ( fhir:code [
        ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "complete-reporting" ]         ] )       ] ) ;
      ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
          ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Is Encounter Complete" ] ;
fhir:reference [ fhir:v "http://aphl.org/fhir/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]             ]           ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "%completedEncounter.exists(status = 'finished')" ]         ]       ] ) ;
      ( fhir:input [
fhir:id [ fhir:v "completedEncounter" ] ;
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "encounter" ]         ] ) ;
fhir:type [ fhir:v "Encounter" ]       ] )     ] )
  ] [
fhir:id [ fhir:v "create-eicr" ] ;
fhir:description [ fhir:v "This action represents the creation of the eICR. It subsequently calls validate." ] ;
fhir:textEquivalent [ fhir:v "Create eICR" ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "create-report" ]       ] )     ] ) ;
    ( fhir:input [
fhir:id [ fhir:v "patientdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "patient" ]       ] ) ;
fhir:type [ fhir:v "Patient" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient>       ] )     ] [
fhir:id [ fhir:v "conditiondata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "conditions" ]       ] ) ;
fhir:type [ fhir:v "Condition" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition>       ] )     ] [
fhir:id [ fhir:v "encounterdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "encounter" ]       ] ) ;
fhir:type [ fhir:v "Encounter" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter>       ] )     ] [
fhir:id [ fhir:v "mrdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "medicationOrders" ]       ] ) ;
fhir:type [ fhir:v "MedicationRequest" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest>       ] )     ] [
fhir:id [ fhir:v "immzdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "immunizations" ]       ] ) ;
fhir:type [ fhir:v "Immunization" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization>       ] )     ] [
fhir:id [ fhir:v "procdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "procedures" ]       ] ) ;
fhir:type [ fhir:v "Procedure" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure>       ] )     ] [
fhir:id [ fhir:v "labResultdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "labResults" ]       ] ) ;
fhir:type [ fhir:v "Observation" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab>       ] )     ] [
fhir:id [ fhir:v "labOrderdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "labOrders" ]       ] ) ;
fhir:type [ fhir:v "ServiceRequest" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/StructureDefinition/ServiceRequest"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/ServiceRequest>       ] )     ] [
fhir:id [ fhir:v "diagnosticResultdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "diagnosticResults" ]       ] ) ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab>       ] )     ] [
fhir:id [ fhir:v "diagnosticOrderdata" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "diagnosticOrders" ]       ] ) ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab>       ] )     ] ) ;
    ( fhir:output [
fhir:id [ fhir:v "eicrreport" ] ;
fhir:type [ fhir:v "Bundle" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle>       ] )     ] ) ;
    ( fhir:relatedAction [
fhir:actionId [ fhir:v "validate-eicr" ] ;
fhir:relationship [ fhir:v "before-start" ]     ] )
  ] [
fhir:id [ fhir:v "validate-eicr" ] ;
fhir:description [ fhir:v "This action represents the validation of the eICR. It subsequently calls route-and-send." ] ;
fhir:textEquivalent [ fhir:v "Validate eICR" ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "validate-report" ]       ] )     ] ) ;
    ( fhir:input [
fhir:id [ fhir:v "generatedeicrreport" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "eicrreport" ]       ] ) ;
fhir:type [ fhir:v "Bundle" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle>       ] )     ] ) ;
    ( fhir:output [
fhir:id [ fhir:v "valideicrreport" ] ;
fhir:type [ fhir:v "Bundle" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle>       ] )     ] ) ;
    ( fhir:relatedAction [
fhir:actionId [ fhir:v "route-and-send-eicr" ] ;
fhir:relationship [ fhir:v "before-start" ]     ] )
  ] [
fhir:id [ fhir:v "route-and-send-eicr" ] ;
fhir:description [ fhir:v "This action represents the routing and sending of the eICR." ] ;
fhir:textEquivalent [ fhir:v "Route and send eICR" ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "submit-report" ]       ] )     ] ) ;
    ( fhir:input [
fhir:id [ fhir:v "validatedeicrreport" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-relateddata-extension"^^xsd:anyURI ] ;
fhir:value [ fhir:v "valideicrreport" ]       ] ) ;
fhir:type [ fhir:v "Bundle" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle>       ] )     ] ) ;
    ( fhir:output [
fhir:id [ fhir:v "submittedeicrreport" ] ;
fhir:type [ fhir:v "Bundle" ] ;
      ( fhir:profile [
fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/us/ecr/StructureDefinition/eicr-document-bundle>       ] )     ] )
  ] [
fhir:id [ fhir:v "encounter-modified" ] ;
fhir:description [ fhir:v "This action represents the start of the reporting workflow in response to the encounter-modified event" ] ;
fhir:textEquivalent [ fhir:v "Start the reporting workflow in response to an encounter-modified event" ] ;
    ( fhir:code [
      ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-plandefinition-actions"^^xsd:anyURI ] ;
fhir:code [ fhir:v "initiate-reporting-workflow" ] ;
fhir:display [ fhir:v "Initiate a reporting workflow" ]       ] )     ] ) ;
    ( fhir:trigger [
fhir:id [ fhir:v "encounter-modified-trigger" ] ;
      ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-named-eventtype-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:CodeableConcept ;
          ( fhir:coding [
fhir:system [ fhir:v "http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-triggerdefinition-namedevents"^^xsd:anyURI ] ;
fhir:code [ fhir:v "encounter-modified" ] ;
fhir:display [ fhir:v "Indicates modifications to data elements of an encounter" ]           ] )         ]       ] ) ;
fhir:type [ fhir:v "named-event" ] ;
fhir:name [ fhir:v "encounter-modified" ]     ] ) ;
    ( fhir:condition [
fhir:kind [ fhir:v "applicability" ] ;
fhir:expression [
        ( fhir:extension [
fhir:url [ fhir:v "http://hl7.org/fhir/us/ecr/StructureDefinition/us-ph-alternative-expression-extension"^^xsd:anyURI ] ;
fhir:value [
a fhir:Expression ;
fhir:language [ fhir:v "text/cql-identifier" ] ;
fhir:expression [ fhir:v "Is Encounter Longer Than Normal Reporting Duration?" ] ;
fhir:reference [ fhir:v "http://hl7.org/fhir/us/ecr/Library/RuleFilters|2.1.0"^^xsd:anyURI ]           ]         ] ) ;
fhir:language [ fhir:v "text/fhirpath" ] ;
fhir:expression [ fhir:v "%encounter.where(period.start + 1 day * %normalReportingDuration < now()).select(true)" ]       ]     ] ) ;
    ( fhir:relatedAction [
fhir:actionId [ fhir:v "create-eicr" ] ;
fhir:relationship [ fhir:v "before-start" ]     ] )
  ] ) . #