Electronic Case Reporting (eCR)
3.0.0-ballot - STU 3 Ballot United States of America flag

Electronic Case Reporting (eCR), published by HL7 International / Public Health. This guide is not an authorized publication; it is the continuous build for version 3.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/case-reporting/ and changes regularly. See the Directory of published versions

Library: Executable Rule Filters Example Library (Experimental)

Official URL: http://hl7.org/fhir/us/ecr/Library/library-executable-rule-filters-example Version: 3.0.0-ballot
Standards status: Informative Computable Name: LibraryExecutableRuleFilters
Other Identifiers: OID:2.16.840.1.113883.4.642.40.46.28.3

An example logic library for eRSD - Chlamydia example.

Exception generating Narrative: Unable to Parse HTML - node 'code' has unexpected content '=' (last text = 'library RuleFilters version '2.1.0' using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' codesystem "LOINC": 'http://loinc.org' codesystem "UsageContext": 'http://hl7.org/fhir/us/ecr/CodeSystem/us-ph-usage-context-type' codesystem "JurisdictionsList": 'http://hl7.org/fhir/us/ecr/CodeSystem/ersd-jurisdictions-example' // Overall triggering value sets, groupings of all condition-specific value sets, grouped by representation in the information model valueset "Diagnosis Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-dxtc-example' valueset "Medication Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-mrtc-example' valueset "Laboratory Order Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-lotc-example' valueset "Laboratory Result Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-lrtc-example' valueset "Organism Substance Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-ostc-example' valueset "Procedure Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-pctc-example' valueset "Suspected Disorder Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-sdtc-example' // Condition-specific triggering codes, these would be listed for each condition valueset "Chlamydia Laboratory Result Trigger Codes": 'http://hl7.org/fhir/us/ecr/ValueSet/valueset-chlamydia-example' // Supplemental (or operational) value sets used in suspected reportability determination logic valueset "Indeterminate or Equivocal Lab Result Value": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1035' valueset "Negative or Undetected Lab Result Value": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1034' code "eICRComposition": '55751-2' from "LOINC" parameter "Triggering Encounter" Encounter parameter "normalReportingDuration" default 14 days context Patient define "Chlamydia Test Results": [Observation: "Chlamydia Laboratory Result Trigger Codes"] O where O.status in { 'registered', 'preliminary', 'final', 'amended', 'corrected' } define "Triggering Encounters": [Encounter] E define "Encounter Location References": flatten("Triggering Encounters" TriggeringEncounter return TriggeringEncounter.location.location) define "Locations Matching Encounter Location References": [Location] Location where exists ( "Encounter Location References" LocationReference where ('Location/' + Location.id) ~ LocationReference.reference ) define "Encounter Location Address": "Locations Matching Encounter Location References" Address return Tuple { state: Address.address.state, postalCode: Address.address.postalCode } define "Patient Address": Patient.address PA return Tuple { state: PA.state, postalCode: PA.postalCode } define "Jurisdictions": flatten([CodeSystem] C return C.concept Cpt return Tuple { jurisdictionCode: Cpt.code, definition: Cpt.definition, jurisdictionType: Cpt.property P where P.code='type' return P.value as FHIR.string, stateCode: Cpt.property P where P.code = 'state' return P.value as FHIR.code, postalCode: Cpt.property P where P.code = 'postalcode' return P.value as FHIR.code }) define "Encounter Address Postal Code is in Jurisdiction Codes": "Jurisdictions" J with "Encounter Location Address" LocationAddress such that LocationAddress.postalCode in J.postalCode define "Encounter Address State is in Jurisdiction Codes": "Jurisdictions" J with "Encounter Location Address" LocationAddress such that LocationAddress.state in J.stateCode and 'STATE' in J.jurisdictionType define "Patient Address Postal Code is in Jurisdiction Codes": "Jurisdictions" J with "Patient Address" PA such that PA.postalCode in J.postalCode define "Patient Address State is in Jurisdiction Codes": "Jurisdictions" J with "Patient Address" PA such that (PA.state.value in J.stateCode and 'STATE' in J.jurisdictionType) define "Address Exists in Jurisdiction Codes": exists ( "Encounter Address State is in Jurisdiction Codes" union "Encounter Address Postal Code is in Jurisdiction Codes" union "Patient Address State is in Jurisdiction Codes" union "Patient Address Postal Code is in Jurisdiction Codes" ) define function EncounterAddressJurisdictions(): if exists ("Encounter Address Postal Code is in Jurisdiction Codes") then "Encounter Address Postal Code is in Jurisdiction Codes" else "Encounter Address State is in Jurisdiction Codes" define function PatientAddressJurisdictions(): if exists ("Patient Address Postal Code is in Jurisdiction Codes") then "Patient Address Postal Code is in Jurisdiction Codes" else "Patient Address State is in Jurisdiction Codes" define "Jurisdiction Codes Relevant to Encounter Addresses": EncounterAddressJurisdictions() define "Jurisdiction Codes Relevant to Patient Addresses": PatientAddressJurisdictions() define "Indeterminate Chlamydia Test Results": "Chlamydia Test Results" O let organization: [Organization] where ( ( exists ( O.interpretation interpretationConcept where interpretationConcept as CodeableConcept in "Indeterminate or Equivocal Lab Result Value" ) or O.value as CodeableConcept in "Indeterminate or Equivocal Lab Result Value" ) and "Address Exists in Jurisdiction Codes" ) define "Negative Chlamydia Test Results": "Chlamydia Test Results" O let organization: [Organization] where ( ( exists ( O.interpretation interpretationConcept where interpretationConcept as CodeableConcept in "Negative or Undetected Lab Result Value" ) or O.value as CodeableConcept in "Negative or Undetected Lab Result Value" ) and "Address Exists in Jurisdiction Codes" ) define "Reportable Triggering Codes": flatten ("Indeterminate Chlamydia Test Results" O return O.code.coding) union flatten ("Negative Chlamydia Test Results" O return O.code.coding) // ... reportable triggering codes for other conditions define "Is Encounter Within Normal Reporting Duration?": "Current Encounter Duration"("Encounter In Context") ' at line 1448 column 57