library-executable-rule-filters-example
type: Library
node role: treeRoot
id:
  v: library-executable-rule-filters-example
meta:
  profile:
    v: http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library
    l: cql-library
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: Title: Rule Filters Id: library-executable-rule-filters-example Version: 3.0.0-ballot Url: Rule Filters urn:oid:2.16.840.1.113883.4.642.40.46.28.3 Experimental: true Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2025-12-15 17:32:40+0000 Publisher: HL7 International / Public Health Description: An example logic library for eRSD - Chlamydia example. Jurisdiction: US Related Artifacts: Dependencies CQL Model Info http://hl7.org/fhir/uv/cql/Library/FHIRHelpers Logical Observation Identifiers, Names and Codes (LOINC) US Public Health CodeSystem - Usage Context Type eRSD Jurisdictions Example Example Diagnosis Problem Triggers for Public Health Reporting Example Medications Triggers for Public Health Reporting Example Lab Order Test Triggers for Public Health Reporting Example Lab Obs Test Name Triggers for Public Health Reporting Example Organism Substance Triggers for Public Health Reporting Example Procedure Triggers for Public Health Reporting Example Suspected Disorder Triggers for Public Health Reporting Example Chlamydia Supplemental Value Set for Public Health Reporting Indeterminate or Equivocal Lab Result Value Negative or Undetected Lab Result Value Parameters: Name Type Min Max In/Out Triggering Encounter Encounter 0 1 In normalReportingDuration Quantity 0 1 In Patient Patient 0 1 Out Chlamydia Test Results Observation 0 * Out Triggering Encounters Encounter 0 * Out Encounter Location References Reference 0 * Out Locations Matching Encounter Location References Location 0 * Out Encounter Location Address Resource 0 * Out Patient Address Resource 0 * Out Jurisdictions Resource 0 * Out Encounter Address Postal Code is in Jurisdiction Codes Resource 0 * Out Encounter Address State is in Jurisdiction Codes Resource 0 * Out Patient Address Postal Code is in Jurisdiction Codes Resource 0 * Out Patient Address State is in Jurisdiction Codes Resource 0 * Out Address Exists in Jurisdiction Codes boolean 0 1 Out Jurisdiction …
url:
  v: http://hl7.org/fhir/us/ecr/Library/library-executable-rule-filters-example
  l: library-executable-rule-filters-example
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.40.46.28.3
version:
  v: 3.0.0-ballot
name:
  v: LibraryExecutableRuleFilters
title:
  v: Rule Filters
status:
  v: active
experimental:
  v: true
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
      l: library-type
    code:
      v: logic-library
date:
  v: 2025-12-15T17:32:40+00: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 logic library for eRSD - Chlamydia example.
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
related artifact:
  type:
    v: depends-on
  display:
    v: FHIR model information
  resource:
    v: http://hl7.org/fhir/uv/cql/StructureDefinition/cql-modelinfo
    l: cql-modelinfo
related artifact:
  type:
    v: depends-on
  display:
    v: Library FHIRHelpers
  resource:
    v: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers
    l: FHIRHelpers
related artifact:
  type:
    v: depends-on
  display:
    v: Code system LOINC
  resource:
    v: http://loinc.org
    l: loinc.org
related artifact:
  type:
    v: depends-on
  display:
    v: Code system UsageContext
  resource:
    v: http://hl7.org/fhir/us/ph-library/CodeSystem/us-ph-codesystem-usage-context-type
    l: us-ph-codesystem-usage-context-type
