us-ph-plandefinition-alt-expression-example
type: PlanDefinition
node role: treeRoot
id:
  v: us-ph-plandefinition-alt-expression-example
meta:
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-plandefinition
    l: us-ph-plandefinition
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: Id: us-ph-plandefinition-alt-expression-example Url: US Public Health PlanDefinition Alternative Expression Example Version: 2.0.0 urn:oid:2.16.840.1.113883.4.642.40.58.34.1 Title: US Public Health PlanDefinition Alternative Expression Example Experimental: true Type: system: http://terminology.hl7.org/CodeSystem/plan-definition-type code: workflow-definition display: Workflow Definition Date: 2022-07-31 12:32:29-0500 Publisher: HL7 International / Public Health Description: An example PlanDefinition Jurisdiction: US Effective Period: 2020-12-01.. Related Artifacts: Dependencies http://example.org/fhir/Library/library-rctc-example Actions: Start the reporting workflow in response to an encounter-start event When: Named Event: encounter-start Check suspected disorders for immediate reportability and setup jobs for future reportability checks. Then: Check Trigger Codes based on Suspected Reportable Value set. If: Applicability: (%modifiedConditions.exists() or %modifiedLabResults.exists() or %modifiedMedicationOrders.exists()) : If: Applicability: (%encounter.where((status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now()) or (status = 'finished' and period.end + 72 hours >= now())).select(true)) Check Reportability and setup jobs for future reportability checks. Then: Check Trigger Codes based on RCTC Value sets. If: Applicability: (%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())) : If: Applicability: (((%lasteicr.last().entry[2].resource as Bundle).entry.first().resource as Composition).date < now() - 72 hours) : If: Applicability: (%inprogressencounter.where(status = 'in-progress' and period.start + 1 d…
url:
  v: http://hl7.org/fhir/us/ph-library/PlanDefinition/us-ph-plandefinition-alt-expression-example
  l: us-ph-plandefinition-alt-expression-example
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.40.58.34.1
version:
  v: 2.0.0
name:
  v: USPublicHealthPlanDefinitionAlternativeExpressionExample
title:
  v: US Public Health PlanDefinition Alternative Expression Example
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/plan-definition-type
      l: plan-definition-type
    code:
      v: workflow-definition
    display:
      v: Workflow Definition
status:
  v: active
experimental:
  v: true
date:
  v: 2022-07-31T12:32:29.858-05:00
publisher:
  v: HL7 International / Public Health
contact:
  name:
    v: HL7 International / Public Health
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/pher
  telecom:
    system:
      v: email
description:
  v: An example PlanDefinition
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
effective period:
  start:
    v: 2020-12-01
related artifact:
  type:
    v: depends-on
  label:
    v: RCTC Value Set Library of Trigger Codes
  resource:
    v: http://example.org/fhir/Library/library-rctc-example
    l: library-rctc-example
action:
  id:
    v: start-workflow
  description:
    v: This action represents the start of the reporting workflow in response to the encounter-start event.
  text equivalent:
    v: Start the reporting workflow in response to an encounter-start event
  code:
    coding:
      system:
        v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
        l: us-ph-codesystem-plandefinition-actions
      code:
        v: initiate-reporting-workflow
      display:
        v: Initiate a reporting workflow
  trigger:
    id:
      v: encounter-start
    extension:
      url:
        v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-named-eventtype-extension
        l: us-ph-named-eventtype-extension
      value: CodeableConcept
    type:
      v: named-event
    name:
      v: encounter-start
  input:
    id:
      v: patient
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: Patient/{{context.patientId}}
    type:
      v: Patient
  input:
    id:
      v: encounter
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: Encounter/{{context.encounterId}}
    type:
      v: Encounter
  related action:
    action id:
      v: check-suspected-disorder
    relationship:
      v: before-start
    offset: Duration
      value:
        v: 1
      system:
        v: http://unitsofmeasure.org
        l: unitsofmeasure.org
      code:
        v: h
