Circle V2 API Docs
    Preparing search index...

    Variable patientSessionsRepoConst

    patientSessionsRepo: DbRepo<
        {
            countForPatient: (
                params: ListSessionsForPatientParams,
            ) => Promise<number>;
            createSession: (
                params: {} & {
                    ai_summarized_note?: string | null;
                    as_summarized_note_type?: string | null;
                    audit_run_id?: string & { __brand: "AuditRunId" } | null;
                    audit_status?:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id?: string & { __brand: "CaseId" }
                    | null;
                    cpt_code?: unknown[] | null;
                    created_at?: DbDate;
                    created_by?: string | null;
                    dsm_code?:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp?: DbDate;
                    error_msg?: string
                    | null;
                    file_url?: string | null;
                    icd_code?:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id?: SessionId;
                    manual_entry?: boolean
                    | null;
                    patient_id?: string & { __brand: "PatientId" } | null;
                    private_note?: string | null;
                    progress_status?:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template?: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp?: DbDate;
                    transcript?: string
                    | null;
                    updated_by?: number | null;
                },
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            deleteById: (
                id: SessionId,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            getById: (
                id: SessionId,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code: {
                        code: string;
                        description: string;
                        status: "suggested" | "accepted" | "rejected";
                    }[];
                    end_timestamp: DbDate;
                    file_url: string
                    | null;
                    icd_code: {
                        code: string;
                        description: string;
                        status: "suggested" | "accepted" | "rejected";
                    }[];
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                },
            >;
            getMostRecentTemplateId: (
                patientId: PatientId,
            ) => Promise<TemplateId | null>;
            getPatientId: (
                sessionId: SessionId,
            ) => Promise<{ patient_id: string & { __brand: "PatientId" } | null }>;
            getRecentSessions: (
                patientId: PatientId,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: (...) | (...) | (...);
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                }[],
            >;
            getSessionForAiModification: (
                id: SessionId,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    id: SessionId;
                    patient_id: string & { __brand: "PatientId" } | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    transcript: string
                    | null;
                },
            >;
            listForCurrentUser: (
                params: ListSessionsForCurrentUserParams,
            ) => Promise<
                {
                    end_timestamp: DbDate;
                    id: SessionId;
                    patient_first_name: string
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    patient_last_name: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: (...) | (...) | (...);
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                }[],
            >;
            listForPatient: (
                params: ListSessionsForPatientParams,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    created_at: DbDate;
                    end_timestamp: DbDate;
                    id: SessionId;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: (...) | (...) | (...);
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                }[],
            >;
            markStaleAsFailed: (
                params: MarkStaleSessionsAsFailedParams,
            ) => Promise<{ id: SessionId }[]>;
            saveGeneratedNote: (
                id: SessionId,
                params: Omit<SessionUpdateParams, "id">,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            transitionProgressStatus: (
                id: SessionId,
                from:
                    | "initialized"
                    | "processing"
                    | "transcribing"
                    | "complete"
                    | "failed",
                to: "initialized" | "processing" | "transcribing" | "complete" | "failed",
                errorMessage?: string | null,
            ) => Promise<
                | {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: (...) | (...) | (...);
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                }
                | undefined,
            >;
            updateAiSummarizedNote: (
                id: SessionId,
                aiSummarizedNote: string,
                progressStatus:
                    | "initialized"
                    | "processing"
                    | "transcribing"
                    | "complete"
                    | "failed",
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            updateAuditStatus: (
                id: SessionId,
                auditStatus:
                    | "error"
                    | "pass"
                    | "fail"
                    | "needs_review"
                    | "pending"
                    | "in_progress"
                    | "not_started",
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            updateDsmCodes: (
                id: SessionId,
                codes: {
                    code: string;
                    description: string;
                    status: "suggested" | "accepted" | "rejected";
                }[],
            ) => Promise<
                {
                    dsm_code: | {
                        code: string;
                        description: string;
                        status: "suggested"
                        | "accepted"
                        | "rejected";
                    }[]
                    | null;
                    id: SessionId;
                },
            >;
            updateIcdCodes: (
                id: SessionId,
                codes: {
                    code: string;
                    description: string;
                    status: "suggested" | "accepted" | "rejected";
                }[],
            ) => Promise<
                {
                    icd_code: | {
                        code: string;
                        description: string;
                        status: "suggested"
                        | "accepted"
                        | "rejected";
                    }[]
                    | null;
                    id: SessionId;
                },
            >;
            updatePrivateNote: (
                id: SessionId,
                privateNote: string,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            updateProgressStatus: (
                id: SessionId,
                progressStatus:
                    | "initialized"
                    | "processing"
                    | "transcribing"
                    | "complete"
                    | "failed",
                errorMessage?: string | null,
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            updateSelectedTemplate: (
                id: SessionId,
                template: {
                    additional_ai_instructions?: string;
                    check_cpt?: boolean;
                    check_demo?: boolean;
                    check_dsm_5?: boolean;
                    check_icd_10?: boolean;
                    created_by?: UserId | null;
                    created_by_circle?: boolean;
                    hidden_instructions?: string | null;
                    id: TemplateId;
                    is_allow_bullet_points?: boolean;
                    is_unstructured_narrative?: boolean;
                    last_updated?: string | null;
                    last_used?: string | null;
                    name?: string;
                    original_template_id?: string;
                    sections: {
                        body: string;
                        bullet_format?: boolean;
                        id: SectionId;
                        name: string;
                        optional: boolean;
                        order: number;
                    }[];
                    selected_audit_template_ids?: number[];
                    shared_with_org_id?: string;
                    title: string;
                    [key: string]: unknown;
                },
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
            updateSessionTime: (
                id: SessionId,
                params: { endTimestamp: string; startTimestamp: string },
            ) => Promise<
                {
                    ai_summarized_note: string
                    | null;
                    as_summarized_note_type: string | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    audit_status:
                        | "error"
                        | "pass"
                        | "fail"
                        | "needs_review"
                        | "pending"
                        | "in_progress"
                        | "not_started"
                        | null;
                    case_id: string & { __brand: "CaseId" }
                    | null;
                    cpt_code: unknown[] | null;
                    created_at: DbDate;
                    created_by: string | null;
                    dsm_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    end_timestamp: DbDate;
                    error_msg: string
                    | null;
                    file_url: string | null;
                    icd_code:
                        | {
                            code: string;
                            description: string;
                            status: "suggested"
                            | "accepted"
                            | "rejected";
                        }[]
                        | null;
                    id: SessionId;
                    manual_entry: boolean
                    | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    private_note: string | null;
                    progress_status:
                        | "initialized"
                        | "processing"
                        | "transcribing"
                        | "complete"
                        | "failed"
                        | null;
                    selected_template: | {
                        additional_ai_instructions?: string;
                        check_cpt?: boolean;
                        check_demo?: boolean;
                        check_dsm_5?: boolean;
                        check_icd_10?: boolean;
                        created_by?: UserId
                        | null;
                        created_by_circle?: boolean;
                        hidden_instructions?: string | null;
                        id: TemplateId;
                        is_allow_bullet_points?: boolean;
                        is_unstructured_narrative?: boolean;
                        last_updated?: string | null;
                        last_used?: string | null;
                        name?: string;
                        original_template_id?: string;
                        sections: {
                            body: string;
                            bullet_format?: boolean;
                            id: SectionId;
                            name: string;
                            optional: boolean;
                            order: number;
                        }[];
                        selected_audit_template_ids?: number[];
                        shared_with_org_id?: string;
                        title: string;
                        [key: string]: unknown;
                    }
                    | null;
                    start_timestamp: DbDate;
                    transcript: string
                    | null;
                    updated_by: number | null;
                },
            >;
        },
    > = ...