Circle V2 API Docs
    Preparing search index...

    Variable extendRunsRepoConst

    extendRunsRepo: DbRepo<
        {
            countForSuperadmin: (params: ListExtendRunsParams) => Promise<number>;
            countPatientGroupsForSuperadmin: (
                params: ListExtendRunsParams,
            ) => Promise<number>;
            create: (
                params: CreateExtendRunParams,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                },
            >;
            getById: (
                id: ExtendRunId,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                },
            >;
            getLatestByPatientChartId: (
                patientChartId: PatientChartId,
            ) => Promise<
                | {
                    cloudcruise_session_id: string
                    | null;
                    completed_at: string & { __brand: "DbDate" } | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                }
                | undefined,
            >;
            getTraceLinksByPatientChartId: (
                patientChartId: PatientChartId,
            ) => Promise<
                | {
                    cloudcruiseSessionId: string
                    | null;
                    extendRunId: string | null;
                    extendWorkflowId: string | null;
                }
                | undefined,
            >;
            listByRpaRunId: (
                rpaRunId: RpaRunId,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                }[],
            >;
            listDistinctSourcesForSuperadmin: () => Promise<string[]>;
            listForSuperadmin: (
                params: ListExtendRunsParams,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_first_name: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    patient_last_name: string | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                }[],
            >;
            listGroupedByPatientForSuperadmin: (
                params: ListExtendRunsParams,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_first_name: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    patient_last_name: string | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                }[],
            >;
            relinkPatientChart: (
                params: { from: PatientChartId; to: PatientChartId },
            ) => Promise<UpdateResult[]>;
            setPatientChartId: (
                externalRunId: string,
                patientChartId: PatientChartId,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                }
                | undefined,
            >;
            updateByExternalRunId: (
                externalRunId: string,
                patch: UpdateExtendRunFromWebhookParams,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    file_name: string | null;
                    id: ExtendRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    patient_chart_id: string & { __brand: "PatientChartId" } | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    rpa_run_id: string & { __brand: "RpaRunId" } | null;
                    source: string | null;
                    status:
                        | "processing"
                        | "failed"
                        | "rejected"
                        | "needs_review"
                        | "pending"
                        | "completed";
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" }
                    | null;
                    workflow_id: string | null;
                }
                | undefined,
            >;
        },
    > = ...