Circle V2 API Docs
    Preparing search index...
    appRouter: BuiltRouter<
        {
            ctx: TRPCContext;
            errorShape: DefaultErrorShape;
            meta: object;
            transformer: false;
        },
        DecorateCreateRouterOptions<
            {
                auditRuns: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            createResponseTrail: MutationProcedure<
                                {
                                    input: {
                                        auditResponseId: string;
                                        comment?: string;
                                        markedAs: "pass"
                                        | "fail"
                                        | "not_applicable";
                                    };
                                    meta: object;
                                    output: {
                                        audit_response_id: string & { __brand: ... };
                                        comment: string | null;
                                        created_at: DbDate;
                                        created_by: (...) & (...) | null;
                                        id: AuditResponseTrailId;
                                        marked_as: "pass" | "fail" | "not_applicable";
                                    };
                                },
                            >;
                            getById: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        auditRun: {
                                            archived: boolean;
                                            audit_template_id: (...) | (...);
                                            case_id: (...) | (...);
                                            created_at: DbDate;
                                            created_by: (...) | (...);
                                            hidden: boolean;
                                            id: AuditRunId;
                                            status: (...) | (...);
                                            summary: (...) | (...);
                                            template_name: (...) | (...);
                                            trigger: (...) | (...);
                                            triggered_at: (...) | (...);
                                        };
                                        responses: LegacyAuditRunResponseViewModel[];
                                        score: number
                                        | null;
                                        statusCounts: AuditRunStatusCounts;
                                        templateQuestionCount: number;
                                    };
                                },
                            >;
                            listForPatient: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        dateFrom?: string;
                                        dateTo?: string;
                                        excludeAuditRunIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        patientId: string;
                                        resultStatus?: unknown;
                                        search?: string;
                                        sortOrder?: "asc" | "desc";
                                        templateIds?: (...)[];
                                    };
                                    meta: object;
                                    output: PaginatedResponse<PatientRecentReviewRunListItem>;
                                },
                            >;
                            listRecentForPatient: QueryProcedure<
                                {
                                    input: { patientId: string };
                                    meta: object;
                                    output: ListRecentPatientReviewRunsServiceResult;
                                },
                            >;
                        },
                    >,
                >;
                auditTemplates: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: {
                                        customReviewCriteriaPrompt?: string;
                                        customSummaryPrompt?: string;
                                        description?: string;
                                        name: string;
                                        questions?: (...)[];
                                    };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: (...) & (...)
                                        | null;
                                        custom_review_criteria_prompt: string | null;
                                        custom_summary_prompt: string | null;
                                        description: string | null;
                                        id: AuditTemplateId;
                                        name: string | null;
                                        org_id: (...) & (...) | null;
                                        share_with_org: boolean | null;
                                        shared_by: (...) & (...) | null;
                                        shared_with_entity_id: (...) & (...) | null;
                                        updated_at: (...) & (...) | null;
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: (...) & (...) | null;
                                        custom_review_criteria_prompt: string | null;
                                        custom_summary_prompt: string | null;
                                        description: string | null;
                                        id: AuditTemplateId;
                                        name: string | null;
                                        org_id: (...) & (...) | null;
                                        share_with_org: boolean | null;
                                        shared_by: (...) & (...) | null;
                                        shared_with_entity_id: (...) & (...) | null;
                                        updated_at: (...) & (...) | null;
                                    };
                                },
                            >;
                            duplicate: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: (...) & (...) | null;
                                        custom_review_criteria_prompt: string | null;
                                        custom_summary_prompt: string | null;
                                        description: string | null;
                                        id: AuditTemplateId;
                                        name: string | null;
                                        org_id: (...) & (...) | null;
                                        share_with_org: boolean | null;
                                        shared_by: (...) & (...) | null;
                                        shared_with_entity_id: (...) & (...) | null;
                                        updated_at: (...) & (...) | null;
                                    };
                                },
                            >;
                            getById: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        auditTemplate: {
                                            created_at: DbDate;
                                            created_by: (...) | (...);
                                            custom_review_criteria_prompt: (...) | (...);
                                            custom_summary_prompt: (...) | (...);
                                            description: (...) | (...);
                                            id: AuditTemplateId;
                                            name: (...) | (...);
                                            org_id: (...) | (...);
                                            share_with_org: (...) | (...) | (...);
                                            shared_by: (...) | (...);
                                            shared_with_entity_id: (...) | (...);
                                            updated_at: (...) | (...);
                                        };
                                        questions: {
                                            created_at: ...;
                                            created_by: ...;
                                            id: ...;
                                            org_id: ...;
                                            question: ...;
                                            question_order: ...;
                                            question_type: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            template_id: ...;
                                            updated_at: ...;
                                        }[];
                                    };
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                        sortBy?: "name"
                                        | "created_at";
                                        sortOrder?: "asc" | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            created_at: DbDate;
                                            created_by: (...)
                                            | (...);
                                            custom_review_criteria_prompt: (...) | (...);
                                            custom_summary_prompt: (...) | (...);
                                            description: (...) | (...);
                                            id: AuditTemplateId;
                                            name: (...) | (...);
                                            org_id: (...) | (...);
                                            question_count: (...) | (...);
                                            share_with_org: (...) | (...) | (...);
                                        },
                                    >;
                                },
                            >;
                            toggleSharing: MutationProcedure<
                                {
                                    input: { id: string; shared: boolean };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: (...) & (...) | null;
                                        custom_review_criteria_prompt: string | null;
                                        custom_summary_prompt: string | null;
                                        description: string | null;
                                        id: AuditTemplateId;
                                        name: string | null;
                                        org_id: (...) & (...) | null;
                                        share_with_org: boolean | null;
                                        shared_by: (...) & (...) | null;
                                        shared_with_entity_id: (...) & (...) | null;
                                        updated_at: (...) & (...) | null;
                                    };
                                },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        customReviewCriteriaPrompt?: string
                                        | null;
                                        customSummaryPrompt?: string | null;
                                        description?: string | null;
                                        id: string;
                                        name?: string;
                                        questions?: (...)[];
                                    };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: (...) & (...)
                                        | null;
                                        custom_review_criteria_prompt: string | null;
                                        custom_summary_prompt: string | null;
                                        description: string | null;
                                        id: AuditTemplateId;
                                        name: string | null;
                                        org_id: (...) & (...) | null;
                                        share_with_org: boolean | null;
                                        shared_by: (...) & (...) | null;
                                        shared_with_entity_id: (...) & (...) | null;
                                        updated_at: (...) & (...) | null;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                chartReviewTriggers: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: {
                                        auditTemplateId: string;
                                        facilities?: (...)[];
                                        intervalSeconds: number | null;
                                        levelOfCareIds?: (...)[];
                                        name: string;
                                        timeAfterTriggerSeconds: number;
                                        triggerType: "admission" | "discharge" | "utilization_end";
                                    };
                                    meta: object;
                                    output: {
                                        audit_template_id: string & { __brand: ... };
                                        created_at: DbDate;
                                        deleted: boolean;
                                        enabled: boolean;
                                        entity_id: number & { __brand: ... };
                                        filters: { facilities: (...)[]; level_of_care_ids: (...)[] };
                                        id: ChartReviewTriggerId;
                                        interval_seconds: number | null;
                                        last_run_at: string | null;
                                        name: string;
                                        time_after_trigger_seconds: number;
                                        trigger_type: "admission" | "discharge" | "utilization_end";
                                        updated_at: DbDate;
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                {
                                    input: { triggerId: string };
                                    meta: object;
                                    output: {
                                        audit_template_id: string & { __brand: ... };
                                        created_at: DbDate;
                                        deleted: boolean;
                                        enabled: boolean;
                                        entity_id: number & { __brand: ... };
                                        filters: { facilities: (...)[]; level_of_care_ids: (...)[] };
                                        id: ChartReviewTriggerId;
                                        interval_seconds: number | null;
                                        last_run_at: string | null;
                                        name: string;
                                        time_after_trigger_seconds: number;
                                        trigger_type: "admission" | "discharge" | "utilization_end";
                                        updated_at: DbDate;
                                    };
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: void;
                                    meta: object;
                                    output: {
                                        audit_template_id: (...) & (...);
                                        created_at: DbDate;
                                        deleted: boolean;
                                        enabled: boolean;
                                        entity_id: (...) & (...);
                                        filters: { facilities: ...; level_of_care_ids: ... };
                                        id: ChartReviewTriggerId;
                                        interval_seconds: (...) | (...);
                                        last_run_at: (...) | (...);
                                        name: string;
                                        time_after_trigger_seconds: number;
                                        trigger_type: (...) | (...) | (...);
                                        updated_at: DbDate;
                                    }[];
                                },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        auditTemplateId: string;
                                        facilities?: (...)[];
                                        id: string;
                                        intervalSeconds: number | null;
                                        levelOfCareIds?: (...)[];
                                        name: string;
                                        timeAfterTriggerSeconds: number;
                                    };
                                    meta: object;
                                    output: {
                                        audit_template_id: string & { __brand: ... };
                                        created_at: DbDate;
                                        deleted: boolean;
                                        enabled: boolean;
                                        entity_id: number & { __brand: ... };
                                        filters: { facilities: (...)[]; level_of_care_ids: (...)[] };
                                        id: ChartReviewTriggerId;
                                        interval_seconds: number | null;
                                        last_run_at: string | null;
                                        name: string;
                                        time_after_trigger_seconds: number;
                                        trigger_type: "admission" | "discharge" | "utilization_end";
                                        updated_at: DbDate;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                contacts: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: { contactTypeId?: string; fieldValues?: (...)[] };
                                    meta: object;
                                    output: {
                                        contact_id: ContactId;
                                        contact_type: string;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        org_id: number;
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                { input: { contactId: string }; meta: object; output: void },
                            >;
                            get: QueryProcedure<
                                {
                                    input: { contactId: string };
                                    meta: object;
                                    output: {
                                        contact_id: ContactId;
                                        contact_type: string;
                                        contact_type_id: ContactTypeId;
                                        contact_type_name: string;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        fieldValues: { field_id: ...; key: ...; value: ...; value_id: ... }[];
                                        org_id: number;
                                    };
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: {
                                        contactTypeId?: string;
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                        sortBy?: "name"
                                        | "created_at";
                                        sortOrder?: "asc" | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            contact_id: ContactId;
                                            contact_type: string;
                                            contact_type_name: string;
                                            created_at: DbDate;
                                            created_by: (...)
                                            | (...);
                                            name: (...) | (...);
                                            org_id: number;
                                        },
                                    >;
                                },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        contactId: string;
                                        contactTypeId?: string;
                                        fieldValues?: (...)[];
                                    };
                                    meta: object;
                                    output: void;
                                },
                            >;
                        },
                    >,
                >;
                contactTypes: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: { customFields?: (...)[]; name: string };
                                    meta: object;
                                    output: {
                                        contact_type_id: ContactTypeId;
                                        created_at: DbDate;
                                        created_by: string;
                                        org_id: number | null;
                                        type: string;
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                { input: { contactTypeId: string }; meta: object; output: void },
                            >;
                            get: QueryProcedure<
                                {
                                    input: { contactTypeId: string };
                                    meta: object;
                                    output: {
                                        contact_type_id: ContactTypeId;
                                        created_at: DbDate;
                                        created_by: string;
                                        fields: {
                                            contact_type: ...;
                                            created_at: ...;
                                            field_id: ...;
                                            key: ...;
                                        }[];
                                        org_id: number
                                        | null;
                                        type: string;
                                    };
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: void;
                                    meta: object;
                                    output: {
                                        contact_count: number;
                                        contact_type_id: ContactTypeId;
                                        created_at: DbDate;
                                        created_by: string;
                                        field_count: number;
                                        org_id: (...)
                                        | (...);
                                        type: string;
                                    }[];
                                },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        contactTypeId: string;
                                        fieldIdsToRemove?: (...)[];
                                        fieldsToAdd?: (...)[];
                                        name?: string;
                                    };
                                    meta: object;
                                    output: void;
                                },
                            >;
                        },
                    >,
                >;
                facilities: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: {
                                        integration?: | { credentials: ...; type: ... }
                                        | { credentials: ...; type: ... }
                                        | { credentials: ...; type: ... };
                                        name: string;
                                    };
                                    meta: object;
                                    output: | {
                                        created_at: DbDate;
                                        entity_id: (...) & (...);
                                        id: FacilityId;
                                        name: string;
                                        timezone: (...) | (...);
                                        updated_at: DbDate;
                                    }
                                    | {
                                        facility: {
                                            created_at: ...;
                                            entity_id: ...;
                                            id: ...;
                                            name: ...;
                                            timezone: ...;
                                            updated_at: ...;
                                        };
                                        integration: {
                                            created_at: ...;
                                            created_by: ...;
                                            credentials: ...;
                                            entity_id: ...;
                                            facility_id: ...;
                                            id: ...;
                                            label: ...;
                                            last_sync: ...;
                                            status: ...;
                                            type: ...;
                                            updated_at: ...;
                                        };
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: { success: boolean };
                                },
                            >;
                            listInOrganization: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                    };
                                    meta: object;
                                    output: PaginatedResponse<{ id: FacilityId; name: string }>;
                                },
                            >;
                            listWithIntegrations: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                    };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        id: FacilityId;
                                        integration_credentials: (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                        integration_id: (...) | (...);
                                        integration_label: (...) | (...);
                                        integration_status: (...) | (...) | (...) | (...);
                                        integration_type: (...) | (...) | (...) | (...);
                                        last_sync: (...) | (...);
                                        name: string;
                                    }[];
                                },
                            >;
                            listWithLevelsOfCare: QueryProcedure<
                                { input: void; meta: object; output: FacilityWithLevelsOfCare[] },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        id: string;
                                        integration?: | { credentials: ...; type: ... }
                                        | { credentials: ...; type: ... }
                                        | { credentials: ...; type: ... };
                                        name: string;
                                    };
                                    meta: object;
                                    output: UpdateFacilityWithIntegrationResult;
                                },
                            >;
                        },
                    >,
                >;
                integrations: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            getIntegrationLocations: QueryProcedure<
                                {
                                    input: | {
                                        credentials: {
                                            api_id: ...;
                                            api_secret: ...;
                                            realm_id: ...;
                                            sunwave_email: ...;
                                        };
                                        type: "sunwave";
                                    }
                                    | { credentials: { bearer_token: ... }; type: "lightningstep" }
                                    | { credentials: { app_id: ... }; type: "kipu" };
                                    meta: object;
                                    output:
                                        | { facilities: (...)[] }
                                        | { locations: (...)[] }
                                        | { locations: (...)[] };
                                },
                            >;
                            syncAdmissions: MutationProcedure<
                                {
                                    input: {
                                        dry_run?: boolean;
                                        end_date?: string;
                                        integration_id: string;
                                        start_date?: string;
                                    };
                                    meta: object;
                                    output: {
                                        error: null;
                                        patients?: (...)[];
                                        stats?: {
                                            date_range?: ...;
                                            records_fetched: ...;
                                            records_upserted?: ...;
                                        };
                                        success: true;
                                    };
                                },
                            >;
                            syncPatients: MutationProcedure<
                                {
                                    input: { dry_run?: boolean; integration_id: string };
                                    meta: object;
                                    output: {
                                        error: null;
                                        patients?: (...)[];
                                        stats?: {
                                            date_range?: ...;
                                            records_fetched: ...;
                                            records_upserted?: ...;
                                        };
                                        success: true;
                                    };
                                },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        id: string;
                                        integration?: | { credentials: ...; type: ... }
                                        | { credentials: ...; type: ... }
                                        | { credentials: ...; type: ... };
                                        label?: string;
                                        status?: "active" | "inactive";
                                    };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: string
                                        | null;
                                        credentials:
                                            | {
                                                access_id: ...;
                                                app_id: ...;
                                                location_id: ...;
                                                location_name?: ...;
                                                secret_key: ...;
                                            }
                                            | { bearer_token: ...; location_ids: ...; location_name?: ... }
                                            | {
                                                api_id: ...;
                                                api_secret: ...;
                                                location_name?: ...;
                                                realm_id: ...;
                                                service_facility_id: ...;
                                                sunwave_email: ...;
                                            };
                                        entity_id: number & { __brand: ... };
                                        facility_id: FacilityId | null;
                                        id: IntegrationId;
                                        label: string | null;
                                        last_sync: string | null;
                                        status: "active" | "inactive" | "error";
                                        type: "kipu" | "lightningstep" | "sunwave";
                                        updated_at: DbDate;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                metrics: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            criteriaAssistants: QueryProcedure<
                                {
                                    input: {
                                        auditTemplateIds?: (...)[];
                                        cursor?: number;
                                        dateRange: { from: string; to: string };
                                        facilityIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        scoreRange?: { max?: ...; min?: ... };
                                        search?: string;
                                        sortBy?:
                                            | "name"
                                            | "needs_review"
                                            | "avg_score"
                                            | "total_reviews"
                                            | "passed";
                                        sortOrder?: "asc"
                                        | "desc";
                                    };
                                    meta: object;
                                    output: {
                                        audit_template_id: (...)
                                        | (...);
                                        audit_template_name: string;
                                    }[];
                                },
                            >;
                            criteriaDetail: QueryProcedure<
                                {
                                    input: {
                                        auditTemplateId: string;
                                        auditTemplateIds?: (...)[];
                                        cursor?: number;
                                        dateRange: { from: string; to: string };
                                        facilityIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        scoreRange?: { max?: ...; min?: ... };
                                        search?: string;
                                        sortBy?:
                                            | "question"
                                            | "needs_review"
                                            | "avg_score"
                                            | "total_reviews"
                                            | "passed";
                                        sortOrder?: "asc"
                                        | "desc";
                                        userId?: string;
                                    };
                                    meta: object;
                                    output: {
                                        items: {
                                            audit_question_id: ...;
                                            avg_score: ...;
                                            is_scoreable: ...;
                                            needs_review: ...;
                                            passed: ...;
                                            question: ...;
                                            total_reviews: ...;
                                            total_rows: ...;
                                        }[];
                                        nextCursor: number
                                        | null;
                                        providers: { provider_name: ...; provider_user_id: ... }[];
                                        total: number;
                                    };
                                },
                            >;
                            metricsFacilities: QueryProcedure<
                                {
                                    input: {
                                        auditTemplateIds?: (...)[];
                                        cursor?: number;
                                        dateRange: { from: string; to: string };
                                        facilityIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        scoreRange?: { max?: ...; min?: ... };
                                        search?: string;
                                        sortBy?:
                                            | "name"
                                            | "needs_review"
                                            | "avg_score"
                                            | "total_reviews"
                                            | "passed";
                                        sortOrder?: "asc"
                                        | "desc";
                                    };
                                    meta: object;
                                    output: {
                                        attention_rate: number;
                                        facility_id: (...)
                                        | (...);
                                        facility_name: string;
                                        pass_rate: number;
                                        total_clients: number;
                                        total_criteria: number;
                                        total_pass: number;
                                    }[];
                                },
                            >;
                            metricsGrouped: QueryProcedure<
                                {
                                    input: {
                                        auditTemplateIds?: (...)[];
                                        cursor?: number;
                                        dateRange: { from: string; to: string };
                                        dimension: "client" | "provider" | "assistant";
                                        facilityIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        scoreRange?: { max?: ...; min?: ... };
                                        search?: string;
                                        sortBy?:
                                            | "name"
                                            | "needs_review"
                                            | "avg_score"
                                            | "total_reviews"
                                            | "passed";
                                        sortOrder?: "asc"
                                        | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            avg_score: string;
                                            id: (...)
                                            | (...);
                                            name: string;
                                            needs_review: string;
                                            passed: string;
                                            total_reviews: string;
                                            total_rows: string;
                                        },
                                    >;
                                },
                            >;
                        },
                    >,
                >;
                orgMembers: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            createInvite: MutationProcedure<
                                {
                                    input: {
                                        email: string;
                                        firstName: string;
                                        lastName: string;
                                        roleId: number;
                                        title?: string;
                                    };
                                    meta: object;
                                    output: InviteUserServiceResult;
                                },
                            >;
                            listPendingInvites: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                        sortBy?: "name"
                                        | "email";
                                        sortOrder?: "asc" | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            email: string;
                                            first_name: (...)
                                            | (...);
                                            id: number;
                                            last_name: (...) | (...);
                                            role_id: number;
                                            role_name: (...) | (...);
                                            title: (...) | (...);
                                        },
                                    >;
                                },
                            >;
                            listRoles: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                    };
                                    meta: object;
                                    output: PaginatedResponse<{ role_id: RoleId; role_name: string }>;
                                },
                            >;
                            listUsers: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        roleId?: unknown;
                                        search?: string;
                                        sortBy?: "name"
                                        | "email";
                                        sortOrder?: "asc" | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            email: (...)
                                            | (...);
                                            first_name: (...) | (...);
                                            id: ProfileId;
                                            last_name: (...) | (...);
                                            role_id: number;
                                            role_name: string;
                                            title: (...) | (...);
                                        },
                                    >;
                                },
                            >;
                        },
                    >,
                >;
                patientCharts: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            listForPatient: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        fileType?: unknown;
                                        limit?: number;
                                        offset?: number;
                                        patientId: string;
                                        search?: string;
                                        sortOrder?: "asc"
                                        | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            created_at: DbDate;
                                            embedding_status: | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...);
                                            file_name: (...) | (...);
                                            file_type: (...) | (...) | (...) | (...);
                                            file_url: (...) | (...);
                                            id: PatientChartId;
                                            patient_id: (...) | (...);
                                            updated_at: (...) | (...);
                                        },
                                    >;
                                },
                            >;
                        },
                    >,
                >;
                patients: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            createPatient: MutationProcedure<
                                {
                                    input: {
                                        addressCity?: string;
                                        addressState?: string;
                                        addressStreet1?: string;
                                        addressStreet2?: string;
                                        addressZipcode?: string;
                                        dob?: string;
                                        email?: string;
                                        facilityId?: string;
                                        firstName: string;
                                        gender?: string;
                                        intakeNotes?: string;
                                        lastName: string;
                                        phoneMobile?: string;
                                    };
                                    meta: object;
                                    output: {
                                        address_city: string
                                        | null;
                                        address_state: string | null;
                                        address_street1: string | null;
                                        address_street2: string | null;
                                        address_zipcode: string | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dob: string | null;
                                        email: string | null;
                                        entity_id: (...) & (...) | null;
                                        external_patient_id: string | null;
                                        external_source: "kipu" | "lightningstep" | "sunwave" | null;
                                        facility_id: (...) & (...) | null;
                                        first_name: string | null;
                                        gender: string | null;
                                        intake_notes: string | null;
                                        last_name: string | null;
                                        last_updated_summary: string | null;
                                        patient_id: PatientId;
                                        phone_mobile: string | null;
                                        primary_provider_id: (...) & (...) | null;
                                        status: string | null;
                                        summary: LegacyPatientSummary | null;
                                    };
                                },
                            >;
                            deletePatient: MutationProcedure<
                                { input: { id: string }; meta: object; output: { id: PatientId } },
                            >;
                            getPatientById: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        address_city: string | null;
                                        address_state: string | null;
                                        address_street1: string | null;
                                        address_street2: string | null;
                                        address_zipcode: string | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dob: string | null;
                                        email: string | null;
                                        entity_id: (...) & (...) | null;
                                        external_patient_id: string | null;
                                        external_source: "kipu" | "lightningstep" | "sunwave" | null;
                                        facility_id: (...) & (...) | null;
                                        first_name: string | null;
                                        gender: string | null;
                                        intake_notes: string | null;
                                        last_name: string | null;
                                        last_updated_summary: string | null;
                                        patient_id: PatientId;
                                        phone_mobile: string | null;
                                        primary_provider_id: (...) & (...) | null;
                                        status: string | null;
                                        summary: LegacyPatientSummary | null;
                                    };
                                },
                            >;
                            getPatientDetail: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        admitted_at: string | null;
                                        created_at: DbDate;
                                        discharged_at: string | null;
                                        dob: string | null;
                                        external_source: "kipu" | "lightningstep" | "sunwave" | null;
                                        facility_id: (...) & (...) | null;
                                        facility_name: string | null;
                                        first_name: string | null;
                                        last_name: string | null;
                                        last_sync: string | null;
                                        patient_id: PatientId;
                                        primary_provider_id: (...) & (...) | null;
                                        provider_first_name: string | null;
                                        provider_last_name: string | null;
                                        provider_title: string | null;
                                    };
                                },
                            >;
                            getPatientOverview: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        patient: {
                                            admitted_at: (...) | (...);
                                            discharged_at: (...) | (...);
                                            facility_name: (...) | (...);
                                            first_name: (...) | (...);
                                            last_name: (...) | (...);
                                            last_updated_summary: (...) | (...);
                                            patient_id: PatientId;
                                            summary: (...) | (...);
                                        };
                                        recentSessions: {
                                            ai_summarized_note: ...;
                                            as_summarized_note_type: ...;
                                            audit_run_id: ...;
                                            audit_status: ...;
                                            case_id: ...;
                                            cpt_code: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            dsm_code: ...;
                                            end_timestamp: ...;
                                            error_msg: ...;
                                            file_url: ...;
                                            icd_code: ...;
                                            id: ...;
                                            manual_entry: ...;
                                            patient_id: ...;
                                            private_note: ...;
                                            progress_status: ...;
                                            selected_template: ...;
                                            start_timestamp: ...;
                                            transcript: ...;
                                            updated_by: ...;
                                        }[];
                                    };
                                },
                            >;
                            listInOrganization: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        facilityId?: unknown;
                                        limit?: number;
                                        offset?: number;
                                        patientIds?: unknown;
                                        patientSearch?: string;
                                        primaryProviderId?: unknown;
                                        sortBy?: "name"
                                        | "created_at"
                                        | "admitted_at"
                                        | "discharged_at";
                                        sortOrder?: "asc" | "desc";
                                        status?: unknown;
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            admitted_at: (...)
                                            | (...);
                                            created_at: DbDate;
                                            discharged_at: (...) | (...);
                                            dob: (...) | (...);
                                            entity_id: (...) | (...);
                                            facility_id: (...) | (...);
                                            facility_name: (...) | (...);
                                            first_name: (...) | (...);
                                            last_name: (...) | (...);
                                            last_updated_summary: (...) | (...);
                                            patient_id: PatientId;
                                            primary_provider_id: (...) | (...);
                                            provider_first_name: (...) | (...);
                                            provider_last_name: (...) | (...);
                                            provider_title: (...) | (...);
                                            status: (...) | (...);
                                        },
                                    >;
                                },
                            >;
                            updatePatient: MutationProcedure<
                                {
                                    input: {
                                        addressCity?: string;
                                        addressState?: string;
                                        addressStreet1?: string;
                                        addressStreet2?: string;
                                        addressZipcode?: string;
                                        dob?: string;
                                        email?: string;
                                        facilityId?: string;
                                        firstName: string;
                                        gender?: string;
                                        id: string;
                                        intakeNotes?: string;
                                        lastName: string;
                                        phoneMobile?: string;
                                    };
                                    meta: object;
                                    output: {
                                        address_city: string
                                        | null;
                                        address_state: string | null;
                                        address_street1: string | null;
                                        address_street2: string | null;
                                        address_zipcode: string | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dob: string | null;
                                        email: string | null;
                                        entity_id: (...) & (...) | null;
                                        external_patient_id: string | null;
                                        external_source: "kipu" | "lightningstep" | "sunwave" | null;
                                        facility_id: (...) & (...) | null;
                                        first_name: string | null;
                                        gender: string | null;
                                        intake_notes: string | null;
                                        last_name: string | null;
                                        last_updated_summary: string | null;
                                        patient_id: PatientId;
                                        phone_mobile: string | null;
                                        primary_provider_id: (...) & (...) | null;
                                        status: string | null;
                                        summary: LegacyPatientSummary | null;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                patientSessions: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            delete: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        ai_summarized_note: string | null;
                                        as_summarized_note_type: string | null;
                                        audit_run_id: (...) & (...) | null;
                                        audit_status:
                                            | "error"
                                            | "pass"
                                            | "fail"
                                            | "needs_review"
                                            | "pending"
                                            | "in_progress"
                                            | "not_started"
                                            | null;
                                        case_id: number
                                        | null;
                                        cpt_code: (...)[] | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dsm_code: (...)[] | null;
                                        end_timestamp: DbDate;
                                        error_msg: string | null;
                                        file_url: string | null;
                                        icd_code: (...)[] | null;
                                        id: SessionId;
                                        manual_entry: boolean | null;
                                        patient_id: (...) & (...) | null;
                                        private_note: string | null;
                                        progress_status:
                                            | "initialized"
                                            | "processing"
                                            | "transcribing"
                                            | "complete"
                                            | "failed"
                                            | null;
                                        selected_template: LegacySelectedTemplate
                                        | null;
                                        start_timestamp: DbDate;
                                        transcript: string | null;
                                        updated_by: number | null;
                                    };
                                },
                            >;
                            getById: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        caseAuditRunIds: AuditRunId[];
                                        patientSession: {
                                            ai_summarized_note: (...) | (...);
                                            audit_run_id: (...) | (...);
                                            case_id: (...) | (...);
                                            created_at: DbDate;
                                            end_timestamp: DbDate;
                                            file_url: (...) | (...);
                                            id: SessionId;
                                            manual_entry: (...) | (...) | (...);
                                            private_note: (...) | (...);
                                            progress_status: (...) | (...) | (...) | (...) | (...) | (...);
                                            selected_template: (...) | (...);
                                            start_timestamp: DbDate;
                                            transcript: (...) | (...);
                                        };
                                    };
                                },
                            >;
                            getRecentSessions: QueryProcedure<
                                {
                                    input: { patientId: string };
                                    meta: object;
                                    output: { sessions: Safe<(...)[]> };
                                },
                            >;
                            listForCurrentUser: QueryProcedure<
                                {
                                    input: { from: string; to: string };
                                    meta: object;
                                    output: {
                                        sessions: {
                                            end_timestamp: ...;
                                            id: ...;
                                            patient_first_name: ...;
                                            patient_id: ...;
                                            patient_last_name: ...;
                                            progress_status: ...;
                                            selected_template: ...;
                                            start_timestamp: ...;
                                        }[];
                                    };
                                },
                            >;
                            listForPatient: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        dateFrom?: string;
                                        dateTo?: string;
                                        limit?: number;
                                        offset?: number;
                                        patientId: string;
                                        search?: string;
                                        sortOrder?: "asc"
                                        | "desc";
                                        status?: unknown;
                                        templateIds?: (...)[];
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            ai_summarized_note: (...)
                                            | (...);
                                            created_at: DbDate;
                                            end_timestamp: DbDate;
                                            id: SessionId;
                                            private_note: (...) | (...);
                                            progress_status: (...) | (...) | (...) | (...) | (...) | (...);
                                            selected_template: (...) | (...);
                                            start_timestamp: DbDate;
                                            transcript: (...) | (...);
                                        },
                                    >;
                                },
                            >;
                            modifyAiNote: MutationProcedure<
                                {
                                    input: {
                                        customPrompt?: string;
                                        optionId: | "custom"
                                        | "shorten"
                                        | "lengthen"
                                        | "remove_name"
                                        | "remove_sensitive"
                                        | "regenerate";
                                        sessionId: string;
                                    };
                                    meta: object;
                                    output: { ai_generated_note: string };
                                },
                            >;
                            switchTemplate: MutationProcedure<
                                {
                                    input: { sessionId: string; templateId: string };
                                    meta: object;
                                    output: any;
                                },
                            >;
                            updateAiSummarizedNote: MutationProcedure<
                                {
                                    input: { aiSummarizedNote: string; id: string };
                                    meta: object;
                                    output: {
                                        ai_summarized_note: string | null;
                                        as_summarized_note_type: string | null;
                                        audit_run_id: (...) & (...) | null;
                                        audit_status:
                                            | "error"
                                            | "pass"
                                            | "fail"
                                            | "needs_review"
                                            | "pending"
                                            | "in_progress"
                                            | "not_started"
                                            | null;
                                        case_id: number
                                        | null;
                                        cpt_code: (...)[] | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dsm_code: (...)[] | null;
                                        end_timestamp: DbDate;
                                        error_msg: string | null;
                                        file_url: string | null;
                                        icd_code: (...)[] | null;
                                        id: SessionId;
                                        manual_entry: boolean | null;
                                        patient_id: (...) & (...) | null;
                                        private_note: string | null;
                                        progress_status:
                                            | "initialized"
                                            | "processing"
                                            | "transcribing"
                                            | "complete"
                                            | "failed"
                                            | null;
                                        selected_template: LegacySelectedTemplate
                                        | null;
                                        start_timestamp: DbDate;
                                        transcript: string | null;
                                        updated_by: number | null;
                                    };
                                },
                            >;
                            updatePrivateNote: MutationProcedure<
                                {
                                    input: { id: string; privateNote: string };
                                    meta: object;
                                    output: {
                                        ai_summarized_note: string | null;
                                        as_summarized_note_type: string | null;
                                        audit_run_id: (...) & (...) | null;
                                        audit_status:
                                            | "error"
                                            | "pass"
                                            | "fail"
                                            | "needs_review"
                                            | "pending"
                                            | "in_progress"
                                            | "not_started"
                                            | null;
                                        case_id: number
                                        | null;
                                        cpt_code: (...)[] | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dsm_code: (...)[] | null;
                                        end_timestamp: DbDate;
                                        error_msg: string | null;
                                        file_url: string | null;
                                        icd_code: (...)[] | null;
                                        id: SessionId;
                                        manual_entry: boolean | null;
                                        patient_id: (...) & (...) | null;
                                        private_note: string | null;
                                        progress_status:
                                            | "initialized"
                                            | "processing"
                                            | "transcribing"
                                            | "complete"
                                            | "failed"
                                            | null;
                                        selected_template: LegacySelectedTemplate
                                        | null;
                                        start_timestamp: DbDate;
                                        transcript: string | null;
                                        updated_by: number | null;
                                    };
                                },
                            >;
                            updateSessionTime: MutationProcedure<
                                {
                                    input: {
                                        endTimestamp: string;
                                        id: string;
                                        startTimestamp: string;
                                    };
                                    meta: object;
                                    output: {
                                        ai_summarized_note: string
                                        | null;
                                        as_summarized_note_type: string | null;
                                        audit_run_id: (...) & (...) | null;
                                        audit_status:
                                            | "error"
                                            | "pass"
                                            | "fail"
                                            | "needs_review"
                                            | "pending"
                                            | "in_progress"
                                            | "not_started"
                                            | null;
                                        case_id: number
                                        | null;
                                        cpt_code: (...)[] | null;
                                        created_at: DbDate;
                                        created_by: string | null;
                                        dsm_code: (...)[] | null;
                                        end_timestamp: DbDate;
                                        error_msg: string | null;
                                        file_url: string | null;
                                        icd_code: (...)[] | null;
                                        id: SessionId;
                                        manual_entry: boolean | null;
                                        patient_id: (...) & (...) | null;
                                        private_note: string | null;
                                        progress_status:
                                            | "initialized"
                                            | "processing"
                                            | "transcribing"
                                            | "complete"
                                            | "failed"
                                            | null;
                                        selected_template: LegacySelectedTemplate
                                        | null;
                                        start_timestamp: DbDate;
                                        transcript: string | null;
                                        updated_by: number | null;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                profiles: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            listInOrganization: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            first_name: (...)
                                            | (...);
                                            id: ProfileId;
                                            last_name: (...) | (...);
                                            title: (...) | (...);
                                        },
                                    >;
                                },
                            >;
                            updateProfile: MutationProcedure<
                                {
                                    input: { firstName: string; lastName: string; title?: string };
                                    meta: object;
                                    output: {
                                        clinic_size: string | null;
                                        created_at: string | null;
                                        customer_id: string | null;
                                        email: string | null;
                                        expectations: string | null;
                                        external_system: "kipu" | "lightningstep" | "sunwave" | null;
                                        external_system_id: string | null;
                                        first_name: string | null;
                                        hear_about_us: string | null;
                                        id: ProfileId;
                                        is_superadmin: boolean;
                                        last_name: string | null;
                                        last_updated: string | null;
                                        price_id: string | null;
                                        profile_type: "user" | "external";
                                        session_limit: string | null;
                                        subscription_status:
                                            | "trial_ended"
                                            | "trial_running"
                                            | "active"
                                            | "inactive"
                                            | null;
                                        title: string
                                        | null;
                                        user_id: (...) & (...) | null;
                                        vertical: string | null;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                reviewDashboard: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            list: QueryProcedure<
                                {
                                    input: {
                                        admissionDateRange?: { from: ...; to: ... };
                                        auditTemplateIds?: (...)[];
                                        authEndDateRange?: { from: ...; to: ... };
                                        authStartDateRange?: { from: ...; to: ... };
                                        clientSearch?: string;
                                        cursor?: number;
                                        dateRange?: { from: ...; to: ... };
                                        facilityIds?: (...)[];
                                        includeNullTriggers?: boolean;
                                        levelOfCareIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        profileIds?: (...)[];
                                        scoreRange?: { max?: ...; min?: ... };
                                        sortBy?:
                                            | "created_at"
                                            | "type"
                                            | "trigger"
                                            | "facility"
                                            | "provider_name"
                                            | "score"
                                            | "patient_name"
                                            | "assistant_name"
                                            | "admission_date"
                                            | "level_of_care"
                                            | "auth_start_date"
                                            | "auth_end_date";
                                        sortOrder?: "asc"
                                        | "desc";
                                        triggerIds?: (...)[];
                                        type?: "session_notes" | "chart_review";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            admission_date: (...)
                                            | (...);
                                            audit_template_id: (...) | (...);
                                            audit_template_name: string;
                                            auth_end_date: (...) | (...);
                                            auth_start_date: (...) | (...);
                                            case_id: number;
                                            client_id: PatientId;
                                            client_name: string;
                                            facility_name: string;
                                            level_of_care: (...) | (...);
                                            pass_count: number;
                                            provider_name: string;
                                            run_created_at: DbDate;
                                            run_id: AuditRunId;
                                            score_pct: number;
                                            total_count: number;
                                            total_rows: string;
                                            trigger: (...) | (...);
                                            type: string;
                                        },
                                    >;
                                },
                            >;
                            listGrouped: QueryProcedure<
                                {
                                    input: {
                                        admissionDateRange?: { from: ...; to: ... };
                                        auditTemplateIds?: (...)[];
                                        authEndDateRange?: { from: ...; to: ... };
                                        authStartDateRange?: { from: ...; to: ... };
                                        clientSearch?: string;
                                        cursor?: number;
                                        dateRange?: { from: ...; to: ... };
                                        facilityIds?: (...)[];
                                        includeNullTriggers?: boolean;
                                        levelOfCareIds?: (...)[];
                                        limit?: number;
                                        offset?: number;
                                        profileIds?: (...)[];
                                        scoreRange?: { max?: ...; min?: ... };
                                        sortBy?:
                                            | "created_at"
                                            | "type"
                                            | "trigger"
                                            | "facility"
                                            | "provider_name"
                                            | "score"
                                            | "patient_name"
                                            | "assistant_name"
                                            | "admission_date"
                                            | "level_of_care"
                                            | "auth_start_date"
                                            | "auth_end_date";
                                        sortOrder?: "asc"
                                        | "desc";
                                        triggerIds?: (...)[];
                                        type?: "session_notes" | "chart_review";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            admission_date: (...)
                                            | (...);
                                            audit_template_id: (...) | (...);
                                            audit_template_name: string;
                                            auth_end_date: (...) | (...);
                                            auth_start_date: (...) | (...);
                                            case_id: number;
                                            client_id: PatientId;
                                            client_name: string;
                                            facility_name: string;
                                            level_of_care: (...) | (...);
                                            pass_count: number;
                                            provider_name: string;
                                            run_created_at: DbDate;
                                            run_id: AuditRunId;
                                            score_pct: number;
                                            total_count: number;
                                            total_rows: string;
                                            trigger: (...) | (...);
                                            type: string;
                                        },
                                    >;
                                },
                            >;
                        },
                    >,
                >;
                savedFilters: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: {
                                        columnVisibility?: Record<(...), (...)>;
                                        filters: {
                                            dateRange?: (...) | (...);
                                            range?: (...) | (...);
                                            select?: (...) | (...);
                                            text?: (...) | (...);
                                        };
                                        name: string;
                                        pageKey: string;
                                        viewMode?: "flat"
                                        | "grouped";
                                    };
                                    meta: object;
                                    output: SavedViewDto;
                                },
                            >;
                            delete: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: DeleteSavedFilterOutput;
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: { pageKey: string };
                                    meta: object;
                                    output: ListSavedFiltersOutput;
                                },
                            >;
                        },
                    >,
                >;
                teams: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            addTeamMembers: MutationProcedure<
                                {
                                    input: { profileIds: string[]; teamId: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        id: UserTeamId;
                                        profile_id: (...) & (...);
                                        team_id: (...) & (...);
                                        user_entity_id: (...) | (...);
                                        user_id: (...) | (...);
                                    }[];
                                },
                            >;
                            createTeam: MutationProcedure<
                                {
                                    input: { memberIds: string[]; name: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        created_by: string | null;
                                        entity_id: number | null;
                                        id: TeamId;
                                        name: string | null;
                                    };
                                },
                            >;
                            listTeams: QueryProcedure<
                                {
                                    input: void;
                                    meta: object;
                                    output: {
                                        created_at: string;
                                        id: TeamId;
                                        members: (...)[];
                                        name: (...) | (...);
                                    }[];
                                },
                            >;
                            removeTeamMember: MutationProcedure<
                                {
                                    input: { profileId: string; teamId: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate;
                                        id: UserTeamId;
                                        profile_id: string & { __brand: ... };
                                        team_id: string & { __brand: ... };
                                        user_entity_id: number | null;
                                        user_id: (...) & (...) | null;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                templates: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: {
                                        additionalAiInstructions?: string;
                                        checkCpt?: boolean;
                                        checkDsm5?: boolean;
                                        checkIcd10?: boolean;
                                        hiddenInstructions?: string;
                                        isAllowBulletPoints?: boolean;
                                        isUnstructuredNarrative?: boolean;
                                        linkedAuditTemplateIds?: (...)[];
                                        sections?: (...)[];
                                        title: string;
                                    };
                                    meta: object;
                                    output: {
                                        additional_ai_instructions: string
                                        | null;
                                        check_cpt: boolean | null;
                                        check_demo: boolean | null;
                                        check_dsm_5: boolean | null;
                                        check_icd_10: boolean | null;
                                        created_by: (...) & (...) | null;
                                        created_by_circle: boolean | null;
                                        hidden_instructions: string | null;
                                        id: TemplateId;
                                        is_allow_bullet_points: boolean | null;
                                        is_unstructured_narrative: boolean | null;
                                        last_updated: DbDate | null;
                                        last_used: (...) & (...) | null;
                                        original_template_id: (...) & (...) | null;
                                        shared_with_org_id: (...) & (...) | null;
                                        title: string;
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        additional_ai_instructions: string | null;
                                        check_cpt: boolean | null;
                                        check_demo: boolean | null;
                                        check_dsm_5: boolean | null;
                                        check_icd_10: boolean | null;
                                        created_by: (...) & (...) | null;
                                        created_by_circle: boolean | null;
                                        hidden_instructions: string | null;
                                        id: TemplateId;
                                        is_allow_bullet_points: boolean | null;
                                        is_unstructured_narrative: boolean | null;
                                        last_updated: DbDate | null;
                                        last_used: (...) & (...) | null;
                                        original_template_id: (...) & (...) | null;
                                        shared_with_org_id: (...) & (...) | null;
                                        title: string;
                                    };
                                },
                            >;
                            duplicate: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        additional_ai_instructions: string | null;
                                        check_cpt: boolean | null;
                                        check_demo: boolean | null;
                                        check_dsm_5: boolean | null;
                                        check_icd_10: boolean | null;
                                        created_by: (...) & (...) | null;
                                        created_by_circle: boolean | null;
                                        hidden_instructions: string | null;
                                        id: TemplateId;
                                        is_allow_bullet_points: boolean | null;
                                        is_unstructured_narrative: boolean | null;
                                        last_updated: DbDate | null;
                                        last_used: (...) & (...) | null;
                                        original_template_id: (...) & (...) | null;
                                        shared_with_org_id: (...) & (...) | null;
                                        title: string;
                                    };
                                },
                            >;
                            getById: QueryProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        linkedAuditTemplateIds: ((...) & (...))[];
                                        sections: {
                                            body: ...;
                                            bullet_format: ...;
                                            created_by: ...;
                                            id: ...;
                                            last_updated: ...;
                                            name: ...;
                                            optional: ...;
                                            order: ...;
                                            template_id: ...;
                                        }[];
                                        template: {
                                            additional_ai_instructions: (...)
                                            | (...);
                                            check_cpt: (...) | (...) | (...);
                                            check_demo: (...) | (...) | (...);
                                            check_dsm_5: (...) | (...) | (...);
                                            check_icd_10: (...) | (...) | (...);
                                            created_by: (...) | (...);
                                            created_by_circle: (...) | (...) | (...);
                                            hidden_instructions: (...) | (...);
                                            id: TemplateId;
                                            is_allow_bullet_points: (...) | (...) | (...);
                                            is_unstructured_narrative: (...) | (...) | (...);
                                            last_updated: (...) | (...);
                                            last_used: (...) | (...);
                                            original_template_id: (...) | (...);
                                            shared_with_org_id: (...) | (...);
                                            title: string;
                                        };
                                    };
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: {
                                        cursor?: number;
                                        limit?: number;
                                        offset?: number;
                                        search?: string;
                                        sortBy?: "title"
                                        | "last_updated";
                                        sortOrder?: "asc" | "desc";
                                    };
                                    meta: object;
                                    output: PaginatedResponse<
                                        {
                                            check_cpt: (...)
                                            | (...)
                                            | (...);
                                            check_dsm_5: (...) | (...) | (...);
                                            check_icd_10: (...) | (...) | (...);
                                            created_by: (...) | (...);
                                            created_by_circle: (...) | (...) | (...);
                                            id: TemplateId;
                                            is_allow_bullet_points: (...) | (...) | (...);
                                            is_unstructured_narrative: (...) | (...) | (...);
                                            last_updated: (...) | (...);
                                            last_used: (...) | (...);
                                            original_template_id: (...) | (...);
                                            section_count: (...) | (...);
                                            shared_with_org_id: (...) | (...);
                                            title: string;
                                        },
                                    >;
                                },
                            >;
                            toggleSharing: MutationProcedure<
                                {
                                    input: { id: string; shared: boolean };
                                    meta: object;
                                    output: {
                                        additional_ai_instructions: string | null;
                                        check_cpt: boolean | null;
                                        check_demo: boolean | null;
                                        check_dsm_5: boolean | null;
                                        check_icd_10: boolean | null;
                                        created_by: (...) & (...) | null;
                                        created_by_circle: boolean | null;
                                        hidden_instructions: string | null;
                                        id: TemplateId;
                                        is_allow_bullet_points: boolean | null;
                                        is_unstructured_narrative: boolean | null;
                                        last_updated: DbDate | null;
                                        last_used: (...) & (...) | null;
                                        original_template_id: (...) & (...) | null;
                                        shared_with_org_id: (...) & (...) | null;
                                        title: string;
                                    };
                                },
                            >;
                            update: MutationProcedure<
                                {
                                    input: {
                                        additionalAiInstructions?: string
                                        | null;
                                        checkCpt?: boolean;
                                        checkDsm5?: boolean;
                                        checkIcd10?: boolean;
                                        hiddenInstructions?: string | null;
                                        id: string;
                                        isAllowBulletPoints?: boolean;
                                        isUnstructuredNarrative?: boolean;
                                        linkedAuditTemplateIds?: (...)[];
                                        sections?: (...)[];
                                        title?: string;
                                    };
                                    meta: object;
                                    output: {
                                        additional_ai_instructions: string
                                        | null;
                                        check_cpt: boolean | null;
                                        check_demo: boolean | null;
                                        check_dsm_5: boolean | null;
                                        check_icd_10: boolean | null;
                                        created_by: (...) & (...) | null;
                                        created_by_circle: boolean | null;
                                        hidden_instructions: string | null;
                                        id: TemplateId;
                                        is_allow_bullet_points: boolean | null;
                                        is_unstructured_narrative: boolean | null;
                                        last_updated: DbDate | null;
                                        last_used: (...) & (...) | null;
                                        original_template_id: (...) & (...) | null;
                                        shared_with_org_id: (...) & (...) | null;
                                        title: string;
                                    };
                                },
                            >;
                        },
                    >,
                >;
                userPrompts: BuiltRouter<
                    {
                        ctx: TRPCContext;
                        errorShape: DefaultErrorShape;
                        meta: object;
                        transformer: false;
                    },
                    DecorateCreateRouterOptions<
                        {
                            create: MutationProcedure<
                                {
                                    input: { prompt: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate | null;
                                        id: UserPromptId;
                                        is_pinned: boolean | null;
                                        prompt: string | null;
                                        user_id: UserId | null;
                                    };
                                },
                            >;
                            delete: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate | null;
                                        id: UserPromptId;
                                        is_pinned: boolean | null;
                                        prompt: string | null;
                                        user_id: UserId | null;
                                    };
                                },
                            >;
                            list: QueryProcedure<
                                {
                                    input: void;
                                    meta: object;
                                    output: {
                                        created_at: (...)
                                        | (...);
                                        id: UserPromptId;
                                        is_pinned: (...) | (...) | (...);
                                        prompt: (...) | (...);
                                        user_id: (...) | (...);
                                    }[];
                                },
                            >;
                            togglePin: MutationProcedure<
                                {
                                    input: { id: string };
                                    meta: object;
                                    output: {
                                        created_at: DbDate | null;
                                        id: UserPromptId;
                                        is_pinned: boolean | null;
                                        prompt: string | null;
                                        user_id: UserId | null;
                                    };
                                },
                            >;
                        },
                    >,
                >;
            },
        >,
    > = ...