related artifact:
  type:
    v: depends-on
  display:
    v: Code system JurisdictionsList
  resource:
    v: http://hl7.org/fhir/us/ecr/CodeSystem/codesystem-ersd-jurisdictions-example
    l: codesystem-ersd-jurisdictions-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Diagnosis Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-diagnosis-problem-triggers-example
    l: valueset-diagnosis-problem-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Medication Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-medications-triggers-example
    l: valueset-medications-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Laboratory Order Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-lab-order-test-triggers-example
    l: valueset-lab-order-test-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Laboratory Result Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-lab-obs-test-name-triggers-example
    l: valueset-lab-obs-test-name-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Organism Substance Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-organism-substance-triggers-example
    l: valueset-organism-substance-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Procedure Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-procedure-triggers-example
    l: valueset-procedure-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Suspected Disorder Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-suspected-disorder-triggers-example
    l: valueset-suspected-disorder-triggers-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Chlamydia Laboratory Result Trigger Codes
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-chlamydia-supplemental-example
    l: valueset-chlamydia-supplemental-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Indeterminate or Equivocal Lab Result Value
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/2.16.840.1.113762.1.4.1146.1035-example
    l: 2.16.840.1.113762.1.4.1146.1035-example
related artifact:
  type:
    v: depends-on
  display:
    v: Value set Negative or Undetected Lab Result Value
  resource:
    v: http://hl7.org/fhir/us/ecr/ValueSet/2.16.840.1.113762.1.4.1146.1034-example
    l: 2.16.840.1.113762.1.4.1146.1034-example
parameter:
  name:
    v: Triggering Encounter
  use:
    v: in
  min:
    v: 0
  max:
    v: 1
  type:
    v: Encounter
parameter:
  name:
    v: normalReportingDuration
  use:
    v: in

v: 0

v: 1

v: Quantity

name:
  v: Patient
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Patient

name:
  v: Chlamydia Test Results
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Observation

name:
  v: Triggering Encounters
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Encounter Location References
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Reference

name:
  v: Locations Matching Encounter Location References
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Location

name:
  v: Encounter Location Address
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Patient Address
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Jurisdictions
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Encounter Address Postal Code is in Jurisdiction Codes
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Encounter Address State is in Jurisdiction Codes
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Patient Address Postal Code is in Jurisdiction Codes
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Patient Address State is in Jurisdiction Codes
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Address Exists in Jurisdiction Codes
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Jurisdiction Codes Relevant to Encounter Addresses
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Jurisdiction Codes Relevant to Patient Addresses
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Indeterminate Chlamydia Test Results
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Observation

name:
  v: Negative Chlamydia Test Results
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Observation

name:
  v: Reportable Triggering Codes
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Coding

name:
  v: Encounter In Context
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Encounter

name:
  v: Is Encounter Within Normal Reporting Duration?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: eICR Compositions
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Composition

name:
  v: Existing Reportable Triggering Codes
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Coding

name:
  v: Is Encounter Reportable and Within Normal Reporting Duration?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Is Encounter Longer Than Normal Reporting Duration?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Is Encounter In Progress
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Is Encounter Complete
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Is Encounter In Progress and Within Normal Reporting Duration or 72h or less after end of encounter?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Most recent eICR
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: Composition

name:
  v: Most recent eICR sent over 72 hours ago?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

name:
  v: Suspected Disorder Test Results
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Observation

name:
  v: Suspected Disorders
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Resource

name:
  v: Is Suspected Disorder?
use:
  v: out
min:
  v: 0
max:
  v: 1
type:
  v: boolean

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient

type:
  v: Composition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Composition
  l: Composition
must support:
  v: type
code filter:
  path:
    v: type
  code: https://loinc.org/rdf/55751-2
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 55751-2

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: reference
must support:
  v: location

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient
must support:
  v: postalCode
must support:
  v: state
must support:
  v: state.value

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: reference
must support:
  v: location

type:
  v: Location
profile:
  v: http://hl7.org/fhir/StructureDefinition/Location
  l: Location
must support:
  v: address.postalCode
must support:
  v: address
must support:
  v: address.state
must support:
  v: postalCode
must support:
  v: state
must support:
  v: id

type:
  v: CodeSystem
profile:
  v: http://hl7.org/fhir/StructureDefinition/CodeSystem
  l: CodeSystem
must support:
  v: jurisdictionType
must support:
  v: postalCode
must support:
  v: concept
must support:
  v: stateCode

type:
  v: Organization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Organization
  l: Organization

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: interpretation
must support:
  v: value
must support:
  v: status
