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

Cds Clinical Reasoning

CDS and clinical reasoning artifacts

How Library, Measure, and PlanDefinition resources are authored in this IG and published to the knowledge repository (KR) for CDS Hooks $apply.

See also: repository docs docs/authoring-plan.md, docs/activity-definition-catalog-authoring.md, and docs/clinical-reasoning-stack.md.


Artifact roles

Resource Authoring location KR role
Library input/cql/{Name}.cql + flat input/resources/Library-*.json stubs CQL + ELM; sidecar evaluation
Measure input/fsh/clinical-reasoning/measures/{slug}/measure.fsh Population metadata; links to Library
PlanDefinition input/fsh/clinical-reasoning/measures/{slug}/plandefinition.fsh CDS Hooks service; hook, prefetch, CQL condition
ActivityDefinition input/fsh/clinical-reasoning/measures/{slug}/activities/*.fsh or catalogs/ Recommendation actions; reusable catalog — see docs/activity-definition-catalog-authoring.md

Libraries use the ig-loader pattern (JSON stub → translate → embedded ELM). Measures and PlanDefinitions are FSH Instances with Usage: #example.


Directory layout (measure bundles)

Clinical reasoning artifacts are grouped by measure slug (cms165 for the pilot) under input/fsh/clinical-reasoning/. All CQL libraries live flat in input/cql/.

input/
├── fsh/clinical-reasoning/
│   └── measures/cms165/
│       ├── measure.fsh
│       ├── plandefinition.fsh
│       └── activities/          ← ActivityDefinition instances
├── cql/
│   ├── {Name}.cql               ← all libraries (AtriusCommon, AtriusCMS165…, AtriusERChestPain…)
│   ├── atriusin-modelinfo-0.1.0.xml   (CQL translation; also embedded in Library/AtriusIn-ModelInfo)
│   ├── FHIRHelpers-4.4.0.cql
│   └── reference/               ← optional reference CQL/modelinfo
└── resources/
    ├── Library-*.json           ← flat Library stubs (IG Publisher + SUSHI)
    └── modelinfo/

For a new measure or pathway, copy the measures/cms165/ or pathways/er-chest-pain/ folder pattern under fsh/, add CQL as input/cql/{LibraryName}.cql, add a flat input/resources/Library-{Name}.json stub, then register artifacts in sushi-config.yaml.


CDSHooksServicePlanDefinition (required elements)

Profile: CDSHooksServicePlanDefinition

Full hook / service / prefetch authoring plan: repository docs/cds-hooks-service-authoring.md (FHIR Clinical Reasoning §14.5.2 mapping).

CDS Hooks concept PlanDefinition element
Service id identifier.value and last segment of url
Hook (patient-view, …) action.trigger (named-event)
Prefetch action.input (DataRequirement with type + profile) — minimal set only
CQL logic library canonical + action.condition (text/cql)
Invoke URL (optional) Extension cqf-cdsHooksEndpoint

Type: clinical-protocol / order-set / eca-rule / workflow-definition as appropriate (see docs/cds-hooks-service-authoring.md §3.1.1). Exemplars: HF + ER chest pain (clinical-protocol), sepsis (order-set), critical-labs / surgical gate (eca-rule), surgical checklist phases (workflow-definition).

Prefetch: Use Atrius India Core profile URLs in action.input.profile (not generic QI-Core). Author only types the Library retrieves. Discovery must not silently widen to a full chart pack (see authoring plan Phase 1).


Pilot: CMS165

Artifact Id
Library AtriusCMS165ControllingHighBP v0.1.0
Measure AtriusCMS165ControllingHighBP v0.1.0
PlanDefinition (CDS service id) atriuscms165controllinghighbp v0.1.0

Canonical base: https://atrius.in/fhir/r4/atrius-in/


Build and publish

# 1. Libraries: translate CQL → ELM
./scripts/generate-modelinfo.sh   # after profile changes
./scripts/translate-cql.sh

# 2. Full IG (FSH → Measure + PlanDefinition in output/)
# sushi && ./_build.sh   # or publisher -ig .

# 3. KR import (8079)
./scripts/import-atrius-kr-libraries.py --clinical-reasoning

# 4. Regenerate CDS manifest from KR PlanDefinitions (atrius-hfs repo)
python3 scripts/generate-cds-hooks-manifest.py --from-plandefinition \
  --kr-base-url http://127.0.0.1:8079 \
  --output manifests/cds-services-kr-ecqm.json

# 5. Sidecar cache flush after KR update
curl -s -X POST http://127.0.0.1:8088/v1/admin/cache/libraries/clear \
  -H "Authorization: Bearer $SIDECAR_ADMIN_TOKEN"

Synthesized vs authored PlanDefinitions

  Synthesized (atrius-hfs generator) Authored (this IG)
Purpose Infra smoke, bulk eCQM Production CDS catalog
Prefetch Generic patient chart Measure-specific Atrius profiles
Canonical URL https://atrius.org/PlanDefinition/... https://atrius.in/fhir/r4/atrius-in/PlanDefinition/...
Lifecycle Regenerate from KR Libraries Versioned IG release + import

Replace synthesized twins per measure when authored PlanDefinitions pass smoke and /ready probes.