Circle V2 API Docs
    Preparing search index...
    • 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.

      Episode facts come from episode, not the admission: patient_admissions has no projected_discharge_date column at all, and a stay can carry no level while the episode has one. A nil clinical level makes matchesCurrentValueFilters reject the trigger outright, so without that fallback a clinical-LOC-filtered trigger never fires for those patients.

      Parameters

      • admission: {
            admitted_at: string;
            discharged_at: string | null;
            entity_id: number & { __brand: "EntityId" } | null;
            external_admission_id: string | null;
            facility_id: string & { __brand: "FacilityId" } | null;
            id: PatientAdmissionId;
            integration_id: string | null;
            level_of_care_id: number | null;
            ongoing_program_stays: {
                facility_level_of_care_id:
                    | string & { __brand: "FacilityLevelOfCareId" }
                    | null;
                facility_program_id: string & { __brand: "FacilityProgramId" } | null;
                id: ProgramStayId;
                start_date: string;
            }[];
            patient_id: string & { __brand: "PatientId" }
            | null;
            utilization_reviews: {
                end_date: string | null;
                facility_level_of_care_id:
                    | string & { __brand: "FacilityLevelOfCareId" }
                    | null;
                id: PatientUtilizationReviewId;
                start_date: string | null;
            }[];
        }
      • episode: TriggerEpisodeContext

      Returns TriggerData