Atrius India Core FHIR Implementation Guide
0.1.0 - ci-build

Atrius India Core FHIR Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Library: Atrius ED Acute Breathlessness Pathway CQL (Experimental)

Official URL: https://atrius.in/fhir/r4/atrius-in/Library/AtriusEDAcuteBreathlessness Version: 0.1.0
Draft as of 2026-07-24 Computable Name: AtriusEDAcuteBreathlessness
Other Identifiers: OID:1.3.6.1.4.1.66219.1.28.23

Applicability, danger-sign gate, and etiology classification logic for the ED acute breathlessness clinical pathway.

Metadata
Title Atrius ED Acute Breathlessness Pathway CQL
Version 0.1.0
Identifier urn:oid:1.3.6.1.4.1.66219.1.28.23
Status Draft
Experimental true
Steward (Publisher) Atrius
Steward Contact Atrius
Description

Applicability, danger-sign gate, and etiology classification logic for the ED acute breathlessness clinical pathway.

Type Logic Library
Dependency Description: Model AtriusIn
Resource: Atrius India Core Model Definition version: 0.1.0
Canonical URL: https://atrius.in/fhir/r4/atrius-in/Library/AtriusIn-ModelInfo|0.1.0
Dependency Description: Library FHIRHelpers
Resource: https://atrius.in/fhir/r4/atrius-in/Library/FHIRHelpers|4.4.000
Canonical URL: https://atrius.in/fhir/r4/atrius-in/Library/FHIRHelpers|4.4.000
Dependency Description: Library AtriusCommon
Resource: Atrius Common CQL version: 0.1.0
Canonical URL: https://atrius.in/fhir/r4/atrius-in/Library/AtriusCommon|0.1.0
Dependency Description: Code System LOINC
Resource: Logical Observation Identifiers, Names and Codes (LOINC)
Canonical URL: http://loinc.org
Dependency Description: Code System SNOMEDCT
Resource: SNOMED CT (all versions)
Canonical URL: http://snomed.info/sct
Dependency Description: Code System ActCode
Resource: ActCode version: 10.0.0
Canonical URL: http://terminology.hl7.org/CodeSystem/v3-ActCode|10.0.0
Dependency Description: Code System AtriusReasonForEncounter
Resource: Atrius India Core Reason for Encounter (CodeSystem) version: 0.1.0
Canonical URL: https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-reason-for-encounter-cs|0.1.0
Dependency Description: Code System AtriusERAcuteBreathlessnessClassification
Resource: Atrius ER Acute Breathlessness Working Classification (CodeSystem) version: 0.1.0
Canonical URL: https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-er-acute-breathlessness-classification-cs|0.1.0
Dependency Description: Code System AtriusERAcuteBreathlessnessDangerSigns
Resource: Atrius ER Acute Breathlessness Danger Signs (CodeSystem) version: 0.1.0
Canonical URL: https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-er-acute-breathlessness-danger-signs-cs|0.1.0
Data Requirement Type: Encounter
Profile(s): Encounter version: 4.0.1
Data Requirement Type: Condition
Profile(s): Atrius India Core Condition Encounter Diagnosis version: 0.1.0
Data Requirement Type: Condition
Profile(s): Atrius India Core Condition Problems Health Concerns version: 0.1.0
Data Requirement Type: QuestionnaireResponse
Profile(s): QuestionnaireResponse version: 4.0.1
Parameters
Name Use Card. Type Documentation
Danger Signs Questionnaire Url Out 0..1 string
Classification Questionnaire Url Out 0..1 string
Active Emergency Encounter Out 0..* Encounter
Encounter With Dyspnea Chief Complaint Out 0..* Encounter
In Scope Out 0..1 boolean
Danger Signs Questionnaire Responses Out 0..* QuestionnaireResponse
Latest Danger Signs Response Out 0..1 QuestionnaireResponse
Airway Endangered Out 0..1 boolean
Classification Questionnaire Responses Out 0..* QuestionnaireResponse
Latest Classification Response Out 0..1 QuestionnaireResponse
Has Classification Response Out 0..1 boolean
Classification Is Cardiogenic Pulmonary Edema Out 0..1 boolean
Classification Is COPD Asthma Exacerbation Out 0..1 boolean
Classification Is Pulmonary Embolism Out 0..1 boolean
Classification Is Pneumonia Out 0..1 boolean
Classification Is Pneumothorax Out 0..1 boolean
Classification Is Upper Airway Obstruction Out 0..1 boolean
Classification Is Other Unclear Out 0..1 boolean
Library Content
CQL Content
/*
  ED acute breathlessness clinical pathway — applicability, danger signs, and etiology branching.

  v0.1.4: Classification answers are SNOMED CT (open-choice / typeahead); CQL maps curated
         concepts to branches; non-curated SNOMED → Other. Legacy Atrius local codes still match.
  v0.1.3: Danger signs as multi-choice + none-of-the-above (RSI only when a real danger sign is selected).
  v0.1.2: Also match SNOMED dyspnea on Encounter.reasonCode (parity with chest-pain chief complaint).
  v0.1.1: Fix Airway Endangered — do not apply Exists to First() singleton QuestionnaireResponse.
  v0.1: Danger-sign QuestionnaireResponse gate, parallel stabilization scaffold,
  working etiology classification from Questionnaire/er-acute-breathlessness-classification.
*/
library AtriusEDAcuteBreathlessness version '0.1.4'

