Circle V2 API Docs
    Preparing search index...

    Function fetchAndFormatEmrDocuments

    • Fetches full documents by id from patient_charts and formats each into its own section.

      Renders nothing when the count exceeds MAX_FULL_EMR_DOCUMENTS, to avoid blowing up the context window.

      Parameters

      • options: {
            documentIds: string[];
            facilityTimeZone?: string | null;
            patient: Pick<
                PatientRow,
                "patient_id"
                | "entity_id"
                | "first_name"
                | "last_name",
            >;
            supabase: SupabaseClient<Database>;
        }
        • documentIds: string[]
        • OptionalfacilityTimeZone?: string | null

          Facility-local zone used to interpret the documents' timezone-naive timestamps. Without it they are read in the server's zone, which shifts them by hours.

        • patient: Pick<PatientRow, "patient_id" | "entity_id" | "first_name" | "last_name">
        • supabase: SupabaseClient<Database>

      Returns Promise<EmrDocumentInjection>