Circle V2 API Docs
    Preparing search index...

    Function buildChartSummaryTables

    • Group charts by document type and render one markdown summary table per type via EMRDocumentFormatter.createSummaryTable. Returns a single string with all tables separated by ---.

      Ordering is deterministic (types alphabetical, rows sorted by id) so the rendered string is byte-identical across calls for the same chart set — required for OpenAI automatic prompt caching to hit across the questions of a review run. The model does not care about order.

      Parameters

      • charts: {
            circle_metadata: Json;
            created_at: string;
            created_by: string | null;
            embedding_count: number | null;
            embedding_err_msg: string | null;
            embedding_status:
                | "processing"
                | "failed"
                | "pending"
                | "parse"
                | "extract"
                | "completed"
                | null;
            entity_id: number
            | null;
            external_document_created_at: string | null;
            external_document_id: string | null;
            external_document_type:
                | "kipu_evaluation"
                | "kipu_consent_form"
                | "kipu_ciwa_ar"
                | "kipu_ciwa_b"
                | "kipu_group_session"
                | "lightningstep_formdata"
                | "lightningstep_txplan"
                | "kipu_vital_signs"
                | "kipu_orthostatic_vital_signs"
                | "kipu_patient_orders"
                | "kipu_glucose_logs"
                | "kipu_program_history"
                | "kipu_diagnosis_history"
                | "kipu_appointment"
                | "lightningstep_admissions"
                | "kipu_episode_outcome"
                | "sunwave_form"
                | "sunwave_diagnosis"
                | "sunwave_group_note"
                | "sunwave_program"
                | "sunwave_lab_result"
                | "sunwave_assessment"
                | "emr_insurance_information"
                | "insync_episode_summary"
                | "insync_condition"
                | "insync_vital_signs"
                | "insync_lab_result"
                | "insync_observation"
                | "insync_allergy"
                | "insync_immunization"
                | "insync_medication_request"
                | "insync_diagnostic_report"
                | "insync_procedure"
                | null;
            external_document_updated_at: string
            | null;
            file_name: string | null;
            file_type: "patient_chart" | "generated_form" | "emr_document" | null;
            file_url: string | null;
            id: number;
            integration_id: string | null;
            is_ready: boolean | null;
            patient_id: number | null;
            raw_document: Json;
            run_id: string | null;
            sources: Json;
            treatment_episode_id: string | null;
            updated_at: string | null;
        }[]

      Returns string