using FHIR version '4.0.1'
using AtriusIn version '0.1.0'

include FHIRHelpers version '4.4.000' called FHIRHelpers
include AtriusCommon version '0.1.0'

codesystem "LOINC": 'http://loinc.org'
codesystem "SNOMEDCT": 'http://snomed.info/sct'
codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
codesystem "AtriusReasonForEncounter": 'https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-reason-for-encounter-cs'
codesystem "AtriusERAcuteBreathlessnessClassification": 'https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-er-acute-breathlessness-classification-cs'
codesystem "AtriusERAcuteBreathlessnessDangerSigns": 'https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-er-acute-breathlessness-danger-signs-cs'

code "Dyspnea complaint": 'dyspnea' from "AtriusReasonForEncounter" display 'Dyspnea'
code "Dyspnea": '267036007' from "SNOMEDCT" display 'Dyspnea'
code "emergency": 'EMER' from "ActCode" display 'emergency'

// SNOMED working etiologies (preferred)
code "Acute CHF": '10633002' from "SNOMEDCT" display 'Acute congestive heart failure'
code "Acute left HF": '19242006' from "SNOMEDCT" display 'Acute left-sided heart failure'
code "Heart failure": '84114007' from "SNOMEDCT" display 'Heart failure'
code "Acute pulmonary edema": '410431009' from "SNOMEDCT" display 'Acute pulmonary edema'
code "COPD": '13645005' from "SNOMEDCT" display 'Chronic obstructive lung disease'
code "Asthma": '195967001' from "SNOMEDCT" display 'Asthma'
code "Asthma exacerbation": '281239006' from "SNOMEDCT" display 'Exacerbation of asthma'
code "COPD exacerbation": '195951007' from "SNOMEDCT" display 'Acute exacerbation of chronic obstructive airways disease'
code "Pulmonary embolism SCT": '59282003' from "SNOMEDCT" display 'Pulmonary embolism'
code "Pneumonia SCT": '233604007' from "SNOMEDCT" display 'Pneumonia'
code "Pneumothorax SCT": '36118008' from "SNOMEDCT" display 'Pneumothorax'
code "Respiratory obstruction": '79688008' from "SNOMEDCT" display 'Respiratory obstruction'
code "Unknown SCT": '261665006' from "SNOMEDCT" display 'Unknown'

// Legacy Atrius local classification codes
code "Cardiogenic classification": 'cardiogenic-pulmonary-edema' from "AtriusERAcuteBreathlessnessClassification" display 'Cardiogenic pulmonary edema / acute HF'
code "COPD asthma classification": 'copd-asthma-exacerbation' from "AtriusERAcuteBreathlessnessClassification" display 'COPD / asthma exacerbation'
code "PE classification": 'pulmonary-embolism' from "AtriusERAcuteBreathlessnessClassification" display 'Pulmonary embolism'
code "Pneumonia classification": 'pneumonia' from "AtriusERAcuteBreathlessnessClassification" display 'Pneumonia / infection'
code "Pneumothorax classification": 'pneumothorax' from "AtriusERAcuteBreathlessnessClassification" display 'Pneumothorax'
code "Upper airway classification": 'upper-airway-obstruction' from "AtriusERAcuteBreathlessnessClassification" display 'Upper airway obstruction'
code "Other classification": 'other-unclear' from "AtriusERAcuteBreathlessnessClassification" display 'Other / unclear'

code "Danger altered consciousness": 'altered-consciousness' from "AtriusERAcuteBreathlessnessDangerSigns" display 'Altered consciousness'
code "Danger exhausting breathing": 'exhausting-breathing' from "AtriusERAcuteBreathlessnessDangerSigns" display 'Exhausting breathing'
code "Danger silent chest": 'silent-chest' from "AtriusERAcuteBreathlessnessDangerSigns" display 'Silent chest'
code "Danger refractory hypoxemia": 'refractory-hypoxemia' from "AtriusERAcuteBreathlessnessDangerSigns" display 'Refractory hypoxemia'
code "Danger hemodynamic instability": 'hemodynamic-instability' from "AtriusERAcuteBreathlessnessDangerSigns" display 'Hemodynamic instability'
code "Danger airway unprotected": 'airway-unprotected' from "AtriusERAcuteBreathlessnessDangerSigns" display 'Unprotected airway'
code "Danger none": 'none' from "AtriusERAcuteBreathlessnessDangerSigns" display 'None of the above'

define "Danger Signs Questionnaire Url":
  'https://atrius.in/fhir/r4/atrius-in/Questionnaire/er-acute-breathlessness-danger-signs'

define "Classification Questionnaire Url":
  'https://atrius.in/fhir/r4/atrius-in/Questionnaire/er-acute-breathlessness-classification'

