Circle V2 API Docs
    Preparing search index...

    Variable auditRunsRepoConst

    auditRunsRepo: DbRepo<
        {
            countForPatient: (
                params: ListAuditRunsForPatientParams,
            ) => Promise<number>;
            create: (
                params: {
                    auditTemplateId: AuditTemplateId;
                    caseId: CaseId;
                    createdBy: UserId;
                    sessionId?: SessionId;
                    treatmentEpisodeId?: TreatmentEpisodeId | null;
                },
            ) => Promise<
                {
                    archived: boolean;
                    audit_template_id: string & { __brand: "AuditTemplateId" }
                    | null;
                    case_id: string & { __brand: "CaseId" } | null;
                    created_at: DbDate;
                    created_by: string & { __brand: "UserId" } | null;
                    hidden: boolean;
                    id: AuditRunId;
                    session_id: string & { __brand: "SessionId" } | null;
                    status: string | null;
                    summary: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    trigger: string | null;
                    triggered_at: string | null;
                },
            >;
            getById: (
                id: AuditRunId,
            ) => Promise<
                {
                    archived: boolean;
                    audit_template_id: string & { __brand: "AuditTemplateId" }
                    | null;
                    case_id: string & { __brand: "CaseId" } | null;
                    created_at: DbDate;
                    created_by: string & { __brand: "UserId" } | null;
                    hidden: boolean;
                    id: AuditRunId;
                    patient_first_name: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    patient_last_name: string | null;
                    session_id: string & { __brand: "SessionId" } | null;
                    status: string | null;
                    summary: string | null;
                    template_name: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    trigger: string | null;
                    triggered_at: string | null;
                },
            >;
            getPatientId: (
                auditRunId: AuditRunId,
            ) => Promise<{ patient_id: string & { __brand: "PatientId" } | null }>;
            listForPatient: (
                params: ListAuditRunsForPatientParams,
            ) => Promise<
                {
                    audit_template_id: string & { __brand: "AuditTemplateId" }
                    | null;
                    created_at: DbDate;
                    id: AuditRunId;
                    template_name: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                }[],
            >;
            listIdsByCaseId: (caseId: CaseId) => Promise<AuditRunId[]>;
            listIdsBySessionId: (sessionId: SessionId) => Promise<AuditRunId[]>;
            listRecentResponsesByPatientId: (
                params: {
                    createdAfter: string;
                    patientId: PatientId;
                    treatmentEpisodeId?: TreatmentEpisodeId;
                    type?: "session_notes" | "chart_review";
                },
            ) => Promise<
                {
                    audit_template_id: string & { __brand: "AuditTemplateId" }
                    | null;
                    created_at: DbDate;
                    id: AuditRunId;
                    template_name: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                }[],
            >;
            listResponseMetadataByRunIds: (
                runIds: AuditRunId[],
            ) => Promise<
                {
                    audit_run_id: string & { __brand: "AuditRunId" }
                    | null;
                    question_type: "pass_fail" | "summary" | null;
                    status: string | null;
                    user_action_status: string | null;
                }[],
            >;
            listResponsesByRunId: (
                runId: AuditRunId,
            ) => Promise<
                {
                    audit_question_id: AuditQuestionId
                    | null;
                    audit_run_id: string & { __brand: "AuditRunId" } | null;
                    context_sources: unknown[] | null;
                    created_at: DbDate;
                    icd_code: unknown[] | null;
                    id: AuditResponseId;
                    latest_trail_comment: string | null;
                    latest_trail_created_at: DbDate | null;
                    latest_trail_marked_as: "pass" | "fail" | "not_applicable" | null;
                    latest_trail_user_email: string | null;
                    latest_trail_user_first_name: string | null;
                    latest_trail_user_last_name: string | null;
                    manual: boolean;
                    question: string | null;
                    question_order: number | null;
                    question_type: "pass_fail" | "summary" | null;
                    question_ui: string | null;
                    reason: string[] | null;
                    recommendation: string | null;
                    response: string | null;
                    sources: unknown[] | null;
                    status: string | null;
                    user_action_status: string | null;
                }[],
            >;
            listResponseStatusesBySessionId: (
                sessionId: SessionId,
            ) => Promise<(string | null)[]>;
            markStaleAsFailed: (
                params: MarkStaleAsFailedParams,
            ) => Promise<{ id: AuditRunId }[]>;
            softDeleteAuditRunsByIds: (
                params: SoftDeleteAuditRunsByIdsParams,
            ) => Promise<{ archivedIds: AuditRunId[] }>;
            upsertByTrigger: (
                params: {
                    auditTemplateId: AuditTemplateId;
                    caseId: CaseId;
                    createdBy: UserId | null;
                    treatmentEpisodeId?: TreatmentEpisodeId | null;
                    trigger: ChartReviewTriggerId;
                    triggeredAt: string;
                },
            ) => Promise<
                {
                    archived: boolean;
                    audit_template_id: string & { __brand: "AuditTemplateId" }
                    | null;
                    case_id: string & { __brand: "CaseId" } | null;
                    created_at: DbDate;
                    created_by: string & { __brand: "UserId" } | null;
                    hidden: boolean;
                    id: AuditRunId;
                    session_id: string & { __brand: "SessionId" } | null;
                    status: string | null;
                    summary: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    trigger: string | null;
                    triggered_at: string | null;
                },
            >;
        },
    > = ...