Maps an active admission to the TriggerData evaluation payload. Shared by the sync jobbable
and the Check Triggers dry-run so both evaluate identically.
"Current" = latest by start date: a patient has one UR LOC and is in one program at a time,
so the newest review / newest ongoing stay wins.
projectedDischargeDate comes from the episode (the authoritative source going forward), not
the admission — patient_admissions has no projected_discharge_date column at all.
Maps an active admission to the
TriggerDataevaluation payload. Shared by the sync jobbable and the Check Triggers dry-run so both evaluate identically."Current" = latest by start date: a patient has one UR LOC and is in one program at a time, so the newest review / newest ongoing stay wins.
projectedDischargeDatecomes from the episode (the authoritative source going forward), not the admission —patient_admissionshas noprojected_discharge_datecolumn at all.