Skip to content

Add encounter_status to clinical encounter input layer and core (#775)#1359

Open
gopihc wants to merge 2 commits into
tuva-health:mainfrom
gopihc:issue-775-encounter-status
Open

Add encounter_status to clinical encounter input layer and core (#775)#1359
gopihc wants to merge 2 commits into
tuva-health:mainfrom
gopihc:issue-775-encounter-status

Conversation

@gopihc

@gopihc gopihc commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Adds an optional encounter_status field to the clinical encounter data model so downstream analytics can distinguish completed encounters from in-progress or unsigned/not-yet-completed documentation, instead of relying on connectors to drop incomplete encounters from the input layer.

  • Adds encounter_status to the input_layer__encounter contract, aligned with the FHIR Encounter.status value set (planned, arrived, in-progress, onleave, finished, cancelled, entered-in-error).
  • Surfaces encounter_status on core.encounter, populated from clinical (EHR) sources and null for claims-derived encounters, which have no clinical lifecycle status.
  • Exposes the field in the integration_tests clinical encounter input model so the core clinical staging model compiles and builds.

The change is purely additive and nullable: no existing columns change, core.encounter has no enforced contract, and downstream marts select explicit columns, so they are unaffected.

Validation

Local DuckDB with synthetic data (small):

  • Rebuilt the full core.encounter lineage (claims + clinical enabled): 229 models, 0 errors.
  • Confirmed encounter_status is present on core.encounter and that the claims/clinical smart_union builds correctly (claims-derived rows null as expected).
  • input_layer__encounter tests pass, including the new column-exists and null-percentage checks.

Release note

enhancement

Closes #775

…-health#775)

Adds an optional encounter_status field to the clinical encounter input
layer contract, aligned with the FHIR Encounter.status value set, and
surfaces it on core.encounter. This lets downstream analytics distinguish
completed encounters from in-progress or unsigned documentation instead of
relying on connectors to drop incomplete encounters from the input layer.

The column is additive and nullable: clinical encounters carry the source
status; claims-derived encounters are null since they have no clinical
lifecycle status. No existing columns change, so downstream marts are
unaffected.
…uva-health#775)

The clinical encounter input model used for integration testing declares its
columns explicitly, so it must surface the new encounter_status field for the
core clinical encounter staging model to compile and build against synthetic
data.
@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy Preview for thetuvaproject canceled.

Name Link
🔨 Latest commit d9ed43f
🔍 Latest deploy log https://app.netlify.com/projects/thetuvaproject/deploys/6a4734c7d693f900081df167

@chase-jones chase-jones added the breaking-change Changes have been made that may cause other components to fail label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes have been made that may cause other components to fail

Projects

Status: 👀 Ready for Review

Development

Successfully merging this pull request may close these issues.

Consider adding an encounter-level status to facilitate better clinical encounter filtering downstream

3 participants