code filter:
  path:
    v: code
  value set:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-chlamydia-supplemental-example
    l: valueset-chlamydia-supplemental-example

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: value
must support:
  v: status

type:
  v: Location
profile:
  v: http://hl7.org/fhir/StructureDefinition/Location
  l: Location
must support:
  v: address.postalCode
must support:
  v: address
must support:
  v: address.state
must support:
  v: postalCode
must support:
  v: state
must support:
  v: id

type:
  v: CodeSystem
profile:
  v: http://hl7.org/fhir/StructureDefinition/CodeSystem
  l: CodeSystem
must support:
  v: jurisdictionType
must support:
  v: postalCode
must support:
  v: concept
must support:
  v: stateCode

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient
must support:
  v: postalCode
must support:
  v: state
must support:
  v: state.value

type:
  v: CodeSystem
profile:
  v: http://hl7.org/fhir/StructureDefinition/CodeSystem
  l: CodeSystem
must support:
  v: jurisdictionType
must support:
  v: postalCode
must support:
  v: concept
must support:
  v: stateCode

type:
  v: Patient
profile:
  v: http://hl7.org/fhir/StructureDefinition/Patient
  l: Patient
must support:
  v: postalCode
must support:
  v: state
must support:
  v: state.value

type:
  v: CodeSystem
profile:
  v: http://hl7.org/fhir/StructureDefinition/CodeSystem
  l: CodeSystem
must support:
  v: jurisdictionType
must support:
  v: postalCode
must support:
  v: concept
must support:
  v: stateCode

type:
  v: Condition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Condition
  l: Condition
must support:
  v: code
code filter:
  path:
    v: code
  value set:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-suspected-disorder-triggers-example
    l: valueset-suspected-disorder-triggers-example

type:
  v: MedicationRequest
profile:
  v: http://hl7.org/fhir/StructureDefinition/MedicationRequest
  l: MedicationRequest
must support:
  v: medication
code filter:
  path:
    v: medication
  value set:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-medications-triggers-example
    l: valueset-medications-triggers-example

type:
  v: Composition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Composition
  l: Composition
must support:
  v: type
code filter:
  path:
    v: type
  code: https://loinc.org/rdf/55751-2
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 55751-2

type:
  v: Composition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Composition
  l: Composition
must support:
  v: section
must support:
  v: type
code filter:
  path:
    v: type
  code: https://loinc.org/rdf/55751-2
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 55751-2

type:
  v: Location
profile:
  v: http://hl7.org/fhir/StructureDefinition/Location
  l: Location
must support:
  v: address.postalCode
must support:
  v: address
must support:
  v: address.state
must support:
  v: postalCode
must support:
  v: state
must support:
  v: id

type:
  v: Organization
profile:
  v: http://hl7.org/fhir/StructureDefinition/Organization
  l: Organization

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: interpretation
must support:
  v: value
must support:
  v: status
code filter:
  path:
    v: code
  value set:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-chlamydia-supplemental-example
    l: valueset-chlamydia-supplemental-example

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: period
must support:
  v: end

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: period
must support:
  v: end

type:
  v: Location
profile:
  v: http://hl7.org/fhir/StructureDefinition/Location
  l: Location
must support:
  v: address.postalCode
must support:
  v: address
must support:
  v: address.state
must support:
  v: postalCode
must support:
  v: state
must support:
  v: id

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter

type:
  v: CodeSystem
profile:
  v: http://hl7.org/fhir/StructureDefinition/CodeSystem
  l: CodeSystem
must support:
  v: jurisdictionType
must support:
  v: postalCode
must support:
  v: concept
must support:
  v: stateCode

type:
  v: Observation
profile:
  v: http://hl7.org/fhir/StructureDefinition/Observation
  l: Observation
must support:
  v: code
must support:
  v: interpretation
must support:
  v: value
must support:
  v: status
code filter:
  path:
    v: code
  value set:
    v: http://hl7.org/fhir/us/ecr/ValueSet/valueset-chlamydia-supplemental-example
    l: valueset-chlamydia-supplemental-example

content type:
  v: text/cql

content type:
  v: application/elm+json