Circle V2 API Docs
    Preparing search index...
    facilityLedger: QueryProcedure<
        {
            input: { facilityId: string; facilityProgramId?: string } & {
                from: string;
                to: string;
            };
            meta: object;
            output: {
                canSeePayer: boolean;
                facility: { id: FacilityId; name: string; timezone: string
                | null };
                freshness: {
                    asOf: DbDate;
                    currentThrough: DbDate | null;
                    lastSyncedAt: string | null;
                };
                programs: { id: FacilityProgramId; name: string }[];
                rows: {
                    absences: number;
                    admittedAt: DbDate | null;
                    attendedDays: number;
                    attendedHours: number;
                    authDays: number | null;
                    authEnd: DbDate | null;
                    authStart: DbDate | null;
                    authUsed: number | null;
                    displayName: string;
                    documentedServices: number;
                    levelOfCare: string | null;
                    overlaps: number;
                    patientId: PatientId;
                    payer: string | null;
                    program: string | null;
                    treatmentEpisodeId: TreatmentEpisodeId | null;
                }[];
                serviceTypes: {
                    attendedDays: number;
                    attendedHours: number;
                    averageAttendedMinutes: number
                    | null;
                    clinicians: number;
                    instances: number;
                    instancesWithWindow: number;
                    name: string;
                    patients: number;
                    serviceType: UtilizationServiceType;
                }[];
            };
        },
    > = ...

    One facility's Utilization ledger over the range: rows by patient, the same totals by service type, and the facility's programs for the level-of-care picker. facilityProgramId keeps only sessions held while the patient was in that program. The facility comes from the access middleware, so the name and zone the page shows are the ones the totals were computed in.