action:
  id:
    v: check-suspected-disorder
  description:
    v: This action represents the start of the check suspected disorder reporting workflow in response to the encounter-start event.
  text equivalent:
    v: Check suspected disorders for immediate reportability and setup jobs for future reportability checks.
  code:
    coding:
      system:
        v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
        l: us-ph-codesystem-plandefinition-actions
      code:
        v: execute-reporting-workflow
  action:
    id:
      v: is-encounter-suspected-disorder
    description:
      v: This action represents the check for suspected disorder reportability to create the patients eICR.
    text equivalent:
      v: Check Trigger Codes based on Suspected Reportable Value set.
    condition:
      kind:
        v: applicability
    input:
      id:
        v: modifiedConditions
      extension:
        value: String
      type:
        v: Condition
    input:
      id:
        v: modifiedLabResults
      extension:
        value: String
      type:
        v: Observation
    input:
      id:
        v: modifiedMedicationOrders
      extension:
        value: String
      type:
        v: MedicationRequest
    related action:
      action id:
        v: create-eicr
      relationship:
        v: before-start
  action:
    id:
      v: continue-check-reportable
    condition:
      kind:
        v: applicability
    related action:
      action id:
        v: check-reportable
      relationship:
        v: before-start
      offset: Duration

system:
  v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-triggerdefinition-namedevents
  l: us-ph-codesystem-triggerdefinition-namedevents
code:
  v: encounter-start
display:
  v: Indicates the start of an encounter

v: check-trigger-codes

url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-alternativeExpression
  l: cqf-alternativeExpression
value: Expression
  language:
    v: text/cql-identifier
  expression:
    v: Is Suspected Disorder?
  reference:
    v: http://hl7.org/fhir/us/ph-library/Library/cql-library-rule-filters
    l: cql-library-rule-filters

v: text/fhirpath

v: %modifiedConditions.exists() or %modifiedLabResults.exists() or %modifiedMedicationOrders.exists()

String
v: Condition?patient=Patient/{{context.patientId}}

v: code

String
v: Observation?patient=Patient/{{context.patientId}}

v: value

String
v: MedicationRequest?patient=Patient/{{context.patientId}}

v: medication

v: evaluate-condition

url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-alternativeExpression
  l: cqf-alternativeExpression
value: Expression
  language:
    v: text/cql-identifier
  expression:
    v: Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?
  reference:
    v: http://hl7.org/fhir/us/ph-library/Library/cql-library-rule-filters
    l: cql-library-rule-filters

v: text/fhirpath

v: %encounter.where((status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now()) or (status = 'finished' and period.end + 72 hours >= now())).select(true)

v: 6

v: h

id:
  v: check-reportable
description:
  v: This action represents the check for suspected reportability of the eICR.
text equivalent:
  v: Check Reportability and setup jobs for future reportability checks.
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: execute-reporting-workflow
action:
  id:
    v: is-encounter-reportable
  description:
    v: This action represents the check for reportability to create the patients eICR.
  text equivalent:
    v: Check Trigger Codes based on RCTC Value sets.
  code:
    coding:
      system:
        v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
        l: us-ph-codesystem-plandefinition-actions
      code:
        v: check-trigger-codes
  condition:
    kind:
      v: applicability
    expression:
      extension:
        value: Expression
      language:
        v: text/fhirpath
      expression:
        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())
  input:
    id:
      v: conditions
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: Condition?patient=Patient/{{context.patientId}}
    type:
      v: Condition
    code filter:
      path:
        v: code
      value set:
        v: http://example.org/fhir/ValueSet/valueset-dxtc-example
        l: valueset-dxtc-example
  input:
    id:
      v: encounters
    extension:
      url:
        v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
        l: us-ph-relateddata-extension
      value: String
        v: encounter
    type:
      v: Encounter
    code filter:
      path:
        v: reasonCode
      value set:
        v: http://example.org/fhir/ValueSet/valueset-dxtc-example
        l: valueset-dxtc-example
  input:
    id:
      v: immunizations
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: Immunization?patient=Patient/{{context.patientId}}
    type:
      v: Immunization
    code filter:
      path:
        v: vaccineCode
      value set:
        v: http://example.org/fhir/ValueSet/valueset-mrtc-example
        l: valueset-mrtc-example
  input:
    id:
      v: labOrders
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: ServiceRequest?patient=Patient/{{context.patientId}}
    type:
      v: ServiceRequest
    code filter:
      path:
        v: code
      value set:
        v: http://example.org/fhir/ValueSet/valueset-lotc-example
        l: valueset-lotc-example
  input:
    id:
      v: labTests
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: Observation?patient=Patient/{{context.patientId}}
    type:
      v: Observation
    code filter:
      path:
        v: code
      value set:
        v: http://example.org/fhir/ValueSet/valueset-lotc-example
        l: valueset-lotc-example
  input:
    id:
      v: diagnosticOrders
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: DiagnosticReport?patient=Patient/{{context.patientId}}
    type:
      v: DiagnosticReport
    code filter:
      path:
        v: code
      value set:
        v: http://example.org/fhir/ValueSet/valueset-lotc-example
        l: valueset-lotc-example
  input:
    id:
      v: procedureOrders
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: ServiceRequest?patient=Patient/{{context.patientId}}
    type:
      v: ServiceRequest
    code filter:
      path:
        v: code
      value set:
        v: http://example.org/fhir/ValueSet/valueset-pctc-example
        l: valueset-pctc-example
  input:
    id:
      v: procedures
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: Procedure?patient=Patient/{{context.patientId}}
    type:
      v: Procedure
    code filter:
      path:
        v: code
      value set:
        v: http://example.org/fhir/ValueSet/valueset-pctc-example
        l: valueset-pctc-example
  input:
    id:
      v: medicationOrders
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: MedicationRequest?patient=Patient/{{context.patientId}}
    type:
      v: MedicationRequest
    code filter:
      path:
        v: medication
      value set:
        v: http://example.org/fhir/ValueSet/valueset-mrtc-example
        l: valueset-mrtc-example
  input:
    id:
      v: medicationDispenses
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
        l: cqf-fhirQueryPattern
      value: String
        v: MedicationDispense?patient=Patient/{{context.patientId}}
    type:
      v: MedicationDispense
    code filter:
      path:
        v: medication

Expression
language:
  v: text/cql-identifier
expression:
  v: Is Encounter Reportable and Within Normal Reporting Duration?
reference:
  v: http://hl7.org/fhir/us/ph-library/Library/cql-library-rule-filters
  l: cql-library-rule-filters

id:
  v: medicationAdministrations
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern
    l: cqf-fhirQueryPattern
  value: String
type:
  v: MedicationAdministration
code filter:
  path:
    v: medication
  value set:
    v: http://example.org/fhir/ValueSet/valueset-mrtc-example
    l: valueset-mrtc-example

id:
  v: labResults
extension:
  url:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
    l: us-ph-relateddata-extension
  value: String
    v: labTests
type:
  v: Observation
code filter:
  path:
    v: value
  value set:
    v: http://example.org/fhir/ValueSet/valueset-ostc-example
    l: valueset-ostc-example

id:
  v: diagnosticResults
extension:
  url:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
    l: us-ph-relateddata-extension
  value: String
    v: diagnosticOrders
type:
  v: DiagnosticReport
code filter:
  path:
    v: code
  value set:
    v: http://example.org/fhir/ValueSet/valueset-ostc-example
    l: valueset-ostc-example

action id:
  v: create-eicr
relationship:
  v: before-start

id:
  v: check-update-eicr
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: evaluate-condition
condition:
  kind:
    v: applicability
  expression:
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-alternativeExpression
        l: cqf-alternativeExpression
      value: Expression
    language:
      v: text/fhirpath
    expression:
      v: ((%lasteicr.last().entry[2].resource as Bundle).entry.first().resource as Composition).date < now() - 72 hours
input:
  id:
    v: lasteicr
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: eicrreport
  type:
    v: Bundle
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle
    l: us-ph-document-bundle
related action:
  action id:
    v: create-eicr
  relationship:
    v: before-start

v: text/cql-identifier

v: Most recent eICR sent over 72 hours ago?

id:
  v: is-encounter-in-progress
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: evaluate-condition
condition:
  kind:
    v: applicability
  expression:
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-alternativeExpression
        l: cqf-alternativeExpression
      value: Expression
    language:
      v: text/fhirpath
    expression:
      v: %inprogressencounter.where(status = 'in-progress' and period.start + 1 day * %normalReportingDuration >= now() or (status = 'finished' and period.end + 72 hours >= now())).exists()
input:
  id:
    v: inprogressencounter
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: encounter
  type:
    v: Encounter
related action:
  action id:
    v: check-reportable
  relationship:
    v: before-start
  offset: Duration
    value:
      v: 6
    system:
      v: http://unitsofmeasure.org
      l: unitsofmeasure.org
    code:
      v: h

v: text/cql-identifier

v: Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?

id:
  v: create-eicr
description:
  v: This action represents the creation of the eICR. It subsequently calls validate.
text equivalent:
  v: Create eICR
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: create-report
input:
  id:
    v: patientdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: patient
  type:
    v: Patient
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
    l: us-core-patient
input:
  id:
    v: conditiondata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: conditions
  type:
    v: Condition
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-encounter-diagnosis
    l: us-core-condition-encounter-diagnosis
input:
  id:
    v: encounterdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: encounter
  type:
    v: Encounter
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter
    l: us-core-encounter
input:
  id:
    v: mrdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: medicationOrders
  type:
    v: MedicationRequest
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
input:
  id:
    v: immzdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: immunizations
  type:
    v: Immunization
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization
    l: us-core-immunization
input:
  id:
    v: procdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: procedures
  type:
    v: Procedure
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure
    l: us-core-procedure
input:
  id:
    v: labResultdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: labResults
  type:
    v: Observation
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab
    l: us-core-observation-lab
input:
  id:
    v: labOrderdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: labOrders
  type:
    v: ServiceRequest
  profile:
    v: http://hl7.org/fhir/StructureDefinition/ServiceRequest
    l: ServiceRequest
input:
  id:
    v: diagnosticResultdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: diagnosticResults
  type:
    v: DiagnosticReport
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab
    l: us-core-diagnosticreport-lab
input:
  id:
    v: diagnosticOrderdata
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: diagnosticOrders
  type:
    v: DiagnosticReport
  profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab
    l: us-core-diagnosticreport-lab
output:
  id:
    v: eicrreport
  type:
    v: Bundle
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle
    l: us-ph-document-bundle
related action:
  action id:
    v: validate-eicr
  relationship:
    v: before-start
action:
  id:
    v: anonymize-report
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-trust-service-endpoint-extension
      l: us-ph-trust-service-endpoint-extension
    value: Reference
      l: us-ph-endpoint-pha
      reference:
        v: Endpoint/us-ph-endpoint-pha
  description:
    v: This action is used to anonymize a identifiable report
  text equivalent:
    v: Anonymize the report.
  code:
    coding:
      system:
        v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
        l: us-ph-codesystem-plandefinition-actions
      code:
        v: anonymize-report
  input:
    id:
      v: report-to-be-anonymized
    extension:
      url:
        v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
        l: us-ph-relateddata-extension
      value: String
        v: output-report
    type:
      v: Bundle
  output:
    id:
      v: anonymized-report

v: Bundle

id:
  v: validate-eicr
description:
  v: This action represents the validation of the eICR. It subsequently calls route-and-send.
text equivalent:
  v: Validate eICR
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: validate-report
input:
  id:
    v: generatedeicrreport
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: eicrreport
  type:
    v: Bundle
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle
    l: us-ph-document-bundle
output:
  id:
    v: valideicrreport
  type:
    v: Bundle
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle
    l: us-ph-document-bundle
related action:
  action id:
    v: route-and-send-eicr
  relationship:
    v: before-start

id:
  v: route-and-send-eicr
description:
  v: This action represents the routing and sending of the eICR.
text equivalent:
  v: Route and send eICR
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: submit-report
input:
  id:
    v: validatedeicrreport
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-relateddata-extension
      l: us-ph-relateddata-extension
    value: String
      v: valideicrreport
  type:
    v: Bundle
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle
    l: us-ph-document-bundle
output:
  id:
    v: submittedeicrreport
  type:
    v: Bundle
  profile:
    v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-document-bundle
    l: us-ph-document-bundle

id:
  v: encounter-modified
description:
  v: This action represents the start of the reporting workflow in response to the encounter-modified event
text equivalent:
  v: Start the reporting workflow in response to an encounter-modified event
code:
  coding:
    system:
      v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-plandefinition-actions
      l: us-ph-codesystem-plandefinition-actions
    code:
      v: initiate-reporting-workflow
    display:
      v: Initiate a reporting workflow
trigger:
  id:
    v: encounter-modified-trigger
  extension:
    url:
      v: http://hl7.org/fhir/us/ph-library/StructureDefinition/us-ph-named-eventtype-extension
      l: us-ph-named-eventtype-extension
    value: CodeableConcept
  type:
    v: named-event
  name:
    v: encounter-modified
condition:
  kind:
    v: applicability
  expression:
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/cqf-alternativeExpression
        l: cqf-alternativeExpression
      value: Expression
    language:
      v: text/fhirpath
    expression:
      v: %encounter.where(period.start + 1 day * %normalReportingDuration < now()).select(true)
related action:
  action id:
    v: create-eicr
  relationship:
    v: before-start

v: encounter-modified

v: Indicates modifications to data elements of an encounter

v: text/cql-identifier

v: Is Encounter Longer Than Normal Reporting Duration?