define fluent function hasDangerSignAnswer(qr QuestionnaireResponse, answer Code):
  exists (
    qr.item I
      where I.linkId = 'danger-signs'
        and exists (
          I.answer A
            where FHIRHelpers.ToCode(A.value as Coding) ~ answer
        )
  )

define fluent function breathlessnessClassificationAnswer(qr QuestionnaireResponse):
  singleton from (
    qr.item I
      where I.linkId = 'primary-classification'
      return First(I.answer A return FHIRHelpers.ToCode(A.value as Coding))
  )

define fluent function hasBreathlessnessClassificationAnswer(qr QuestionnaireResponse, answer Code):
  qr.breathlessnessClassificationAnswer() ~ answer

define "Active Emergency Encounter":
  [Encounter] E
    where E.status in { 'arrived', 'triaged', 'in-progress' }
      and E.class ~ "emergency"

define "Encounter With Dyspnea Chief Complaint":
  "Active Emergency Encounter" E
    where exists (
      E.reasonCode R
        where R ~ "Dyspnea complaint"
          or R ~ "Dyspnea"
    )
      or exists (
        E.reasonReference RR
          where exists (
            ([ConditionEncounterDiagnosis] union [ConditionProblemsHealthConcerns]) C
              where RR.references(C.id)
                and C.code ~ "Dyspnea"
                and C.isActive()
          )
      )

define "In Scope":
  exists "Encounter With Dyspnea Chief Complaint"

define "Danger Signs Questionnaire Responses":
  [QuestionnaireResponse] QR
    where QR.status = 'completed'
      and exists (
        QR.item I
          where I.linkId = 'danger-signs'
            and exists I.answer
      )
      and exists (
        "Encounter With Dyspnea Chief Complaint" E
          where QR.encounter.references(E)
      )

define "Latest Danger Signs Response":
  First(
    "Danger Signs Questionnaire Responses" QR
      where QR.authored is not null
        and not exists (
          "Danger Signs Questionnaire Responses" LaterQR
            where LaterQR.encounter = QR.encounter
              and LaterQR.authored.value after QR.authored.value
        )
  )

// Any real danger sign activates airway rescue / RSI. "None of the above" alone does not.
define "Airway Endangered":
  "Latest Danger Signs Response" is not null
    and (
      "Latest Danger Signs Response".hasDangerSignAnswer("Danger altered consciousness")
        or "Latest Danger Signs Response".hasDangerSignAnswer("Danger exhausting breathing")
        or "Latest Danger Signs Response".hasDangerSignAnswer("Danger silent chest")
        or "Latest Danger Signs Response".hasDangerSignAnswer("Danger refractory hypoxemia")
        or "Latest Danger Signs Response".hasDangerSignAnswer("Danger hemodynamic instability")
        or "Latest Danger Signs Response".hasDangerSignAnswer("Danger airway unprotected")
    )

define "Classification Questionnaire Responses":
  [QuestionnaireResponse] QR
    where QR.status = 'completed'
      and exists (
        QR.item I
          where I.linkId = 'primary-classification'
            and exists I.answer
      )
      and exists (
        "Encounter With Dyspnea Chief Complaint" E
          where QR.encounter.references(E)
      )

define "Latest Classification Response":
  First(
    "Classification Questionnaire Responses" QR
      where QR.authored is not null
        and not exists (
          "Classification Questionnaire Responses" LaterQR
            where LaterQR.encounter = QR.encounter
              and LaterQR.authored.value after QR.authored.value
        )
  )

define "Has Classification Response":
  exists "Classification Questionnaire Responses"

define "Classification Is Cardiogenic Pulmonary Edema":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("Acute CHF")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Acute left HF")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Heart failure")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Acute pulmonary edema")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Cardiogenic classification")
    )

define "Classification Is COPD Asthma Exacerbation":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("COPD")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Asthma")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Asthma exacerbation")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("COPD exacerbation")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("COPD asthma classification")
    )

define "Classification Is Pulmonary Embolism":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("Pulmonary embolism SCT")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("PE classification")
    )

define "Classification Is Pneumonia":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("Pneumonia SCT")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Pneumonia classification")
    )

define "Classification Is Pneumothorax":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("Pneumothorax SCT")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Pneumothorax classification")
    )

define "Classification Is Upper Airway Obstruction":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("Respiratory obstruction")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Upper airway classification")
    )

// Explicit Unknown / legacy other, or any other SNOMED concept from typeahead.
define "Classification Is Other Unclear":
  "Has Classification Response"
    and (
      "Latest Classification Response".hasBreathlessnessClassificationAnswer("Unknown SCT")
        or "Latest Classification Response".hasBreathlessnessClassificationAnswer("Other classification")
        or (
          not "Classification Is Cardiogenic Pulmonary Edema"
            and not "Classification Is COPD Asthma Exacerbation"
            and not "Classification Is Pulmonary Embolism"
            and not "Classification Is Pneumonia"
            and not "Classification Is Pneumothorax"
            and not "Classification Is Upper Airway Obstruction"
        )
    )
ELM JSON Content
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates