Circle V2 API Docs
    Preparing search index...

    Variable useTRPCClient

    useTRPCClient: () => TRPCClient<
        BuiltRouter<
            {
                ctx: TRPCContext;
                errorShape: DefaultErrorShape;
                meta: object;
                transformer: false;
            },
            DecorateCreateRouterOptions<
                {
                    actionItems: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                bulkApply: MutationProcedure<
                                    {
                                        input: {
                                            assignee?: ...;
                                            items: ...;
                                            nextStep?: ...;
                                            status?: ...;
                                        };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                                getQuestionDetail: QueryProcedure<
                                    {
                                        input: { responseId: ... };
                                        meta: object;
                                        output: {
                                            assignee_id: ...;
                                            assignee_name: ...;
                                            assignee_type: ...;
                                            next_step: ...;
                                            reason: ...;
                                            recommendation: ...;
                                            response: ...;
                                            response_id: ...;
                                            short_form_response: ...;
                                            status: ...;
                                        };
                                    },
                                >;
                                listAssignees: QueryProcedure<
                                    {
                                        input: { search?: ... };
                                        meta: object;
                                        output: ListAssigneesResult;
                                    },
                                >;
                                listQuestions: QueryProcedure<
                                    {
                                        input: {
                                            admissionStatus?: ...;
                                            assigneeContactIds?: ...;
                                            assigneeIds?: ...;
                                            auditTemplateIds?: ...;
                                            authEndDateRange?: ...;
                                            cursor?: ...;
                                            facilityIds?: ...;
                                            facilityIdsForLoc?: ...;
                                            facilityIdsForProgram?: ...;
                                            facilityIdsForUrLoc?: ...;
                                            levelOfCareIds?: ...;
                                            limit?: ...;
                                            nextSteps?: ...;
                                            offset?: ...;
                                            programIds?: ...;
                                            providerIds?: ...;
                                            runDateRange?: ...;
                                            search?: ...;
                                            sortBy: ...;
                                            sortOrder: ...;
                                            statuses: ...;
                                            urLevelOfCareIds?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                updateActionItem: MutationProcedure<
                                    {
                                        input: {
                                            assignee?: ...;
                                            auditQuestionId: ...;
                                            nextStep?: ...;
                                            patientId: ...;
                                        };
                                        meta: object;
                                        output: {
                                            assigned_contact_id: ...;
                                            assigned_to: ...;
                                            audit_question_id: ...;
                                            created_at: ...;
                                            id: ...;
                                            next_steps: ...;
                                            patient_id: ...;
                                            updated_at: ...;
                                            updated_by: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    aiFeedback: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                listOwn: QueryProcedure<
                                    {
                                        input: { patientId: ...; targetRefs: ... };
                                        meta: object;
                                        output: ListOwnAiFeedbackOutput;
                                    },
                                >;
                                retract: MutationProcedure<
                                    {
                                        input: { patientId: ...; targetRef: ... };
                                        meta: object;
                                        output: RetractAiFeedbackOutput;
                                    },
                                >;
                                submit: MutationProcedure<
                                    {
                                        input: {
                                            auditQuestionId?: ...;
                                            auditResponseId?: ...;
                                            auditRunId?: ...;
                                            comment?: ...;
                                            conversationId?: ...;
                                            correction?: ...;
                                            flow: ...;
                                            messageId?: ...;
                                            patientId: ...;
                                            patientSessionId?: ...;
                                            rating: ...;
                                            targetRef: ...;
                                            targetSnapshot?: ...;
                                            threadSnapshot?: ...;
                                        };
                                        meta: object;
                                        output: SubmitAiFeedbackOutput;
                                    },
                                >;
                            },
                        >,
                    >;
                    auditRuns: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                archive: MutationProcedure<
                                    { input: { id: ... }; meta: object; output: { archived: ... } },
                                >;
                                createResponseTrail: MutationProcedure<
                                    {
                                        input: (...)
                                        | (...);
                                        meta: object;
                                        output: {
                                            audit_response_id: ...;
                                            comment: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            id: ...;
                                            marked_as: ...;
                                            response: ...;
                                        };
                                    },
                                >;
                                getById: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            auditRun: ...;
                                            documentWait: ...;
                                            hasPendingResponses: ...;
                                            isWaitingForDocuments: ...;
                                            lastSync: ...;
                                            responses: ...;
                                            scopedCharts: ...;
                                            score: ...;
                                            statusCounts: ...;
                                            templateQuestionCount: ...;
                                        };
                                    },
                                >;
                                listForPatient: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            dateFrom?: ...;
                                            dateTo?: ...;
                                            excludeAuditRunIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientId: ...;
                                            resultStatus?: ...;
                                            search?: ...;
                                            sortOrder?: ...;
                                            templateIds?: ...;
                                            treatmentEpisodeId?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listQuestionRunHistory: QueryProcedure<
                                    {
                                        input: {
                                            auditQuestionId: ...;
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientId: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listRecentForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ...; treatmentEpisodeId?: ...; type?: ... };
                                        meta: object;
                                        output: ListRecentPatientReviewRunsServiceResult;
                                    },
                                >;
                                rerunQuestion: MutationProcedure<
                                    {
                                        input: {
                                            auditQuestionId: ...;
                                            auditRunId: ...;
                                            questionText?: ...;
                                        };
                                        meta: object;
                                        output: { auditRunId: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                    auditTemplates: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: {
                                            customReviewCriteriaPrompt?: ...;
                                            customSummaryPrompt?: ...;
                                            description?: ...;
                                            name: ...;
                                            questions?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            custom_review_criteria_prompt: ...;
                                            custom_summary_prompt: ...;
                                            deleted: ...;
                                            description: ...;
                                            id: ...;
                                            name: ...;
                                            org_id: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                delete: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            custom_review_criteria_prompt: ...;
                                            custom_summary_prompt: ...;
                                            deleted: ...;
                                            description: ...;
                                            id: ...;
                                            name: ...;
                                            org_id: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                duplicate: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            custom_review_criteria_prompt: ...;
                                            custom_summary_prompt: ...;
                                            deleted: ...;
                                            description: ...;
                                            id: ...;
                                            name: ...;
                                            org_id: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                getById: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: { auditTemplate: ...; questions: ...; triggers: ... };
                                    },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            deletedOnly?: ...;
                                            includeDeleted?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                restore: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            custom_review_criteria_prompt: ...;
                                            custom_summary_prompt: ...;
                                            deleted: ...;
                                            description: ...;
                                            id: ...;
                                            name: ...;
                                            org_id: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                toggleSharing: MutationProcedure<
                                    {
                                        input: { id: ...; shared: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            custom_review_criteria_prompt: ...;
                                            custom_summary_prompt: ...;
                                            deleted: ...;
                                            description: ...;
                                            id: ...;
                                            name: ...;
                                            org_id: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            customReviewCriteriaPrompt?: ...;
                                            customSummaryPrompt?: ...;
                                            description?: ...;
                                            id: ...;
                                            name?: ...;
                                            questions?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            custom_review_criteria_prompt: ...;
                                            custom_summary_prompt: ...;
                                            deleted: ...;
                                            description: ...;
                                            id: ...;
                                            name: ...;
                                            org_id: ...;
                                            share_with_org: ...;
                                            shared_by: ...;
                                            shared_with_entity_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    census: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                facility: QueryProcedure<
                                    {
                                        input: { facilityId: ... };
                                        meta: object;
                                        output: { asOf: ...; facility: ...; programs: ...; totals: ... };
                                    },
                                >;
                                listFacilities: QueryProcedure<
                                    {
                                        input: void;
                                        meta: object;
                                        output: {
                                            activeMembers: ...;
                                            ageBands: ...;
                                            asOf: ...;
                                            facilities: ...;
                                        };
                                    },
                                >;
                                programMembers: QueryProcedure<
                                    {
                                        input: { facilityId: ...; facilityProgramId: ... };
                                        meta: object;
                                        output: { asOf: ...; facility: ...; members: ...; program: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                    chartReview: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                releaseParkedRun: MutationProcedure<
                                    {
                                        input: { auditRunId: ... };
                                        meta: object;
                                        output: { released: ... };
                                    },
                                >;
                                run: MutationProcedure<
                                    {
                                        input: {
                                            auditSource?: ...;
                                            patientChartIds?: ...;
                                            patientId: ...;
                                            sessionId?: ...;
                                            templateIds: ...;
                                            treatmentEpisodeId?: ...;
                                            trigger?: ...;
                                            triggeredAt?: ...;
                                        };
                                        meta: object;
                                        output: { auditRunIds: ... };
                                    },
                                >;
                                syncAndRun: MutationProcedure<
                                    {
                                        input: { episodeId?: ...; patientId: ...; templateIds: ... };
                                        meta: object;
                                        output: SyncAndRunOutput;
                                    },
                                >;
                            },
                        >,
                    >;
                    chartReviewTriggers: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                check: MutationProcedure<
                                    {
                                        input: { patientId?: ...; triggerId?: ... };
                                        meta: object;
                                        output: CheckTriggersForEntityResult;
                                    },
                                >;
                                create: MutationProcedure<
                                    {
                                        input: {
                                            auditTemplateIds: ...;
                                            clinicalLevelsOfCare?: ...;
                                            facilities?: ...;
                                            intervalSeconds: ...;
                                            name: ...;
                                            programs?: ...;
                                            schedule?: ...;
                                            timeAfterTriggerSeconds: ...;
                                            triggerType: ...;
                                            urLevelsOfCare?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            audit_template_id: ...;
                                            audit_templates: ...;
                                            created_at: ...;
                                            deleted: ...;
                                            enabled: ...;
                                            entity_id: ...;
                                            filters: ...;
                                            id: ...;
                                            interval_seconds: ...;
                                            last_run_at: ...;
                                            name: ...;
                                            schedule: ...;
                                            time_after_trigger_seconds: ...;
                                            trigger_type: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                delete: MutationProcedure<
                                    {
                                        input: { triggerId: ... };
                                        meta: object;
                                        output: {
                                            audit_template_id: ...;
                                            created_at: ...;
                                            deleted: ...;
                                            enabled: ...;
                                            entity_id: ...;
                                            filters: ...;
                                            id: ...;
                                            interval_seconds: ...;
                                            last_run_at: ...;
                                            name: ...;
                                            schedule: ...;
                                            time_after_trigger_seconds: ...;
                                            trigger_type: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            auditTemplateIds: ...;
                                            clinicalLevelsOfCare?: ...;
                                            facilities?: ...;
                                            id: ...;
                                            intervalSeconds: ...;
                                            name: ...;
                                            programs?: ...;
                                            schedule?: ...;
                                            timeAfterTriggerSeconds: ...;
                                            urLevelsOfCare?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            audit_template_id: ...;
                                            audit_templates: ...;
                                            created_at: ...;
                                            deleted: ...;
                                            enabled: ...;
                                            entity_id: ...;
                                            filters: ...;
                                            id: ...;
                                            interval_seconds: ...;
                                            last_run_at: ...;
                                            name: ...;
                                            schedule: ...;
                                            time_after_trigger_seconds: ...;
                                            trigger_type: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    chat: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                sendMessage: MutationProcedure<
                                    {
                                        input: { conversationId?: ...; messages: ...; patientId: ... };
                                        meta: object;
                                        output: RunCaseReviewChatResult;
                                    },
                                >;
                            },
                        >,
                    >;
                    contacts: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: { contactTypeId?: ...; fieldValues?: ... };
                                        meta: object;
                                        output: {
                                            contact_id: ...;
                                            contact_type: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            org_id: ...;
                                        };
                                    },
                                >;
                                delete: MutationProcedure<
                                    { input: { contactId: ... }; meta: object; output: void },
                                >;
                                get: QueryProcedure<
                                    {
                                        input: { contactId: ... };
                                        meta: object;
                                        output: {
                                            contact_id: ...;
                                            contact_type: ...;
                                            contact_type_id: ...;
                                            contact_type_name: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            fieldValues: ...;
                                            org_id: ...;
                                        };
                                    },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: {
                                            contactTypeId?: ...;
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            contactId: ...;
                                            contactTypeId?: ...;
                                            fieldValues?: ...;
                                        };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                            },
                        >,
                    >;
                    contactTypes: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: { customFields?: ...; name: ... };
                                        meta: object;
                                        output: {
                                            contact_type_id: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            org_id: ...;
                                            type: ...;
                                        };
                                    },
                                >;
                                delete: MutationProcedure<
                                    { input: { contactTypeId: ... }; meta: object; output: void },
                                >;
                                get: QueryProcedure<
                                    {
                                        input: { contactTypeId: ... };
                                        meta: object;
                                        output: {
                                            contact_type_id: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            fields: ...;
                                            org_id: ...;
                                            type: ...;
                                        };
                                    },
                                >;
                                list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            contactTypeId: ...;
                                            fieldIdsToRemove?: ...;
                                            fieldsToAdd?: ...;
                                            name?: ...;
                                        };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                            },
                        >,
                    >;
                    dictionary: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                createConcept: MutationProcedure<
                                    {
                                        input: { name: ...; subject: ... };
                                        meta: object;
                                        output: { id: ...; name: ... };
                                    },
                                >;
                                listChartTitleLocations: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientSearch?: ...;
                                            title: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listChartTitlePatterns: QueryProcedure<
                                    {
                                        input: {
                                            conceptIds?: ...;
                                            cursor?: ...;
                                            facilityIds?: ...;
                                            includeMapped: ...;
                                            kind?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sort?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listChartTitlePatternTitles: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patternId: ...;
                                            titleSearch?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listConcepts: QueryProcedure<
                                    { input: { subject: ... }; meta: object; output: (...)[] },
                                >;
                                listConceptsWithRules: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sort?: ...;
                                            sortOrder?: ...;
                                            subject: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listConceptTitleRules: QueryProcedure<
                                    {
                                        input: { conceptId: ... };
                                        meta: object;
                                        output: ConceptTitleRules;
                                    },
                                >;
                                listCredentialEntries: QueryProcedure<
                                    { input: { search?: ... }; meta: object; output: (...)[] },
                                >;
                                listCredentialEntriesPage: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listCredentialProviders: QueryProcedure<
                                    {
                                        input: {
                                            credential: ...;
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            providerSearch?: ...;
                                        };
                                        meta: object;
                                        output: { items: ...; nextCursor: ...; summary: ...; total: ... };
                                    },
                                >;
                                listCredentials: QueryProcedure<
                                    {
                                        input: { includeMapped: ...; search?: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                listCredentialsPage: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            includeMapped: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listLevelOfCareEntries: QueryProcedure<
                                    { input: { search?: ... }; meta: object; output: (...)[] },
                                >;
                                listUnmappedLevelOfCareNames: QueryProcedure<
                                    { input: { search?: ... }; meta: object; output: (...)[] },
                                >;
                                mapChartTitlesToConcept: MutationProcedure<
                                    {
                                        input: { conceptId: ...; exactTitles: ...; patterns: ... };
                                        meta: object;
                                        output: { taggingError: ... };
                                    },
                                >;
                                mapCredentials: MutationProcedure<
                                    {
                                        input: { conceptId: ...; credentials: ... };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                                mapLevelOfCareNames: MutationProcedure<
                                    {
                                        input: { conceptId: ...; levelOfCareIds: ...; programIds: ... };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                                saveCircleMatchers: MutationProcedure<
                                    {
                                        input: { conceptId: ...; matchers: ... };
                                        meta: object;
                                        output: { taggingError: ... };
                                    },
                                >;
                                saveConceptExactTitles: MutationProcedure<
                                    {
                                        input: { conceptId: ...; titles: ... };
                                        meta: object;
                                        output: { taggingError: ... };
                                    },
                                >;
                                unmapCredentials: MutationProcedure<
                                    {
                                        input: { conceptId: ...; matcherIds: ... };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                                unmapLevelOfCareNames: MutationProcedure<
                                    {
                                        input: { conceptId: ...; matcherIds: ... };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                                unmapTitlePattern: MutationProcedure<
                                    {
                                        input: { conceptId: ...; ruleId: ... };
                                        meta: object;
                                        output: { taggingError: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                    facilities: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: { integration?: ...; name: ...; timezone: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                delete: MutationProcedure<
                                    { input: { id: ... }; meta: object; output: { success: ... } },
                                >;
                                hasEmrIntegratedFacilities: QueryProcedure<
                                    { input: void; meta: object; output: boolean },
                                >;
                                listInOrganization: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listWithFilterOptions: QueryProcedure<
                                    { input: void; meta: object; output: (...)[] },
                                >;
                                listWithIntegrations: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                listWithIntegrationsPage: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listWithLevelsOfCare: QueryProcedure<
                                    { input: void; meta: object; output: (...)[] },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            admissionStartSource?: ...;
                                            id: ...;
                                            integration?: ...;
                                            name: ...;
                                            timezone?: ...;
                                        };
                                        meta: object;
                                        output: UpdateFacilityWithIntegrationResult;
                                    },
                                >;
                            },
                        >,
                    >;
                    formRuns: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                deleteDocument: MutationProcedure<
                                    {
                                        input: { runId: ... };
                                        meta: object;
                                        output: { deleted: ...; runId: ... };
                                    },
                                >;
                                download: QueryProcedure<
                                    {
                                        input: { runId: ... };
                                        meta: object;
                                        output: {
                                            expiresInSeconds: ...;
                                            fileName: ...;
                                            isStale: ...;
                                            patientChartId: ...;
                                            runId: ...;
                                            signedUrl: ...;
                                        };
                                    },
                                >;
                                getAnswers: QueryProcedure<
                                    {
                                        input: { runId: ... };
                                        meta: object;
                                        output: {
                                            answers: ...;
                                            formId: ...;
                                            isTerminal: ...;
                                            runId: ...;
                                            status: ...;
                                        };
                                    },
                                >;
                                getRetrievalScope: QueryProcedure<
                                    {
                                        input: { runId: ... };
                                        meta: object;
                                        output: { runId: ...; scope: ... };
                                    },
                                >;
                                getStatus: QueryProcedure<
                                    {
                                        input: { runId: ... };
                                        meta: object;
                                        output: {
                                            createdAt: ...;
                                            errorMsg: ...;
                                            finishedAt: ...;
                                            formId: ...;
                                            isTerminal: ...;
                                            patientId: ...;
                                            progress: ...;
                                            runId: ...;
                                            status: ...;
                                            totalFieldsSource: ...;
                                        };
                                    },
                                >;
                                getTemplateUrl: QueryProcedure<
                                    { input: { runId: ... }; meta: object; output: (...) | (...) },
                                >;
                                listForms: QueryProcedure<
                                    { input: void; meta: object; output: { items: ... } },
                                >;
                                refreshDocument: MutationProcedure<
                                    {
                                        input: { runId: ... };
                                        meta: object;
                                        output: { document: ...; runId: ... };
                                    },
                                >;
                                rerun: MutationProcedure<
                                    {
                                        input: {
                                            chosenContacts?: ...;
                                            includeEmr?: ...;
                                            runId: ...;
                                            selectedDocumentIds?: ...;
                                            selectedSessionIds?: ...;
                                            treatmentEpisodeId?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            patientChartId: ...;
                                            previousRunId: ...;
                                            runId: ...;
                                            status: ...;
                                        };
                                    },
                                >;
                                revertAnswer: MutationProcedure<
                                    {
                                        input: { annotationId: ...; deferRender?: ...; runId: ... };
                                        meta: object;
                                        output: { answer: ...; document: ...; runId: ... };
                                    },
                                >;
                                start: MutationProcedure<
                                    {
                                        input: {
                                            chosenContacts?: ...;
                                            formId: ...;
                                            includeEmr?: ...;
                                            patientId: ...;
                                            selectedDocumentIds?: ...;
                                            selectedSessionIds?: ...;
                                            treatmentEpisodeId?: ...;
                                        };
                                        meta: object;
                                        output: { patientChartId: ...; runId: ...; status: ... };
                                    },
                                >;
                                updateAnswer: MutationProcedure<
                                    {
                                        input: {
                                            annotationId: ...;
                                            deferRender?: ...;
                                            fontSize?: ...;
                                            runId: ...;
                                            value: ...;
                                        };
                                        meta: object;
                                        output: { answer: ...; document: ...; runId: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                    formTemplates: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: { fileName: ...; storageKey: ... };
                                        meta: object;
                                        output: { id: ... };
                                    },
                                >;
                                createUploadTarget: MutationProcedure<
                                    {
                                        input: { fileName: ...; sizeBytes: ... };
                                        meta: object;
                                        output: { bucket: ...; config: ...; key: ... };
                                    },
                                >;
                                delete: MutationProcedure<
                                    { input: { formId: ... }; meta: object; output: { id: ... } },
                                >;
                                detect: MutationProcedure<
                                    {
                                        input: { formId: ... };
                                        meta: object;
                                        output: TemplateDetection;
                                    },
                                >;
                                detectWithExtend: MutationProcedure<
                                    { input: { formId: ... }; meta: object; output: { runId: ... } },
                                >;
                                get: QueryProcedure<
                                    {
                                        input: { formId: ... };
                                        meta: object;
                                        output: {
                                            annotationCount: ...;
                                            context: ...;
                                            createdAt: ...;
                                            createdBy: ...;
                                            defaultFontSize: ...;
                                            fileName: ...;
                                            fileUrl: ...;
                                            id: ...;
                                            orgId: ...;
                                            requiredContactTypes: ...;
                                            shareWithOrg: ...;
                                            updatedAt: ...;
                                        };
                                    },
                                >;
                                getDetection: QueryProcedure<
                                    {
                                        input: { formId: ... };
                                        meta: object;
                                        output: TemplateDetection;
                                    },
                                >;
                                getDocument: QueryProcedure<
                                    {
                                        input: { formId: ... };
                                        meta: object;
                                        output: { documentUrl: ... };
                                    },
                                >;
                                getExtendDetection: QueryProcedure<
                                    {
                                        input: { formId: ...; runId: ... };
                                        meta: object;
                                        output: ExtendDetectionState;
                                    },
                                >;
                                getFields: QueryProcedure<
                                    {
                                        input: { formId: ... };
                                        meta: object;
                                        output: {
                                            conditionalRules: ...;
                                            fields: ...;
                                            formId: ...;
                                            requiredContactTypes: ...;
                                        };
                                    },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ... };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                rename: MutationProcedure<
                                    {
                                        input: { fileName: ...; formId: ... };
                                        meta: object;
                                        output: { fileName: ...; id: ... };
                                    },
                                >;
                                setOrgSharing: MutationProcedure<
                                    {
                                        input: { formId: ...; shareWithOrg: ... };
                                        meta: object;
                                        output: { id: ...; shareWithOrg: ... };
                                    },
                                >;
                                testFill: MutationProcedure<
                                    {
                                        input: {
                                            annotationIds?: ...;
                                            chosenContacts?: ...;
                                            formId: ...;
                                            includeEmr?: ...;
                                            maxAiFields?: ...;
                                            patientId: ...;
                                            renderAnswers?: ...;
                                            renderPdf?: ...;
                                            selectedDocumentIds?: ...;
                                            selectedSessionIds?: ...;
                                            treatmentEpisodeId?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            aiFieldCount: ...;
                                            aiFieldIds: ...;
                                            aiFieldsAnswered: ...;
                                            chunkSize: ...;
                                            degradations: ...;
                                            deterministicAnswerCount: ...;
                                            fields: ...;
                                            formId: ...;
                                            patientId: ...;
                                            pdf: ...;
                                            pdfOmittedReason: ...;
                                            skippedFieldIds: ...;
                                            truncated: ...;
                                            undrawnCount: ...;
                                            unpositionedCount: ...;
                                        };
                                    },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            annotations: ...;
                                            context?: ...;
                                            defaultFontSize?: ...;
                                            formId: ...;
                                        };
                                        meta: object;
                                        output: SavedTemplate;
                                    },
                                >;
                                updateConditionalRules: MutationProcedure<
                                    {
                                        input: { formId: ...; rules: ... };
                                        meta: object;
                                        output: { formId: ...; rules: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                    integrations: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                fullSync: MutationProcedure<
                                    {
                                        input: { dry_run?: ...; integration_id: ... };
                                        meta: object;
                                        output: {
                                            chart_reviews_enqueued: ...;
                                            patients_enqueued: ...;
                                            success: ...;
                                        };
                                    },
                                >;
                                getIntegrationLocations: QueryProcedure<
                                    {
                                        input: (...)
                                        | (...)
                                        | (...)
                                        | (...);
                                        meta: object;
                                        output: (...) | (...) | (...);
                                    },
                                >;
                                getPatientRunRecording: QueryProcedure<
                                    { input: { patientId: ... }; meta: object; output: { url: ... } },
                                >;
                                getPatientSyncStatus: QueryProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                syncAdmissions: MutationProcedure<
                                    {
                                        input: {
                                            dry_run?: ...;
                                            end_date?: ...;
                                            integration_id: ...;
                                            start_date?: ...;
                                        };
                                        meta: object;
                                        output: { error: ...; patients?: ...; stats?: ...; success: ... };
                                    },
                                >;
                                syncEpisode: MutationProcedure<
                                    {
                                        input: { episodeId: ...; syncDocuments?: ... };
                                        meta: object;
                                        output: SyncEpisodeServiceResult;
                                    },
                                >;
                                syncFacilityLevelsOfCare: MutationProcedure<
                                    {
                                        input: { integrationId: ... };
                                        meta: object;
                                        output: SyncFacilityLevelsOfCareServiceResult;
                                    },
                                >;
                                syncFacilityPrograms: MutationProcedure<
                                    {
                                        input: { integrationId: ... };
                                        meta: object;
                                        output: SyncFacilityProgramsServiceResult;
                                    },
                                >;
                                syncIntegration: MutationProcedure<
                                    {
                                        input: { dateRange?: ...; integrationId: ... };
                                        meta: object;
                                        output: void;
                                    },
                                >;
                                syncIntegrationEpisodes: MutationProcedure<
                                    {
                                        input: { endDate: ...; integrationId: ...; startDate: ... };
                                        meta: object;
                                        output: SyncIntegrationEpisodesServiceResult;
                                    },
                                >;
                                syncPatient: MutationProcedure<
                                    {
                                        input: { dryRun?: ...; patientId: ...; syncDocuments?: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                syncPatientEpisodes: MutationProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: DefaultValue<(...), (...)>;
                                    },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: { credentials?: ...; id: ...; label?: ...; status?: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            credentials: ...;
                                            entity_id: ...;
                                            facility_id: ...;
                                            id: ...;
                                            label: ...;
                                            last_sync: ...;
                                            status: ...;
                                            type: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                verifyEmrProxyConnection: MutationProcedure<
                                    {
                                        input: { apiKey: ...; integrationType: ...; orgId: ... };
                                        meta: object;
                                        output: EmrProxyOrgSummary;
                                    },
                                >;
                            },
                        >,
                    >;
                    metrics: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                criteriaAssistants: QueryProcedure<
                                    {
                                        input: {
                                            auditTemplateIds?: ...;
                                            cursor?: ...;
                                            dateRange: ...;
                                            facilityIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            scoreRange?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                criteriaDetail: QueryProcedure<
                                    {
                                        input: {
                                            auditTemplateId: ...;
                                            auditTemplateIds?: ...;
                                            cursor?: ...;
                                            dateRange: ...;
                                            facilityIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            profileId?: ...;
                                            scoreRange?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: { items: ...; nextCursor: ...; providers: ...; total: ... };
                                    },
                                >;
                                criteriaResponses: QueryProcedure<
                                    {
                                        input: {
                                            auditQuestionId: ...;
                                            auditTemplateId: ...;
                                            auditTemplateIds?: ...;
                                            cursor?: ...;
                                            dateRange: ...;
                                            facilityIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            profileId?: ...;
                                            scoreRange?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                            status?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                metricsFacilities: QueryProcedure<
                                    {
                                        input: {
                                            auditTemplateIds?: ...;
                                            cursor?: ...;
                                            dateRange: ...;
                                            facilityIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            scoreRange?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                metricsGrouped: QueryProcedure<
                                    {
                                        input: {
                                            auditTemplateIds?: ...;
                                            cursor?: ...;
                                            dateRange: ...;
                                            dimension: ...;
                                            facilityIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            scoreRange?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                            },
                        >,
                    >;
                    orgMembers: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                createInvite: MutationProcedure<
                                    {
                                        input: {
                                            email: ...;
                                            firstName: ...;
                                            lastName: ...;
                                            roleId: ...;
                                            title?: ...;
                                        };
                                        meta: object;
                                        output: InviteUserServiceResult;
                                    },
                                >;
                                getMemberByProfileId: QueryProcedure<
                                    {
                                        input: { profileId: ... };
                                        meta: object;
                                        output: {
                                            email: ...;
                                            first_name: ...;
                                            id: ...;
                                            is_superadmin: ...;
                                            last_name: ...;
                                            role: ...;
                                            role_id: ...;
                                            title: ...;
                                            user_id: ...;
                                        };
                                    },
                                >;
                                listPendingInvites: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listRoles: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listUsers: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            roleId?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                removeMember: MutationProcedure<
                                    {
                                        input: { profileId: ... };
                                        meta: object;
                                        output: { profileId: ... };
                                    },
                                >;
                                resendInvite: MutationProcedure<
                                    {
                                        input: { pendingInviteId: ... };
                                        meta: object;
                                        output: ResendInviteServiceResult;
                                    },
                                >;
                                updateMember: MutationProcedure<
                                    {
                                        input: {
                                            email: ...;
                                            firstName: ...;
                                            isSuperadmin: ...;
                                            lastName: ...;
                                            profileId: ...;
                                            role: ...;
                                            title?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            email: ...;
                                            first_name: ...;
                                            id: ...;
                                            is_superadmin: ...;
                                            last_name: ...;
                                            role: ...;
                                            role_id: ...;
                                            title: ...;
                                            user_id: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    orgSettings: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                list: QueryProcedure<
                                    { input: { entityId: ... }; meta: object; output: (...)[] },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: { entityId: ...; key: ...; value: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            entity_id: ...;
                                            id: ...;
                                            setting_key: ...;
                                            updated_at: ...;
                                            updated_by: ...;
                                            value: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    patientCharts: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                countForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ...; pieces?: ... };
                                        meta: object;
                                        output: { count: ... };
                                    },
                                >;
                                createForPatient: MutationProcedure<
                                    {
                                        input: { fileName: ...; patientId: ...; storageKey: ... };
                                        meta: object;
                                        output: {
                                            circle_metadata: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            embedding_count: ...;
                                            embedding_err_msg: ...;
                                            embedding_status: ...;
                                            entity_id: ...;
                                            extend_content_hash: ...;
                                            extend_run_id: ...;
                                            extend_source: ...;
                                            extended_at: ...;
                                            external_document_created_at: ...;
                                            external_document_id: ...;
                                            external_document_type: ...;
                                            external_document_updated_at: ...;
                                            file_name: ...;
                                            file_type: ...;
                                            file_url: ...;
                                            id: ...;
                                            integration_id: ...;
                                            is_ready: ...;
                                            packet_role: ...;
                                            packet_section_index: ...;
                                            page_end: ...;
                                            page_start: ...;
                                            parent_patient_chart_id: ...;
                                            patient_id: ...;
                                            raw_document: ...;
                                            run_id: ...;
                                            sources: ...;
                                            treatment_episode_id: ...;
                                            updated_at: ...;
                                        };
                                    },
                                >;
                                documentTypesForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ...; treatmentEpisodeId?: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                getById: QueryProcedure<
                                    {
                                        input: { id: ...; patientId: ... };
                                        meta: object;
                                        output: {
                                            circle_metadata: ...;
                                            created_at: ...;
                                            embedding_err_msg: ...;
                                            embedding_status: ...;
                                            external_document_type: ...;
                                            facility_timezone: ...;
                                            file_name: ...;
                                            file_type: ...;
                                            file_url: ...;
                                            id: ...;
                                            open_at_page: ...;
                                            packet: ...;
                                            packet_role: ...;
                                            page_end: ...;
                                            page_start: ...;
                                            patient_id: ...;
                                            raw_document: ...;
                                            signed_url: ...;
                                        };
                                    },
                                >;
                                getTraceLinks: QueryProcedure<
                                    {
                                        input: { patientChartId: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                listAllIdsForPatient: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            dateFrom?: ...;
                                            dateTo?: ...;
                                            externalDocumentType?: ...;
                                            fileType?: ...;
                                            patientId: ...;
                                            pieces?: ...;
                                            search?: ...;
                                            sortOrder?: ...;
                                            treatmentEpisodeId?: ...;
                                        };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                listByIds: QueryProcedure<
                                    {
                                        input: { ids: ...; patientId: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                listForPatient: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            dateFrom?: ...;
                                            dateTo?: ...;
                                            externalDocumentType?: ...;
                                            fileType?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientId: ...;
                                            pieces?: ...;
                                            search?: ...;
                                            sortOrder?: ...;
                                            treatmentEpisodeId?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listGeneratedFormsForPatient: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            dateFrom?: ...;
                                            dateTo?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientId: ...;
                                            search?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listPacketPieces: QueryProcedure<
                                    {
                                        input: { packetId: ...; patientId: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                preprocessForPatient: MutationProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: EnqueueChartPreprocessingResult;
                                    },
                                >;
                                reprocess: MutationProcedure<
                                    {
                                        input: { patientChartId: ...; patientId: ... };
                                        meta: object;
                                        output: { newRunIds: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                    patientInsurances: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                listForPatient: QueryProcedure<
                                    { input: { patientId: ... }; meta: object; output: (...)[] },
                                >;
                            },
                        >,
                    >;
                    patients: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                clonePatientToEval: MutationProcedure<
                                    {
                                        input: {
                                            auditTemplateIds?: ...;
                                            forceRun?: ...;
                                            patientId: ...;
                                        };
                                        meta: object;
                                        output: EnqueueClonePatientToEvalResult;
                                    },
                                >;
                                createPatient: MutationProcedure<
                                    {
                                        input: {
                                            addressCity?: ...;
                                            addressState?: ...;
                                            addressStreet1?: ...;
                                            addressStreet2?: ...;
                                            addressZipcode?: ...;
                                            dob?: ...;
                                            email?: ...;
                                            facilityId?: ...;
                                            firstName: ...;
                                            gender?: ...;
                                            intakeNotes?: ...;
                                            lastName: ...;
                                            phoneMobile?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            address_city: ...;
                                            address_state: ...;
                                            address_street1: ...;
                                            address_street2: ...;
                                            address_zipcode: ...;
                                            archive_reason: ...;
                                            archived: ...;
                                            archived_at: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            dob: ...;
                                            email: ...;
                                            entity_id: ...;
                                            external_patient_id: ...;
                                            external_source: ...;
                                            facility_id: ...;
                                            first_name: ...;
                                            gender: ...;
                                            intake_notes: ...;
                                            last_name: ...;
                                            last_updated_summary: ...;
                                            patient_id: ...;
                                            phone_mobile: ...;
                                            primary_provider_id: ...;
                                            status: ...;
                                            summary: ...;
                                        };
                                    },
                                >;
                                deletePatient: MutationProcedure<
                                    { input: { id: ... }; meta: object; output: { id: ... } },
                                >;
                                getCloneToEvalStatus: QueryProcedure<
                                    {
                                        input: { messageId: ... };
                                        meta: object;
                                        output: { status: ... };
                                    },
                                >;
                                getPatientById: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            address_city: ...;
                                            address_state: ...;
                                            address_street1: ...;
                                            address_street2: ...;
                                            address_zipcode: ...;
                                            archive_reason: ...;
                                            archived: ...;
                                            archived_at: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            dob: ...;
                                            email: ...;
                                            entity_id: ...;
                                            external_patient_id: ...;
                                            external_source: ...;
                                            facility_id: ...;
                                            first_name: ...;
                                            gender: ...;
                                            intake_notes: ...;
                                            last_name: ...;
                                            last_updated_summary: ...;
                                            patient_id: ...;
                                            phone_mobile: ...;
                                            primary_provider_id: ...;
                                            status: ...;
                                            summary: ...;
                                        };
                                    },
                                >;
                                getPatientDetail: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            admitted_at: ...;
                                            archived: ...;
                                            archived_at: ...;
                                            created_at: ...;
                                            discharged_at: ...;
                                            dob: ...;
                                            external_source: ...;
                                            facility_id: ...;
                                            facility_name: ...;
                                            first_name: ...;
                                            last_name: ...;
                                            last_sync: ...;
                                            last_synced_documents: ...;
                                            latest_episode_mrn: ...;
                                            patient_id: ...;
                                            primary_provider_id: ...;
                                            provider_first_name: ...;
                                            provider_last_name: ...;
                                            provider_title: ...;
                                        };
                                    },
                                >;
                                getPatientOverview: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: { patient: ...; recentSessions: ... };
                                    },
                                >;
                                listEpisodes: QueryProcedure<
                                    { input: { patientId: ... }; meta: object; output: (...)[] },
                                >;
                                listInOrganization: QueryProcedure<
                                    {
                                        input: {
                                            admissionStatus?: ...;
                                            cursor?: ...;
                                            facilityId?: ...;
                                            facilityIdsForLoc?: ...;
                                            facilityIdsForProgram?: ...;
                                            includeArchived?: ...;
                                            levelOfCareIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientIds?: ...;
                                            patientSearch?: ...;
                                            primaryProviderId?: ...;
                                            programIds?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                            status?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listProgramStays: QueryProcedure<
                                    {
                                        input: { episodeId: ...; patientId: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                mergePatients: MutationProcedure<
                                    {
                                        input: { duplicatePatientId: ...; primaryPatientId: ... };
                                        meta: object;
                                        output: ExecutePatientMergeServiceResult;
                                    },
                                >;
                                setPatientArchived: MutationProcedure<
                                    {
                                        input: { archived: ...; patientId: ... };
                                        meta: object;
                                        output: { archived: ...; patientId: ... };
                                    },
                                >;
                                updatePatient: MutationProcedure<
                                    {
                                        input: {
                                            addressCity?: ...;
                                            addressState?: ...;
                                            addressStreet1?: ...;
                                            addressStreet2?: ...;
                                            addressZipcode?: ...;
                                            dob?: ...;
                                            email?: ...;
                                            facilityId?: ...;
                                            firstName: ...;
                                            gender?: ...;
                                            id: ...;
                                            intakeNotes?: ...;
                                            lastName: ...;
                                            phoneMobile?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            address_city: ...;
                                            address_state: ...;
                                            address_street1: ...;
                                            address_street2: ...;
                                            address_zipcode: ...;
                                            archive_reason: ...;
                                            archived: ...;
                                            archived_at: ...;
                                            created_at: ...;
                                            created_by: ...;
                                            dob: ...;
                                            email: ...;
                                            entity_id: ...;
                                            external_patient_id: ...;
                                            external_source: ...;
                                            facility_id: ...;
                                            first_name: ...;
                                            gender: ...;
                                            intake_notes: ...;
                                            last_name: ...;
                                            last_updated_summary: ...;
                                            patient_id: ...;
                                            phone_mobile: ...;
                                            primary_provider_id: ...;
                                            status: ...;
                                            summary: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    patientSessions: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                delete: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            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: ...;
                                        };
                                    },
                                >;
                                generateNote: MutationProcedure<
                                    {
                                        input: {
                                            endedAt?: ...;
                                            fileUrl?: ...;
                                            manualText?: ...;
                                            patientId: ...;
                                            startedAt?: ...;
                                            templateId: ...;
                                        };
                                        meta: object;
                                        output: ProcessTextNoteResult;
                                    },
                                >;
                                getById: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: { patientSession: ...; sessionAuditRunIds: ... };
                                    },
                                >;
                                getLastTemplateForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: { templateId: ... };
                                    },
                                >;
                                getPlaybackUrl: QueryProcedure<
                                    {
                                        input: { sessionId: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                getRecentSessions: QueryProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: { sessions: ... };
                                    },
                                >;
                                listEvidenceOptions: QueryProcedure<
                                    {
                                        input: { limit?: ...; patientId: ... };
                                        meta: object;
                                        output: { items: ...; total: ... };
                                    },
                                >;
                                listForCurrentUser: QueryProcedure<
                                    {
                                        input: { from: ...; to: ... };
                                        meta: object;
                                        output: { sessions: ... };
                                    },
                                >;
                                listForPatient: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            dateFrom?: ...;
                                            dateTo?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            patientId: ...;
                                            search?: ...;
                                            sortOrder?: ...;
                                            status?: ...;
                                            templateIds?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                modifyAiNote: MutationProcedure<
                                    {
                                        input: { customPrompt?: ...; optionId: ...; sessionId: ... };
                                        meta: object;
                                        output: { ai_generated_note: ... };
                                    },
                                >;
                                regenerateCodes: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: GenerateSessionCodesResult;
                                    },
                                >;
                                switchTemplate: MutationProcedure<
                                    {
                                        input: { sessionId: ...; templateId: ... };
                                        meta: object;
                                        output: RegenerateNoteResult;
                                    },
                                >;
                                updateAiSummarizedNote: MutationProcedure<
                                    {
                                        input: { aiSummarizedNote: ...; id: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                updateCodes: MutationProcedure<
                                    {
                                        input: { codes: ...; codeType: ...; id: ... };
                                        meta: object;
                                        output: (...) | (...);
                                    },
                                >;
                                updatePrivateNote: MutationProcedure<
                                    {
                                        input: { id: ...; privateNote: ... };
                                        meta: object;
                                        output: {
                                            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: ...;
                                        };
                                    },
                                >;
                                updateSessionTime: MutationProcedure<
                                    {
                                        input: { endTimestamp: ...; id: ...; startTimestamp: ... };
                                        meta: object;
                                        output: {
                                            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: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    patientUtilizationReviews: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                listForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ...; treatmentEpisodeId?: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                            },
                        >,
                    >;
                    profiles: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                listEmrProfiles: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listInOrganization: QueryProcedure<
                                    {
                                        input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                updateProfile: MutationProcedure<
                                    {
                                        input: { firstName: ...; lastName: ...; title?: ... };
                                        meta: object;
                                        output: {
                                            clinic_size: ...;
                                            created_at: ...;
                                            customer_id: ...;
                                            email: ...;
                                            expectations: ...;
                                            external_system: ...;
                                            external_system_id: ...;
                                            first_name: ...;
                                            hear_about_us: ...;
                                            id: ...;
                                            is_superadmin: ...;
                                            last_name: ...;
                                            last_updated: ...;
                                            price_id: ...;
                                            profile_type: ...;
                                            session_limit: ...;
                                            subscription_status: ...;
                                            title: ...;
                                            user_id: ...;
                                            vertical: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    programStays: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                listForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ...; treatmentEpisodeId?: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                            },
                        >,
                    >;
                    reviewDashboard: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                bulkArchive: MutationProcedure<
                                    {
                                        input: {
                                            auditTemplateIds?: ...;
                                            dateRange?: ...;
                                            includeNullTriggers?: ...;
                                            patientIds?: ...;
                                            preview?: ...;
                                            scoreRange?: ...;
                                            triggerIds?: ...;
                                        };
                                        meta: object;
                                        output: BulkArchiveAuditRunsOutput;
                                    },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: {
                                            admissionDateRange?: ...;
                                            admissionStatus?: ...;
                                            auditTemplateIds?: ...;
                                            authEndDateRange?: ...;
                                            authStartDateRange?: ...;
                                            clientSearch?: ...;
                                            clinicalLevelOfCareIds?: ...;
                                            criteriaStatuses?: ...;
                                            cursor?: ...;
                                            dateRange?: ...;
                                            facilityIds?: ...;
                                            facilityIdsForClinicalLoc?: ...;
                                            facilityIdsForLoc?: ...;
                                            facilityIdsForProgram?: ...;
                                            facilityIdsForUrLoc?: ...;
                                            hasUnansweredManual?: ...;
                                            includeNullTriggers?: ...;
                                            levelOfCareIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            profileIds?: ...;
                                            programIds?: ...;
                                            scoreRange?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                            triggerIds?: ...;
                                            type?: ...;
                                            urLevelOfCareIds?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                listGrouped: QueryProcedure<
                                    {
                                        input: {
                                            admissionDateRange?: ...;
                                            admissionStatus?: ...;
                                            auditTemplateIds?: ...;
                                            authEndDateRange?: ...;
                                            authStartDateRange?: ...;
                                            clientSearch?: ...;
                                            clinicalLevelOfCareIds?: ...;
                                            criteriaStatuses?: ...;
                                            cursor?: ...;
                                            dateRange?: ...;
                                            facilityIds?: ...;
                                            facilityIdsForClinicalLoc?: ...;
                                            facilityIdsForLoc?: ...;
                                            facilityIdsForProgram?: ...;
                                            facilityIdsForUrLoc?: ...;
                                            hasUnansweredManual?: ...;
                                            includeNullTriggers?: ...;
                                            levelOfCareIds?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            profileIds?: ...;
                                            programIds?: ...;
                                            scoreRange?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                            triggerIds?: ...;
                                            type?: ...;
                                            urLevelOfCareIds?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                            },
                        >,
                    >;
                    rulebook: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: {
                                            conceptId: ...;
                                            gradeOpenPeriods?: ...;
                                            quantifier?: ...;
                                            spec: ...;
                                            trigger: ...;
                                            window: ...;
                                        };
                                        meta: object;
                                        output: CreateRuleOutput;
                                    },
                                >;
                                evaluateRuleNow: MutationProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: ListFindingsOutput;
                                    },
                                >;
                                get: QueryProcedure<
                                    { input: { id: ... }; meta: object; output: RuleSummaryDto },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: { enabled?: ... };
                                        meta: object;
                                        output: ListRulesOutput;
                                    },
                                >;
                                listFindings: QueryProcedure<
                                    {
                                        input: { patientId: ... };
                                        meta: object;
                                        output: ListFindingsOutput;
                                    },
                                >;
                                revise: MutationProcedure<
                                    {
                                        input: {
                                            conceptId: ...;
                                            gradeOpenPeriods?: ...;
                                            quantifier?: ...;
                                            ruleId: ...;
                                            spec: ...;
                                            trigger: ...;
                                            window: ...;
                                        };
                                        meta: object;
                                        output: ReviseRuleOutput;
                                    },
                                >;
                                setEnabled: MutationProcedure<
                                    {
                                        input: { enabled: ...; ruleId: ... };
                                        meta: object;
                                        output: SetRuleEnabledOutput;
                                    },
                                >;
                                softDelete: MutationProcedure<
                                    {
                                        input: { reason: ...; ruleId: ... };
                                        meta: object;
                                        output: SoftDeleteRuleOutput;
                                    },
                                >;
                            },
                        >,
                    >;
                    savedFilters: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: {
                                            columnVisibility?: ...;
                                            filters: ...;
                                            name: ...;
                                            pageKey: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                            viewMode?: ...;
                                        };
                                        meta: object;
                                        output: SavedViewDto;
                                    },
                                >;
                                delete: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: DeleteSavedFilterOutput;
                                    },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: { pageKey: ... };
                                        meta: object;
                                        output: ListSavedFiltersOutput;
                                    },
                                >;
                                rename: MutationProcedure<
                                    {
                                        input: { id: ...; name: ... };
                                        meta: object;
                                        output: SavedViewDto;
                                    },
                                >;
                                resolveLabels: QueryProcedure<
                                    {
                                        input: {
                                            assignees?: ...;
                                            assistantIds?: ...;
                                            facilityIds?: ...;
                                            patientIds?: ...;
                                            providerIds?: ...;
                                            triggerIds?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            assigneeItems: ...;
                                            assistantItems: ...;
                                            facilityItems: ...;
                                            patientItems: ...;
                                            providerItems: ...;
                                            triggerItems: ...;
                                        };
                                    },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            columnVisibility: ...;
                                            filters: ...;
                                            id: ...;
                                            sortBy: ...;
                                            sortOrder: ...;
                                            viewMode: ...;
                                        };
                                        meta: object;
                                        output: SavedViewDto;
                                    },
                                >;
                            },
                        >,
                    >;
                    storage: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                createSessionUploadTarget: MutationProcedure<
                                    {
                                        input: { contentType: ...; patientId: ... };
                                        meta: object;
                                        output: { bucket: ...; config: ...; key: ... };
                                    },
                                >;
                                uploadCredentials: QueryProcedure<
                                    { input: void; meta: object; output: StorageCredentials },
                                >;
                            },
                        >,
                    >;
                    superadmin: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                aiFeedback: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            addComment: ...;
                                            createLinearIssue: ...;
                                            deleteComment: ...;
                                            list: ...;
                                            listComments: ...;
                                            setSeverity: ...;
                                            setStatus: ...;
                                            updateComment: ...;
                                        },
                                    >,
                                >;
                                auditRuns: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            compareQuestion: ...;
                                            getQuestionById: ...;
                                            list: ...;
                                            requeue: ...;
                                            rerunQuestionV3: ...;
                                            resolveCompareDefaults: ...;
                                        },
                                    >,
                                >;
                                automationRuns: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            filterOptions: ...;
                                            get: ...;
                                            getRecording: ...;
                                            list: ...;
                                            listGroupedByPatient: ...;
                                            retry: ...;
                                        },
                                    >,
                                >;
                                evalClones: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<{ delete: ...; list: ... }>,
                                >;
                                evals: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            createDatasetExamples: ...;
                                            runDateResolutionExperiment: ...;
                                            runExpandQuestionExperiment: ...;
                                            runExperiment: ...;
                                        },
                                    >,
                                >;
                                impersonation: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            endImpersonation: ...;
                                            getCurrentImpersonation: ...;
                                            startImpersonation: ...;
                                            startUserImpersonation: ...;
                                        },
                                    >,
                                >;
                                orgs: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        { create: ...; get: ...; list: ...; setArchived: ... },
                                    >,
                                >;
                                orgUsers: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            list: ...;
                                            listClients: ...;
                                            listRoles: ...;
                                            transferClients: ...;
                                            updateRole: ...;
                                        },
                                    >,
                                >;
                                templates: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<
                                        {
                                            list: ...;
                                            listCreators: ...;
                                            listForExport: ...;
                                            restore: ...;
                                        },
                                    >,
                                >;
                                usage: BuiltRouter<
                                    {
                                        ctx: TRPCContext;
                                        errorShape: DefaultErrorShape;
                                        meta: object;
                                        transformer: false;
                                    },
                                    DecorateCreateRouterOptions<{ get: ...; listFacilities: ... }>,
                                >;
                            },
                        >,
                    >;
                    teams: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                addTeamMembers: MutationProcedure<
                                    {
                                        input: { profileIds: ...; teamId: ... };
                                        meta: object;
                                        output: (...)[];
                                    },
                                >;
                                createTeam: MutationProcedure<
                                    {
                                        input: { memberIds: ...; name: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            created_by: ...;
                                            entity_id: ...;
                                            id: ...;
                                            name: ...;
                                        };
                                    },
                                >;
                                listTeams: QueryProcedure<
                                    { input: void; meta: object; output: (...)[] },
                                >;
                                removeTeamMember: MutationProcedure<
                                    {
                                        input: { profileId: ...; teamId: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            id: ...;
                                            profile_id: ...;
                                            team_id: ...;
                                            user_entity_id: ...;
                                            user_id: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    templates: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: {
                                            additionalAiInstructions?: ...;
                                            checkCpt?: ...;
                                            checkDsm5?: ...;
                                            checkIcd10?: ...;
                                            hiddenInstructions?: ...;
                                            isAllowBulletPoints?: ...;
                                            isUnstructuredNarrative?: ...;
                                            linkedAuditTemplateIds?: ...;
                                            sections?: ...;
                                            title: ...;
                                        };
                                        meta: object;
                                        output: {
                                            additional_ai_instructions: ...;
                                            check_cpt: ...;
                                            check_demo: ...;
                                            check_dsm_5: ...;
                                            check_icd_10: ...;
                                            created_by: ...;
                                            created_by_circle: ...;
                                            deleted: ...;
                                            hidden_instructions: ...;
                                            id: ...;
                                            is_allow_bullet_points: ...;
                                            is_unstructured_narrative: ...;
                                            last_updated: ...;
                                            last_used: ...;
                                            original_template_id: ...;
                                            shared_with_org_id: ...;
                                            title: ...;
                                        };
                                    },
                                >;
                                delete: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            additional_ai_instructions: ...;
                                            check_cpt: ...;
                                            check_demo: ...;
                                            check_dsm_5: ...;
                                            check_icd_10: ...;
                                            created_by: ...;
                                            created_by_circle: ...;
                                            deleted: ...;
                                            hidden_instructions: ...;
                                            id: ...;
                                            is_allow_bullet_points: ...;
                                            is_unstructured_narrative: ...;
                                            last_updated: ...;
                                            last_used: ...;
                                            original_template_id: ...;
                                            shared_with_org_id: ...;
                                            title: ...;
                                        };
                                    },
                                >;
                                duplicate: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            additional_ai_instructions: ...;
                                            check_cpt: ...;
                                            check_demo: ...;
                                            check_dsm_5: ...;
                                            check_icd_10: ...;
                                            created_by: ...;
                                            created_by_circle: ...;
                                            deleted: ...;
                                            hidden_instructions: ...;
                                            id: ...;
                                            is_allow_bullet_points: ...;
                                            is_unstructured_narrative: ...;
                                            last_updated: ...;
                                            last_used: ...;
                                            original_template_id: ...;
                                            shared_with_org_id: ...;
                                            title: ...;
                                        };
                                    },
                                >;
                                getById: QueryProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: { linkedAuditTemplates: ...; sections: ...; template: ... };
                                    },
                                >;
                                list: QueryProcedure<
                                    {
                                        input: {
                                            cursor?: ...;
                                            deletedOnly?: ...;
                                            includeDeleted?: ...;
                                            limit?: ...;
                                            offset?: ...;
                                            search?: ...;
                                            sortBy?: ...;
                                            sortOrder?: ...;
                                        };
                                        meta: object;
                                        output: PaginatedResponse<(...)>;
                                    },
                                >;
                                restore: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            additional_ai_instructions: ...;
                                            check_cpt: ...;
                                            check_demo: ...;
                                            check_dsm_5: ...;
                                            check_icd_10: ...;
                                            created_by: ...;
                                            created_by_circle: ...;
                                            deleted: ...;
                                            hidden_instructions: ...;
                                            id: ...;
                                            is_allow_bullet_points: ...;
                                            is_unstructured_narrative: ...;
                                            last_updated: ...;
                                            last_used: ...;
                                            original_template_id: ...;
                                            shared_with_org_id: ...;
                                            title: ...;
                                        };
                                    },
                                >;
                                toggleSharing: MutationProcedure<
                                    {
                                        input: { id: ...; shared: ... };
                                        meta: object;
                                        output: {
                                            additional_ai_instructions: ...;
                                            check_cpt: ...;
                                            check_demo: ...;
                                            check_dsm_5: ...;
                                            check_icd_10: ...;
                                            created_by: ...;
                                            created_by_circle: ...;
                                            deleted: ...;
                                            hidden_instructions: ...;
                                            id: ...;
                                            is_allow_bullet_points: ...;
                                            is_unstructured_narrative: ...;
                                            last_updated: ...;
                                            last_used: ...;
                                            original_template_id: ...;
                                            shared_with_org_id: ...;
                                            title: ...;
                                        };
                                    },
                                >;
                                update: MutationProcedure<
                                    {
                                        input: {
                                            additionalAiInstructions?: ...;
                                            checkCpt?: ...;
                                            checkDsm5?: ...;
                                            checkIcd10?: ...;
                                            hiddenInstructions?: ...;
                                            id: ...;
                                            isAllowBulletPoints?: ...;
                                            isUnstructuredNarrative?: ...;
                                            linkedAuditTemplateIds?: ...;
                                            sections?: ...;
                                            title?: ...;
                                        };
                                        meta: object;
                                        output: {
                                            additional_ai_instructions: ...;
                                            check_cpt: ...;
                                            check_demo: ...;
                                            check_dsm_5: ...;
                                            check_icd_10: ...;
                                            created_by: ...;
                                            created_by_circle: ...;
                                            deleted: ...;
                                            hidden_instructions: ...;
                                            id: ...;
                                            is_allow_bullet_points: ...;
                                            is_unstructured_narrative: ...;
                                            last_updated: ...;
                                            last_used: ...;
                                            original_template_id: ...;
                                            shared_with_org_id: ...;
                                            title: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    userPrompts: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                create: MutationProcedure<
                                    {
                                        input: { prompt: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            id: ...;
                                            is_pinned: ...;
                                            prompt: ...;
                                            user_id: ...;
                                        };
                                    },
                                >;
                                delete: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            id: ...;
                                            is_pinned: ...;
                                            prompt: ...;
                                            user_id: ...;
                                        };
                                    },
                                >;
                                list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                togglePin: MutationProcedure<
                                    {
                                        input: { id: ... };
                                        meta: object;
                                        output: {
                                            created_at: ...;
                                            id: ...;
                                            is_pinned: ...;
                                            prompt: ...;
                                            user_id: ...;
                                        };
                                    },
                                >;
                            },
                        >,
                    >;
                    utilization: BuiltRouter<
                        {
                            ctx: TRPCContext;
                            errorShape: DefaultErrorShape;
                            meta: object;
                            transformer: false;
                        },
                        DecorateCreateRouterOptions<
                            {
                                episodeAuthorizations: QueryProcedure<
                                    {
                                        input: { patientId: ...; treatmentEpisodeId: ... };
                                        meta: object;
                                        output: { authorizations: ...; canSeePayer: ... };
                                    },
                                >;
                                facilityLedger: QueryProcedure<
                                    {
                                        input: (...) & (...);
                                        meta: object;
                                        output: {
                                            canSeePayer: ...;
                                            facility: ...;
                                            freshness: ...;
                                            programs: ...;
                                            rows: ...;
                                            serviceTypes: ...;
                                        };
                                    },
                                >;
                                listFacilities: QueryProcedure<
                                    {
                                        input: { from: ...; to: ... };
                                        meta: object;
                                        output: { activePatients: ...; facilities: ...; freshness: ... };
                                    },
                                >;
                                listForPatient: QueryProcedure<
                                    {
                                        input: { patientId: ...; treatmentEpisodeId?: ... };
                                        meta: object;
                                        output: { events: ...; timezone: ... };
                                    },
                                >;
                            },
                        >,
                    >;
                },
            >,
        >,
    >

    Type Declaration

      • (): TRPCClient<
            BuiltRouter<
                {
                    ctx: TRPCContext;
                    errorShape: DefaultErrorShape;
                    meta: object;
                    transformer: false;
                },
                DecorateCreateRouterOptions<
                    {
                        actionItems: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    bulkApply: MutationProcedure<
                                        {
                                            input: {
                                                assignee?: ...;
                                                items: ...;
                                                nextStep?: ...;
                                                status?: ...;
                                            };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    getQuestionDetail: QueryProcedure<
                                        {
                                            input: { responseId: ... };
                                            meta: object;
                                            output: {
                                                assignee_id: ...;
                                                assignee_name: ...;
                                                assignee_type: ...;
                                                next_step: ...;
                                                reason: ...;
                                                recommendation: ...;
                                                response: ...;
                                                response_id: ...;
                                                short_form_response: ...;
                                                status: ...;
                                            };
                                        },
                                    >;
                                    listAssignees: QueryProcedure<
                                        {
                                            input: { search?: ... };
                                            meta: object;
                                            output: ListAssigneesResult;
                                        },
                                    >;
                                    listQuestions: QueryProcedure<
                                        {
                                            input: {
                                                admissionStatus?: ...;
                                                assigneeContactIds?: ...;
                                                assigneeIds?: ...;
                                                auditTemplateIds?: ...;
                                                authEndDateRange?: ...;
                                                cursor?: ...;
                                                facilityIds?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                facilityIdsForUrLoc?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                nextSteps?: ...;
                                                offset?: ...;
                                                programIds?: ...;
                                                providerIds?: ...;
                                                runDateRange?: ...;
                                                search?: ...;
                                                sortBy: ...;
                                                sortOrder: ...;
                                                statuses: ...;
                                                urLevelOfCareIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    updateActionItem: MutationProcedure<
                                        {
                                            input: {
                                                assignee?: ...;
                                                auditQuestionId: ...;
                                                nextStep?: ...;
                                                patientId: ...;
                                            };
                                            meta: object;
                                            output: {
                                                assigned_contact_id: ...;
                                                assigned_to: ...;
                                                audit_question_id: ...;
                                                created_at: ...;
                                                id: ...;
                                                next_steps: ...;
                                                patient_id: ...;
                                                updated_at: ...;
                                                updated_by: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        aiFeedback: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listOwn: QueryProcedure<
                                        {
                                            input: { patientId: ...; targetRefs: ... };
                                            meta: object;
                                            output: ListOwnAiFeedbackOutput;
                                        },
                                    >;
                                    retract: MutationProcedure<
                                        {
                                            input: { patientId: ...; targetRef: ... };
                                            meta: object;
                                            output: RetractAiFeedbackOutput;
                                        },
                                    >;
                                    submit: MutationProcedure<
                                        {
                                            input: {
                                                auditQuestionId?: ...;
                                                auditResponseId?: ...;
                                                auditRunId?: ...;
                                                comment?: ...;
                                                conversationId?: ...;
                                                correction?: ...;
                                                flow: ...;
                                                messageId?: ...;
                                                patientId: ...;
                                                patientSessionId?: ...;
                                                rating: ...;
                                                targetRef: ...;
                                                targetSnapshot?: ...;
                                                threadSnapshot?: ...;
                                            };
                                            meta: object;
                                            output: SubmitAiFeedbackOutput;
                                        },
                                    >;
                                },
                            >,
                        >;
                        auditRuns: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    archive: MutationProcedure<
                                        { input: { id: ... }; meta: object; output: { archived: ... } },
                                    >;
                                    createResponseTrail: MutationProcedure<
                                        {
                                            input: (...)
                                            | (...);
                                            meta: object;
                                            output: {
                                                audit_response_id: ...;
                                                comment: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                id: ...;
                                                marked_as: ...;
                                                response: ...;
                                            };
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                auditRun: ...;
                                                documentWait: ...;
                                                hasPendingResponses: ...;
                                                isWaitingForDocuments: ...;
                                                lastSync: ...;
                                                responses: ...;
                                                scopedCharts: ...;
                                                score: ...;
                                                statusCounts: ...;
                                                templateQuestionCount: ...;
                                            };
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                excludeAuditRunIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                resultStatus?: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                templateIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listQuestionRunHistory: QueryProcedure<
                                        {
                                            input: {
                                                auditQuestionId: ...;
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listRecentForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ...; type?: ... };
                                            meta: object;
                                            output: ListRecentPatientReviewRunsServiceResult;
                                        },
                                    >;
                                    rerunQuestion: MutationProcedure<
                                        {
                                            input: {
                                                auditQuestionId: ...;
                                                auditRunId: ...;
                                                questionText?: ...;
                                            };
                                            meta: object;
                                            output: { auditRunId: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        auditTemplates: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                customReviewCriteriaPrompt?: ...;
                                                customSummaryPrompt?: ...;
                                                description?: ...;
                                                name: ...;
                                                questions?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    duplicate: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { auditTemplate: ...; questions: ...; triggers: ... };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                deletedOnly?: ...;
                                                includeDeleted?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    restore: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    toggleSharing: MutationProcedure<
                                        {
                                            input: { id: ...; shared: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                customReviewCriteriaPrompt?: ...;
                                                customSummaryPrompt?: ...;
                                                description?: ...;
                                                id: ...;
                                                name?: ...;
                                                questions?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        census: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    facility: QueryProcedure<
                                        {
                                            input: { facilityId: ... };
                                            meta: object;
                                            output: { asOf: ...; facility: ...; programs: ...; totals: ... };
                                        },
                                    >;
                                    listFacilities: QueryProcedure<
                                        {
                                            input: void;
                                            meta: object;
                                            output: {
                                                activeMembers: ...;
                                                ageBands: ...;
                                                asOf: ...;
                                                facilities: ...;
                                            };
                                        },
                                    >;
                                    programMembers: QueryProcedure<
                                        {
                                            input: { facilityId: ...; facilityProgramId: ... };
                                            meta: object;
                                            output: { asOf: ...; facility: ...; members: ...; program: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        chartReview: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    releaseParkedRun: MutationProcedure<
                                        {
                                            input: { auditRunId: ... };
                                            meta: object;
                                            output: { released: ... };
                                        },
                                    >;
                                    run: MutationProcedure<
                                        {
                                            input: {
                                                auditSource?: ...;
                                                patientChartIds?: ...;
                                                patientId: ...;
                                                sessionId?: ...;
                                                templateIds: ...;
                                                treatmentEpisodeId?: ...;
                                                trigger?: ...;
                                                triggeredAt?: ...;
                                            };
                                            meta: object;
                                            output: { auditRunIds: ... };
                                        },
                                    >;
                                    syncAndRun: MutationProcedure<
                                        {
                                            input: { episodeId?: ...; patientId: ...; templateIds: ... };
                                            meta: object;
                                            output: SyncAndRunOutput;
                                        },
                                    >;
                                },
                            >,
                        >;
                        chartReviewTriggers: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    check: MutationProcedure<
                                        {
                                            input: { patientId?: ...; triggerId?: ... };
                                            meta: object;
                                            output: CheckTriggersForEntityResult;
                                        },
                                    >;
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds: ...;
                                                clinicalLevelsOfCare?: ...;
                                                facilities?: ...;
                                                intervalSeconds: ...;
                                                name: ...;
                                                programs?: ...;
                                                schedule?: ...;
                                                timeAfterTriggerSeconds: ...;
                                                triggerType: ...;
                                                urLevelsOfCare?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                audit_template_id: ...;
                                                audit_templates: ...;
                                                created_at: ...;
                                                deleted: ...;
                                                enabled: ...;
                                                entity_id: ...;
                                                filters: ...;
                                                id: ...;
                                                interval_seconds: ...;
                                                last_run_at: ...;
                                                name: ...;
                                                schedule: ...;
                                                time_after_trigger_seconds: ...;
                                                trigger_type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { triggerId: ... };
                                            meta: object;
                                            output: {
                                                audit_template_id: ...;
                                                created_at: ...;
                                                deleted: ...;
                                                enabled: ...;
                                                entity_id: ...;
                                                filters: ...;
                                                id: ...;
                                                interval_seconds: ...;
                                                last_run_at: ...;
                                                name: ...;
                                                schedule: ...;
                                                time_after_trigger_seconds: ...;
                                                trigger_type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds: ...;
                                                clinicalLevelsOfCare?: ...;
                                                facilities?: ...;
                                                id: ...;
                                                intervalSeconds: ...;
                                                name: ...;
                                                programs?: ...;
                                                schedule?: ...;
                                                timeAfterTriggerSeconds: ...;
                                                urLevelsOfCare?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                audit_template_id: ...;
                                                audit_templates: ...;
                                                created_at: ...;
                                                deleted: ...;
                                                enabled: ...;
                                                entity_id: ...;
                                                filters: ...;
                                                id: ...;
                                                interval_seconds: ...;
                                                last_run_at: ...;
                                                name: ...;
                                                schedule: ...;
                                                time_after_trigger_seconds: ...;
                                                trigger_type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        chat: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    sendMessage: MutationProcedure<
                                        {
                                            input: { conversationId?: ...; messages: ...; patientId: ... };
                                            meta: object;
                                            output: RunCaseReviewChatResult;
                                        },
                                    >;
                                },
                            >,
                        >;
                        contacts: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { contactTypeId?: ...; fieldValues?: ... };
                                            meta: object;
                                            output: {
                                                contact_id: ...;
                                                contact_type: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                org_id: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { contactId: ... }; meta: object; output: void },
                                    >;
                                    get: QueryProcedure<
                                        {
                                            input: { contactId: ... };
                                            meta: object;
                                            output: {
                                                contact_id: ...;
                                                contact_type: ...;
                                                contact_type_id: ...;
                                                contact_type_name: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                fieldValues: ...;
                                                org_id: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                contactTypeId?: ...;
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                contactId: ...;
                                                contactTypeId?: ...;
                                                fieldValues?: ...;
                                            };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                },
                            >,
                        >;
                        contactTypes: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { customFields?: ...; name: ... };
                                            meta: object;
                                            output: {
                                                contact_type_id: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                org_id: ...;
                                                type: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { contactTypeId: ... }; meta: object; output: void },
                                    >;
                                    get: QueryProcedure<
                                        {
                                            input: { contactTypeId: ... };
                                            meta: object;
                                            output: {
                                                contact_type_id: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                fields: ...;
                                                org_id: ...;
                                                type: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                contactTypeId: ...;
                                                fieldIdsToRemove?: ...;
                                                fieldsToAdd?: ...;
                                                name?: ...;
                                            };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                },
                            >,
                        >;
                        dictionary: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    createConcept: MutationProcedure<
                                        {
                                            input: { name: ...; subject: ... };
                                            meta: object;
                                            output: { id: ...; name: ... };
                                        },
                                    >;
                                    listChartTitleLocations: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientSearch?: ...;
                                                title: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listChartTitlePatterns: QueryProcedure<
                                        {
                                            input: {
                                                conceptIds?: ...;
                                                cursor?: ...;
                                                facilityIds?: ...;
                                                includeMapped: ...;
                                                kind?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sort?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listChartTitlePatternTitles: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patternId: ...;
                                                titleSearch?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listConcepts: QueryProcedure<
                                        { input: { subject: ... }; meta: object; output: (...)[] },
                                    >;
                                    listConceptsWithRules: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sort?: ...;
                                                sortOrder?: ...;
                                                subject: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listConceptTitleRules: QueryProcedure<
                                        {
                                            input: { conceptId: ... };
                                            meta: object;
                                            output: ConceptTitleRules;
                                        },
                                    >;
                                    listCredentialEntries: QueryProcedure<
                                        { input: { search?: ... }; meta: object; output: (...)[] },
                                    >;
                                    listCredentialEntriesPage: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listCredentialProviders: QueryProcedure<
                                        {
                                            input: {
                                                credential: ...;
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                providerSearch?: ...;
                                            };
                                            meta: object;
                                            output: { items: ...; nextCursor: ...; summary: ...; total: ... };
                                        },
                                    >;
                                    listCredentials: QueryProcedure<
                                        {
                                            input: { includeMapped: ...; search?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listCredentialsPage: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                includeMapped: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listLevelOfCareEntries: QueryProcedure<
                                        { input: { search?: ... }; meta: object; output: (...)[] },
                                    >;
                                    listUnmappedLevelOfCareNames: QueryProcedure<
                                        { input: { search?: ... }; meta: object; output: (...)[] },
                                    >;
                                    mapChartTitlesToConcept: MutationProcedure<
                                        {
                                            input: { conceptId: ...; exactTitles: ...; patterns: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                    mapCredentials: MutationProcedure<
                                        {
                                            input: { conceptId: ...; credentials: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    mapLevelOfCareNames: MutationProcedure<
                                        {
                                            input: { conceptId: ...; levelOfCareIds: ...; programIds: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    saveCircleMatchers: MutationProcedure<
                                        {
                                            input: { conceptId: ...; matchers: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                    saveConceptExactTitles: MutationProcedure<
                                        {
                                            input: { conceptId: ...; titles: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                    unmapCredentials: MutationProcedure<
                                        {
                                            input: { conceptId: ...; matcherIds: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    unmapLevelOfCareNames: MutationProcedure<
                                        {
                                            input: { conceptId: ...; matcherIds: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    unmapTitlePattern: MutationProcedure<
                                        {
                                            input: { conceptId: ...; ruleId: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        facilities: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { integration?: ...; name: ...; timezone: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { id: ... }; meta: object; output: { success: ... } },
                                    >;
                                    hasEmrIntegratedFacilities: QueryProcedure<
                                        { input: void; meta: object; output: boolean },
                                    >;
                                    listInOrganization: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listWithFilterOptions: QueryProcedure<
                                        { input: void; meta: object; output: (...)[] },
                                    >;
                                    listWithIntegrations: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listWithIntegrationsPage: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listWithLevelsOfCare: QueryProcedure<
                                        { input: void; meta: object; output: (...)[] },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                admissionStartSource?: ...;
                                                id: ...;
                                                integration?: ...;
                                                name: ...;
                                                timezone?: ...;
                                            };
                                            meta: object;
                                            output: UpdateFacilityWithIntegrationResult;
                                        },
                                    >;
                                },
                            >,
                        >;
                        formRuns: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    deleteDocument: MutationProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: { deleted: ...; runId: ... };
                                        },
                                    >;
                                    download: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: {
                                                expiresInSeconds: ...;
                                                fileName: ...;
                                                isStale: ...;
                                                patientChartId: ...;
                                                runId: ...;
                                                signedUrl: ...;
                                            };
                                        },
                                    >;
                                    getAnswers: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: {
                                                answers: ...;
                                                formId: ...;
                                                isTerminal: ...;
                                                runId: ...;
                                                status: ...;
                                            };
                                        },
                                    >;
                                    getRetrievalScope: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: { runId: ...; scope: ... };
                                        },
                                    >;
                                    getStatus: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: {
                                                createdAt: ...;
                                                errorMsg: ...;
                                                finishedAt: ...;
                                                formId: ...;
                                                isTerminal: ...;
                                                patientId: ...;
                                                progress: ...;
                                                runId: ...;
                                                status: ...;
                                                totalFieldsSource: ...;
                                            };
                                        },
                                    >;
                                    getTemplateUrl: QueryProcedure<
                                        { input: { runId: ... }; meta: object; output: (...) | (...) },
                                    >;
                                    listForms: QueryProcedure<
                                        { input: void; meta: object; output: { items: ... } },
                                    >;
                                    refreshDocument: MutationProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: { document: ...; runId: ... };
                                        },
                                    >;
                                    rerun: MutationProcedure<
                                        {
                                            input: {
                                                chosenContacts?: ...;
                                                includeEmr?: ...;
                                                runId: ...;
                                                selectedDocumentIds?: ...;
                                                selectedSessionIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                patientChartId: ...;
                                                previousRunId: ...;
                                                runId: ...;
                                                status: ...;
                                            };
                                        },
                                    >;
                                    revertAnswer: MutationProcedure<
                                        {
                                            input: { annotationId: ...; deferRender?: ...; runId: ... };
                                            meta: object;
                                            output: { answer: ...; document: ...; runId: ... };
                                        },
                                    >;
                                    start: MutationProcedure<
                                        {
                                            input: {
                                                chosenContacts?: ...;
                                                formId: ...;
                                                includeEmr?: ...;
                                                patientId: ...;
                                                selectedDocumentIds?: ...;
                                                selectedSessionIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: { patientChartId: ...; runId: ...; status: ... };
                                        },
                                    >;
                                    updateAnswer: MutationProcedure<
                                        {
                                            input: {
                                                annotationId: ...;
                                                deferRender?: ...;
                                                fontSize?: ...;
                                                runId: ...;
                                                value: ...;
                                            };
                                            meta: object;
                                            output: { answer: ...; document: ...; runId: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        formTemplates: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { fileName: ...; storageKey: ... };
                                            meta: object;
                                            output: { id: ... };
                                        },
                                    >;
                                    createUploadTarget: MutationProcedure<
                                        {
                                            input: { fileName: ...; sizeBytes: ... };
                                            meta: object;
                                            output: { bucket: ...; config: ...; key: ... };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { formId: ... }; meta: object; output: { id: ... } },
                                    >;
                                    detect: MutationProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: TemplateDetection;
                                        },
                                    >;
                                    detectWithExtend: MutationProcedure<
                                        { input: { formId: ... }; meta: object; output: { runId: ... } },
                                    >;
                                    get: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: {
                                                annotationCount: ...;
                                                context: ...;
                                                createdAt: ...;
                                                createdBy: ...;
                                                defaultFontSize: ...;
                                                fileName: ...;
                                                fileUrl: ...;
                                                id: ...;
                                                orgId: ...;
                                                requiredContactTypes: ...;
                                                shareWithOrg: ...;
                                                updatedAt: ...;
                                            };
                                        },
                                    >;
                                    getDetection: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: TemplateDetection;
                                        },
                                    >;
                                    getDocument: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: { documentUrl: ... };
                                        },
                                    >;
                                    getExtendDetection: QueryProcedure<
                                        {
                                            input: { formId: ...; runId: ... };
                                            meta: object;
                                            output: ExtendDetectionState;
                                        },
                                    >;
                                    getFields: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: {
                                                conditionalRules: ...;
                                                fields: ...;
                                                formId: ...;
                                                requiredContactTypes: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    rename: MutationProcedure<
                                        {
                                            input: { fileName: ...; formId: ... };
                                            meta: object;
                                            output: { fileName: ...; id: ... };
                                        },
                                    >;
                                    setOrgSharing: MutationProcedure<
                                        {
                                            input: { formId: ...; shareWithOrg: ... };
                                            meta: object;
                                            output: { id: ...; shareWithOrg: ... };
                                        },
                                    >;
                                    testFill: MutationProcedure<
                                        {
                                            input: {
                                                annotationIds?: ...;
                                                chosenContacts?: ...;
                                                formId: ...;
                                                includeEmr?: ...;
                                                maxAiFields?: ...;
                                                patientId: ...;
                                                renderAnswers?: ...;
                                                renderPdf?: ...;
                                                selectedDocumentIds?: ...;
                                                selectedSessionIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                aiFieldCount: ...;
                                                aiFieldIds: ...;
                                                aiFieldsAnswered: ...;
                                                chunkSize: ...;
                                                degradations: ...;
                                                deterministicAnswerCount: ...;
                                                fields: ...;
                                                formId: ...;
                                                patientId: ...;
                                                pdf: ...;
                                                pdfOmittedReason: ...;
                                                skippedFieldIds: ...;
                                                truncated: ...;
                                                undrawnCount: ...;
                                                unpositionedCount: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                annotations: ...;
                                                context?: ...;
                                                defaultFontSize?: ...;
                                                formId: ...;
                                            };
                                            meta: object;
                                            output: SavedTemplate;
                                        },
                                    >;
                                    updateConditionalRules: MutationProcedure<
                                        {
                                            input: { formId: ...; rules: ... };
                                            meta: object;
                                            output: { formId: ...; rules: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        integrations: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    fullSync: MutationProcedure<
                                        {
                                            input: { dry_run?: ...; integration_id: ... };
                                            meta: object;
                                            output: {
                                                chart_reviews_enqueued: ...;
                                                patients_enqueued: ...;
                                                success: ...;
                                            };
                                        },
                                    >;
                                    getIntegrationLocations: QueryProcedure<
                                        {
                                            input: (...)
                                            | (...)
                                            | (...)
                                            | (...);
                                            meta: object;
                                            output: (...) | (...) | (...);
                                        },
                                    >;
                                    getPatientRunRecording: QueryProcedure<
                                        { input: { patientId: ... }; meta: object; output: { url: ... } },
                                    >;
                                    getPatientSyncStatus: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    syncAdmissions: MutationProcedure<
                                        {
                                            input: {
                                                dry_run?: ...;
                                                end_date?: ...;
                                                integration_id: ...;
                                                start_date?: ...;
                                            };
                                            meta: object;
                                            output: { error: ...; patients?: ...; stats?: ...; success: ... };
                                        },
                                    >;
                                    syncEpisode: MutationProcedure<
                                        {
                                            input: { episodeId: ...; syncDocuments?: ... };
                                            meta: object;
                                            output: SyncEpisodeServiceResult;
                                        },
                                    >;
                                    syncFacilityLevelsOfCare: MutationProcedure<
                                        {
                                            input: { integrationId: ... };
                                            meta: object;
                                            output: SyncFacilityLevelsOfCareServiceResult;
                                        },
                                    >;
                                    syncFacilityPrograms: MutationProcedure<
                                        {
                                            input: { integrationId: ... };
                                            meta: object;
                                            output: SyncFacilityProgramsServiceResult;
                                        },
                                    >;
                                    syncIntegration: MutationProcedure<
                                        {
                                            input: { dateRange?: ...; integrationId: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    syncIntegrationEpisodes: MutationProcedure<
                                        {
                                            input: { endDate: ...; integrationId: ...; startDate: ... };
                                            meta: object;
                                            output: SyncIntegrationEpisodesServiceResult;
                                        },
                                    >;
                                    syncPatient: MutationProcedure<
                                        {
                                            input: { dryRun?: ...; patientId: ...; syncDocuments?: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    syncPatientEpisodes: MutationProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: DefaultValue<(...), (...)>;
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: { credentials?: ...; id: ...; label?: ...; status?: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                credentials: ...;
                                                entity_id: ...;
                                                facility_id: ...;
                                                id: ...;
                                                label: ...;
                                                last_sync: ...;
                                                status: ...;
                                                type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    verifyEmrProxyConnection: MutationProcedure<
                                        {
                                            input: { apiKey: ...; integrationType: ...; orgId: ... };
                                            meta: object;
                                            output: EmrProxyOrgSummary;
                                        },
                                    >;
                                },
                            >,
                        >;
                        metrics: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    criteriaAssistants: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    criteriaDetail: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateId: ...;
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileId?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: { items: ...; nextCursor: ...; providers: ...; total: ... };
                                        },
                                    >;
                                    criteriaResponses: QueryProcedure<
                                        {
                                            input: {
                                                auditQuestionId: ...;
                                                auditTemplateId: ...;
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileId?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                status?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    metricsFacilities: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    metricsGrouped: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                dimension: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                },
                            >,
                        >;
                        orgMembers: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    createInvite: MutationProcedure<
                                        {
                                            input: {
                                                email: ...;
                                                firstName: ...;
                                                lastName: ...;
                                                roleId: ...;
                                                title?: ...;
                                            };
                                            meta: object;
                                            output: InviteUserServiceResult;
                                        },
                                    >;
                                    getMemberByProfileId: QueryProcedure<
                                        {
                                            input: { profileId: ... };
                                            meta: object;
                                            output: {
                                                email: ...;
                                                first_name: ...;
                                                id: ...;
                                                is_superadmin: ...;
                                                last_name: ...;
                                                role: ...;
                                                role_id: ...;
                                                title: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                    listPendingInvites: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listRoles: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listUsers: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                roleId?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    removeMember: MutationProcedure<
                                        {
                                            input: { profileId: ... };
                                            meta: object;
                                            output: { profileId: ... };
                                        },
                                    >;
                                    resendInvite: MutationProcedure<
                                        {
                                            input: { pendingInviteId: ... };
                                            meta: object;
                                            output: ResendInviteServiceResult;
                                        },
                                    >;
                                    updateMember: MutationProcedure<
                                        {
                                            input: {
                                                email: ...;
                                                firstName: ...;
                                                isSuperadmin: ...;
                                                lastName: ...;
                                                profileId: ...;
                                                role: ...;
                                                title?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                email: ...;
                                                first_name: ...;
                                                id: ...;
                                                is_superadmin: ...;
                                                last_name: ...;
                                                role: ...;
                                                role_id: ...;
                                                title: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        orgSettings: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    list: QueryProcedure<
                                        { input: { entityId: ... }; meta: object; output: (...)[] },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: { entityId: ...; key: ...; value: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                entity_id: ...;
                                                id: ...;
                                                setting_key: ...;
                                                updated_at: ...;
                                                updated_by: ...;
                                                value: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientCharts: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    countForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; pieces?: ... };
                                            meta: object;
                                            output: { count: ... };
                                        },
                                    >;
                                    createForPatient: MutationProcedure<
                                        {
                                            input: { fileName: ...; patientId: ...; storageKey: ... };
                                            meta: object;
                                            output: {
                                                circle_metadata: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                embedding_count: ...;
                                                embedding_err_msg: ...;
                                                embedding_status: ...;
                                                entity_id: ...;
                                                extend_content_hash: ...;
                                                extend_run_id: ...;
                                                extend_source: ...;
                                                extended_at: ...;
                                                external_document_created_at: ...;
                                                external_document_id: ...;
                                                external_document_type: ...;
                                                external_document_updated_at: ...;
                                                file_name: ...;
                                                file_type: ...;
                                                file_url: ...;
                                                id: ...;
                                                integration_id: ...;
                                                is_ready: ...;
                                                packet_role: ...;
                                                packet_section_index: ...;
                                                page_end: ...;
                                                page_start: ...;
                                                parent_patient_chart_id: ...;
                                                patient_id: ...;
                                                raw_document: ...;
                                                run_id: ...;
                                                sources: ...;
                                                treatment_episode_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    documentTypesForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ...; patientId: ... };
                                            meta: object;
                                            output: {
                                                circle_metadata: ...;
                                                created_at: ...;
                                                embedding_err_msg: ...;
                                                embedding_status: ...;
                                                external_document_type: ...;
                                                facility_timezone: ...;
                                                file_name: ...;
                                                file_type: ...;
                                                file_url: ...;
                                                id: ...;
                                                open_at_page: ...;
                                                packet: ...;
                                                packet_role: ...;
                                                page_end: ...;
                                                page_start: ...;
                                                patient_id: ...;
                                                raw_document: ...;
                                                signed_url: ...;
                                            };
                                        },
                                    >;
                                    getTraceLinks: QueryProcedure<
                                        {
                                            input: { patientChartId: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    listAllIdsForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                externalDocumentType?: ...;
                                                fileType?: ...;
                                                patientId: ...;
                                                pieces?: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listByIds: QueryProcedure<
                                        {
                                            input: { ids: ...; patientId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                externalDocumentType?: ...;
                                                fileType?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                pieces?: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listGeneratedFormsForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listPacketPieces: QueryProcedure<
                                        {
                                            input: { packetId: ...; patientId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    preprocessForPatient: MutationProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: EnqueueChartPreprocessingResult;
                                        },
                                    >;
                                    reprocess: MutationProcedure<
                                        {
                                            input: { patientChartId: ...; patientId: ... };
                                            meta: object;
                                            output: { newRunIds: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientInsurances: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listForPatient: QueryProcedure<
                                        { input: { patientId: ... }; meta: object; output: (...)[] },
                                    >;
                                },
                            >,
                        >;
                        patients: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    clonePatientToEval: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                forceRun?: ...;
                                                patientId: ...;
                                            };
                                            meta: object;
                                            output: EnqueueClonePatientToEvalResult;
                                        },
                                    >;
                                    createPatient: MutationProcedure<
                                        {
                                            input: {
                                                addressCity?: ...;
                                                addressState?: ...;
                                                addressStreet1?: ...;
                                                addressStreet2?: ...;
                                                addressZipcode?: ...;
                                                dob?: ...;
                                                email?: ...;
                                                facilityId?: ...;
                                                firstName: ...;
                                                gender?: ...;
                                                intakeNotes?: ...;
                                                lastName: ...;
                                                phoneMobile?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                address_city: ...;
                                                address_state: ...;
                                                address_street1: ...;
                                                address_street2: ...;
                                                address_zipcode: ...;
                                                archive_reason: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                dob: ...;
                                                email: ...;
                                                entity_id: ...;
                                                external_patient_id: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                first_name: ...;
                                                gender: ...;
                                                intake_notes: ...;
                                                last_name: ...;
                                                last_updated_summary: ...;
                                                patient_id: ...;
                                                phone_mobile: ...;
                                                primary_provider_id: ...;
                                                status: ...;
                                                summary: ...;
                                            };
                                        },
                                    >;
                                    deletePatient: MutationProcedure<
                                        { input: { id: ... }; meta: object; output: { id: ... } },
                                    >;
                                    getCloneToEvalStatus: QueryProcedure<
                                        {
                                            input: { messageId: ... };
                                            meta: object;
                                            output: { status: ... };
                                        },
                                    >;
                                    getPatientById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                address_city: ...;
                                                address_state: ...;
                                                address_street1: ...;
                                                address_street2: ...;
                                                address_zipcode: ...;
                                                archive_reason: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                dob: ...;
                                                email: ...;
                                                entity_id: ...;
                                                external_patient_id: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                first_name: ...;
                                                gender: ...;
                                                intake_notes: ...;
                                                last_name: ...;
                                                last_updated_summary: ...;
                                                patient_id: ...;
                                                phone_mobile: ...;
                                                primary_provider_id: ...;
                                                status: ...;
                                                summary: ...;
                                            };
                                        },
                                    >;
                                    getPatientDetail: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                admitted_at: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                discharged_at: ...;
                                                dob: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                facility_name: ...;
                                                first_name: ...;
                                                last_name: ...;
                                                last_sync: ...;
                                                last_synced_documents: ...;
                                                latest_episode_mrn: ...;
                                                patient_id: ...;
                                                primary_provider_id: ...;
                                                provider_first_name: ...;
                                                provider_last_name: ...;
                                                provider_title: ...;
                                            };
                                        },
                                    >;
                                    getPatientOverview: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { patient: ...; recentSessions: ... };
                                        },
                                    >;
                                    listEpisodes: QueryProcedure<
                                        { input: { patientId: ... }; meta: object; output: (...)[] },
                                    >;
                                    listInOrganization: QueryProcedure<
                                        {
                                            input: {
                                                admissionStatus?: ...;
                                                cursor?: ...;
                                                facilityId?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                includeArchived?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientIds?: ...;
                                                patientSearch?: ...;
                                                primaryProviderId?: ...;
                                                programIds?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                status?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listProgramStays: QueryProcedure<
                                        {
                                            input: { episodeId: ...; patientId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    mergePatients: MutationProcedure<
                                        {
                                            input: { duplicatePatientId: ...; primaryPatientId: ... };
                                            meta: object;
                                            output: ExecutePatientMergeServiceResult;
                                        },
                                    >;
                                    setPatientArchived: MutationProcedure<
                                        {
                                            input: { archived: ...; patientId: ... };
                                            meta: object;
                                            output: { archived: ...; patientId: ... };
                                        },
                                    >;
                                    updatePatient: MutationProcedure<
                                        {
                                            input: {
                                                addressCity?: ...;
                                                addressState?: ...;
                                                addressStreet1?: ...;
                                                addressStreet2?: ...;
                                                addressZipcode?: ...;
                                                dob?: ...;
                                                email?: ...;
                                                facilityId?: ...;
                                                firstName: ...;
                                                gender?: ...;
                                                id: ...;
                                                intakeNotes?: ...;
                                                lastName: ...;
                                                phoneMobile?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                address_city: ...;
                                                address_state: ...;
                                                address_street1: ...;
                                                address_street2: ...;
                                                address_zipcode: ...;
                                                archive_reason: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                dob: ...;
                                                email: ...;
                                                entity_id: ...;
                                                external_patient_id: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                first_name: ...;
                                                gender: ...;
                                                intake_notes: ...;
                                                last_name: ...;
                                                last_updated_summary: ...;
                                                patient_id: ...;
                                                phone_mobile: ...;
                                                primary_provider_id: ...;
                                                status: ...;
                                                summary: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientSessions: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                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: ...;
                                            };
                                        },
                                    >;
                                    generateNote: MutationProcedure<
                                        {
                                            input: {
                                                endedAt?: ...;
                                                fileUrl?: ...;
                                                manualText?: ...;
                                                patientId: ...;
                                                startedAt?: ...;
                                                templateId: ...;
                                            };
                                            meta: object;
                                            output: ProcessTextNoteResult;
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { patientSession: ...; sessionAuditRunIds: ... };
                                        },
                                    >;
                                    getLastTemplateForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: { templateId: ... };
                                        },
                                    >;
                                    getPlaybackUrl: QueryProcedure<
                                        {
                                            input: { sessionId: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    getRecentSessions: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: { sessions: ... };
                                        },
                                    >;
                                    listEvidenceOptions: QueryProcedure<
                                        {
                                            input: { limit?: ...; patientId: ... };
                                            meta: object;
                                            output: { items: ...; total: ... };
                                        },
                                    >;
                                    listForCurrentUser: QueryProcedure<
                                        {
                                            input: { from: ...; to: ... };
                                            meta: object;
                                            output: { sessions: ... };
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                status?: ...;
                                                templateIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    modifyAiNote: MutationProcedure<
                                        {
                                            input: { customPrompt?: ...; optionId: ...; sessionId: ... };
                                            meta: object;
                                            output: { ai_generated_note: ... };
                                        },
                                    >;
                                    regenerateCodes: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: GenerateSessionCodesResult;
                                        },
                                    >;
                                    switchTemplate: MutationProcedure<
                                        {
                                            input: { sessionId: ...; templateId: ... };
                                            meta: object;
                                            output: RegenerateNoteResult;
                                        },
                                    >;
                                    updateAiSummarizedNote: MutationProcedure<
                                        {
                                            input: { aiSummarizedNote: ...; id: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    updateCodes: MutationProcedure<
                                        {
                                            input: { codes: ...; codeType: ...; id: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    updatePrivateNote: MutationProcedure<
                                        {
                                            input: { id: ...; privateNote: ... };
                                            meta: object;
                                            output: {
                                                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: ...;
                                            };
                                        },
                                    >;
                                    updateSessionTime: MutationProcedure<
                                        {
                                            input: { endTimestamp: ...; id: ...; startTimestamp: ... };
                                            meta: object;
                                            output: {
                                                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: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientUtilizationReviews: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                },
                            >,
                        >;
                        profiles: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listEmrProfiles: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listInOrganization: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    updateProfile: MutationProcedure<
                                        {
                                            input: { firstName: ...; lastName: ...; title?: ... };
                                            meta: object;
                                            output: {
                                                clinic_size: ...;
                                                created_at: ...;
                                                customer_id: ...;
                                                email: ...;
                                                expectations: ...;
                                                external_system: ...;
                                                external_system_id: ...;
                                                first_name: ...;
                                                hear_about_us: ...;
                                                id: ...;
                                                is_superadmin: ...;
                                                last_name: ...;
                                                last_updated: ...;
                                                price_id: ...;
                                                profile_type: ...;
                                                session_limit: ...;
                                                subscription_status: ...;
                                                title: ...;
                                                user_id: ...;
                                                vertical: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        programStays: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                },
                            >,
                        >;
                        reviewDashboard: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    bulkArchive: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                dateRange?: ...;
                                                includeNullTriggers?: ...;
                                                patientIds?: ...;
                                                preview?: ...;
                                                scoreRange?: ...;
                                                triggerIds?: ...;
                                            };
                                            meta: object;
                                            output: BulkArchiveAuditRunsOutput;
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                admissionDateRange?: ...;
                                                admissionStatus?: ...;
                                                auditTemplateIds?: ...;
                                                authEndDateRange?: ...;
                                                authStartDateRange?: ...;
                                                clientSearch?: ...;
                                                clinicalLevelOfCareIds?: ...;
                                                criteriaStatuses?: ...;
                                                cursor?: ...;
                                                dateRange?: ...;
                                                facilityIds?: ...;
                                                facilityIdsForClinicalLoc?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                facilityIdsForUrLoc?: ...;
                                                hasUnansweredManual?: ...;
                                                includeNullTriggers?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileIds?: ...;
                                                programIds?: ...;
                                                scoreRange?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                triggerIds?: ...;
                                                type?: ...;
                                                urLevelOfCareIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listGrouped: QueryProcedure<
                                        {
                                            input: {
                                                admissionDateRange?: ...;
                                                admissionStatus?: ...;
                                                auditTemplateIds?: ...;
                                                authEndDateRange?: ...;
                                                authStartDateRange?: ...;
                                                clientSearch?: ...;
                                                clinicalLevelOfCareIds?: ...;
                                                criteriaStatuses?: ...;
                                                cursor?: ...;
                                                dateRange?: ...;
                                                facilityIds?: ...;
                                                facilityIdsForClinicalLoc?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                facilityIdsForUrLoc?: ...;
                                                hasUnansweredManual?: ...;
                                                includeNullTriggers?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileIds?: ...;
                                                programIds?: ...;
                                                scoreRange?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                triggerIds?: ...;
                                                type?: ...;
                                                urLevelOfCareIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                },
                            >,
                        >;
                        rulebook: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                conceptId: ...;
                                                gradeOpenPeriods?: ...;
                                                quantifier?: ...;
                                                spec: ...;
                                                trigger: ...;
                                                window: ...;
                                            };
                                            meta: object;
                                            output: CreateRuleOutput;
                                        },
                                    >;
                                    evaluateRuleNow: MutationProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: ListFindingsOutput;
                                        },
                                    >;
                                    get: QueryProcedure<
                                        { input: { id: ... }; meta: object; output: RuleSummaryDto },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: { enabled?: ... };
                                            meta: object;
                                            output: ListRulesOutput;
                                        },
                                    >;
                                    listFindings: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: ListFindingsOutput;
                                        },
                                    >;
                                    revise: MutationProcedure<
                                        {
                                            input: {
                                                conceptId: ...;
                                                gradeOpenPeriods?: ...;
                                                quantifier?: ...;
                                                ruleId: ...;
                                                spec: ...;
                                                trigger: ...;
                                                window: ...;
                                            };
                                            meta: object;
                                            output: ReviseRuleOutput;
                                        },
                                    >;
                                    setEnabled: MutationProcedure<
                                        {
                                            input: { enabled: ...; ruleId: ... };
                                            meta: object;
                                            output: SetRuleEnabledOutput;
                                        },
                                    >;
                                    softDelete: MutationProcedure<
                                        {
                                            input: { reason: ...; ruleId: ... };
                                            meta: object;
                                            output: SoftDeleteRuleOutput;
                                        },
                                    >;
                                },
                            >,
                        >;
                        savedFilters: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                columnVisibility?: ...;
                                                filters: ...;
                                                name: ...;
                                                pageKey: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                viewMode?: ...;
                                            };
                                            meta: object;
                                            output: SavedViewDto;
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: DeleteSavedFilterOutput;
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: { pageKey: ... };
                                            meta: object;
                                            output: ListSavedFiltersOutput;
                                        },
                                    >;
                                    rename: MutationProcedure<
                                        {
                                            input: { id: ...; name: ... };
                                            meta: object;
                                            output: SavedViewDto;
                                        },
                                    >;
                                    resolveLabels: QueryProcedure<
                                        {
                                            input: {
                                                assignees?: ...;
                                                assistantIds?: ...;
                                                facilityIds?: ...;
                                                patientIds?: ...;
                                                providerIds?: ...;
                                                triggerIds?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                assigneeItems: ...;
                                                assistantItems: ...;
                                                facilityItems: ...;
                                                patientItems: ...;
                                                providerItems: ...;
                                                triggerItems: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                columnVisibility: ...;
                                                filters: ...;
                                                id: ...;
                                                sortBy: ...;
                                                sortOrder: ...;
                                                viewMode: ...;
                                            };
                                            meta: object;
                                            output: SavedViewDto;
                                        },
                                    >;
                                },
                            >,
                        >;
                        storage: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    createSessionUploadTarget: MutationProcedure<
                                        {
                                            input: { contentType: ...; patientId: ... };
                                            meta: object;
                                            output: { bucket: ...; config: ...; key: ... };
                                        },
                                    >;
                                    uploadCredentials: QueryProcedure<
                                        { input: void; meta: object; output: StorageCredentials },
                                    >;
                                },
                            >,
                        >;
                        superadmin: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    aiFeedback: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                addComment: ...;
                                                createLinearIssue: ...;
                                                deleteComment: ...;
                                                list: ...;
                                                listComments: ...;
                                                setSeverity: ...;
                                                setStatus: ...;
                                                updateComment: ...;
                                            },
                                        >,
                                    >;
                                    auditRuns: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                compareQuestion: ...;
                                                getQuestionById: ...;
                                                list: ...;
                                                requeue: ...;
                                                rerunQuestionV3: ...;
                                                resolveCompareDefaults: ...;
                                            },
                                        >,
                                    >;
                                    automationRuns: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                filterOptions: ...;
                                                get: ...;
                                                getRecording: ...;
                                                list: ...;
                                                listGroupedByPatient: ...;
                                                retry: ...;
                                            },
                                        >,
                                    >;
                                    evalClones: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<{ delete: ...; list: ... }>,
                                    >;
                                    evals: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                createDatasetExamples: ...;
                                                runDateResolutionExperiment: ...;
                                                runExpandQuestionExperiment: ...;
                                                runExperiment: ...;
                                            },
                                        >,
                                    >;
                                    impersonation: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                endImpersonation: ...;
                                                getCurrentImpersonation: ...;
                                                startImpersonation: ...;
                                                startUserImpersonation: ...;
                                            },
                                        >,
                                    >;
                                    orgs: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            { create: ...; get: ...; list: ...; setArchived: ... },
                                        >,
                                    >;
                                    orgUsers: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                list: ...;
                                                listClients: ...;
                                                listRoles: ...;
                                                transferClients: ...;
                                                updateRole: ...;
                                            },
                                        >,
                                    >;
                                    templates: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                list: ...;
                                                listCreators: ...;
                                                listForExport: ...;
                                                restore: ...;
                                            },
                                        >,
                                    >;
                                    usage: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<{ get: ...; listFacilities: ... }>,
                                    >;
                                },
                            >,
                        >;
                        teams: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    addTeamMembers: MutationProcedure<
                                        {
                                            input: { profileIds: ...; teamId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    createTeam: MutationProcedure<
                                        {
                                            input: { memberIds: ...; name: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                entity_id: ...;
                                                id: ...;
                                                name: ...;
                                            };
                                        },
                                    >;
                                    listTeams: QueryProcedure<
                                        { input: void; meta: object; output: (...)[] },
                                    >;
                                    removeTeamMember: MutationProcedure<
                                        {
                                            input: { profileId: ...; teamId: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                profile_id: ...;
                                                team_id: ...;
                                                user_entity_id: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        templates: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                additionalAiInstructions?: ...;
                                                checkCpt?: ...;
                                                checkDsm5?: ...;
                                                checkIcd10?: ...;
                                                hiddenInstructions?: ...;
                                                isAllowBulletPoints?: ...;
                                                isUnstructuredNarrative?: ...;
                                                linkedAuditTemplateIds?: ...;
                                                sections?: ...;
                                                title: ...;
                                            };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    duplicate: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { linkedAuditTemplates: ...; sections: ...; template: ... };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                deletedOnly?: ...;
                                                includeDeleted?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    restore: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    toggleSharing: MutationProcedure<
                                        {
                                            input: { id: ...; shared: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                additionalAiInstructions?: ...;
                                                checkCpt?: ...;
                                                checkDsm5?: ...;
                                                checkIcd10?: ...;
                                                hiddenInstructions?: ...;
                                                id: ...;
                                                isAllowBulletPoints?: ...;
                                                isUnstructuredNarrative?: ...;
                                                linkedAuditTemplateIds?: ...;
                                                sections?: ...;
                                                title?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        userPrompts: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { prompt: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                is_pinned: ...;
                                                prompt: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                is_pinned: ...;
                                                prompt: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                    togglePin: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                is_pinned: ...;
                                                prompt: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        utilization: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    episodeAuthorizations: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId: ... };
                                            meta: object;
                                            output: { authorizations: ...; canSeePayer: ... };
                                        },
                                    >;
                                    facilityLedger: QueryProcedure<
                                        {
                                            input: (...) & (...);
                                            meta: object;
                                            output: {
                                                canSeePayer: ...;
                                                facility: ...;
                                                freshness: ...;
                                                programs: ...;
                                                rows: ...;
                                                serviceTypes: ...;
                                            };
                                        },
                                    >;
                                    listFacilities: QueryProcedure<
                                        {
                                            input: { from: ...; to: ... };
                                            meta: object;
                                            output: { activePatients: ...; facilities: ...; freshness: ... };
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: { events: ...; timezone: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                    },
                >,
            >,
        >
      • Returns TRPCClient<
            BuiltRouter<
                {
                    ctx: TRPCContext;
                    errorShape: DefaultErrorShape;
                    meta: object;
                    transformer: false;
                },
                DecorateCreateRouterOptions<
                    {
                        actionItems: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    bulkApply: MutationProcedure<
                                        {
                                            input: {
                                                assignee?: ...;
                                                items: ...;
                                                nextStep?: ...;
                                                status?: ...;
                                            };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    getQuestionDetail: QueryProcedure<
                                        {
                                            input: { responseId: ... };
                                            meta: object;
                                            output: {
                                                assignee_id: ...;
                                                assignee_name: ...;
                                                assignee_type: ...;
                                                next_step: ...;
                                                reason: ...;
                                                recommendation: ...;
                                                response: ...;
                                                response_id: ...;
                                                short_form_response: ...;
                                                status: ...;
                                            };
                                        },
                                    >;
                                    listAssignees: QueryProcedure<
                                        {
                                            input: { search?: ... };
                                            meta: object;
                                            output: ListAssigneesResult;
                                        },
                                    >;
                                    listQuestions: QueryProcedure<
                                        {
                                            input: {
                                                admissionStatus?: ...;
                                                assigneeContactIds?: ...;
                                                assigneeIds?: ...;
                                                auditTemplateIds?: ...;
                                                authEndDateRange?: ...;
                                                cursor?: ...;
                                                facilityIds?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                facilityIdsForUrLoc?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                nextSteps?: ...;
                                                offset?: ...;
                                                programIds?: ...;
                                                providerIds?: ...;
                                                runDateRange?: ...;
                                                search?: ...;
                                                sortBy: ...;
                                                sortOrder: ...;
                                                statuses: ...;
                                                urLevelOfCareIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    updateActionItem: MutationProcedure<
                                        {
                                            input: {
                                                assignee?: ...;
                                                auditQuestionId: ...;
                                                nextStep?: ...;
                                                patientId: ...;
                                            };
                                            meta: object;
                                            output: {
                                                assigned_contact_id: ...;
                                                assigned_to: ...;
                                                audit_question_id: ...;
                                                created_at: ...;
                                                id: ...;
                                                next_steps: ...;
                                                patient_id: ...;
                                                updated_at: ...;
                                                updated_by: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        aiFeedback: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listOwn: QueryProcedure<
                                        {
                                            input: { patientId: ...; targetRefs: ... };
                                            meta: object;
                                            output: ListOwnAiFeedbackOutput;
                                        },
                                    >;
                                    retract: MutationProcedure<
                                        {
                                            input: { patientId: ...; targetRef: ... };
                                            meta: object;
                                            output: RetractAiFeedbackOutput;
                                        },
                                    >;
                                    submit: MutationProcedure<
                                        {
                                            input: {
                                                auditQuestionId?: ...;
                                                auditResponseId?: ...;
                                                auditRunId?: ...;
                                                comment?: ...;
                                                conversationId?: ...;
                                                correction?: ...;
                                                flow: ...;
                                                messageId?: ...;
                                                patientId: ...;
                                                patientSessionId?: ...;
                                                rating: ...;
                                                targetRef: ...;
                                                targetSnapshot?: ...;
                                                threadSnapshot?: ...;
                                            };
                                            meta: object;
                                            output: SubmitAiFeedbackOutput;
                                        },
                                    >;
                                },
                            >,
                        >;
                        auditRuns: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    archive: MutationProcedure<
                                        { input: { id: ... }; meta: object; output: { archived: ... } },
                                    >;
                                    createResponseTrail: MutationProcedure<
                                        {
                                            input: (...)
                                            | (...);
                                            meta: object;
                                            output: {
                                                audit_response_id: ...;
                                                comment: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                id: ...;
                                                marked_as: ...;
                                                response: ...;
                                            };
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                auditRun: ...;
                                                documentWait: ...;
                                                hasPendingResponses: ...;
                                                isWaitingForDocuments: ...;
                                                lastSync: ...;
                                                responses: ...;
                                                scopedCharts: ...;
                                                score: ...;
                                                statusCounts: ...;
                                                templateQuestionCount: ...;
                                            };
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                excludeAuditRunIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                resultStatus?: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                templateIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listQuestionRunHistory: QueryProcedure<
                                        {
                                            input: {
                                                auditQuestionId: ...;
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listRecentForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ...; type?: ... };
                                            meta: object;
                                            output: ListRecentPatientReviewRunsServiceResult;
                                        },
                                    >;
                                    rerunQuestion: MutationProcedure<
                                        {
                                            input: {
                                                auditQuestionId: ...;
                                                auditRunId: ...;
                                                questionText?: ...;
                                            };
                                            meta: object;
                                            output: { auditRunId: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        auditTemplates: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                customReviewCriteriaPrompt?: ...;
                                                customSummaryPrompt?: ...;
                                                description?: ...;
                                                name: ...;
                                                questions?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    duplicate: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { auditTemplate: ...; questions: ...; triggers: ... };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                deletedOnly?: ...;
                                                includeDeleted?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    restore: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    toggleSharing: MutationProcedure<
                                        {
                                            input: { id: ...; shared: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                customReviewCriteriaPrompt?: ...;
                                                customSummaryPrompt?: ...;
                                                description?: ...;
                                                id: ...;
                                                name?: ...;
                                                questions?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                custom_review_criteria_prompt: ...;
                                                custom_summary_prompt: ...;
                                                deleted: ...;
                                                description: ...;
                                                id: ...;
                                                name: ...;
                                                org_id: ...;
                                                share_with_org: ...;
                                                shared_by: ...;
                                                shared_with_entity_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        census: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    facility: QueryProcedure<
                                        {
                                            input: { facilityId: ... };
                                            meta: object;
                                            output: { asOf: ...; facility: ...; programs: ...; totals: ... };
                                        },
                                    >;
                                    listFacilities: QueryProcedure<
                                        {
                                            input: void;
                                            meta: object;
                                            output: {
                                                activeMembers: ...;
                                                ageBands: ...;
                                                asOf: ...;
                                                facilities: ...;
                                            };
                                        },
                                    >;
                                    programMembers: QueryProcedure<
                                        {
                                            input: { facilityId: ...; facilityProgramId: ... };
                                            meta: object;
                                            output: { asOf: ...; facility: ...; members: ...; program: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        chartReview: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    releaseParkedRun: MutationProcedure<
                                        {
                                            input: { auditRunId: ... };
                                            meta: object;
                                            output: { released: ... };
                                        },
                                    >;
                                    run: MutationProcedure<
                                        {
                                            input: {
                                                auditSource?: ...;
                                                patientChartIds?: ...;
                                                patientId: ...;
                                                sessionId?: ...;
                                                templateIds: ...;
                                                treatmentEpisodeId?: ...;
                                                trigger?: ...;
                                                triggeredAt?: ...;
                                            };
                                            meta: object;
                                            output: { auditRunIds: ... };
                                        },
                                    >;
                                    syncAndRun: MutationProcedure<
                                        {
                                            input: { episodeId?: ...; patientId: ...; templateIds: ... };
                                            meta: object;
                                            output: SyncAndRunOutput;
                                        },
                                    >;
                                },
                            >,
                        >;
                        chartReviewTriggers: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    check: MutationProcedure<
                                        {
                                            input: { patientId?: ...; triggerId?: ... };
                                            meta: object;
                                            output: CheckTriggersForEntityResult;
                                        },
                                    >;
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds: ...;
                                                clinicalLevelsOfCare?: ...;
                                                facilities?: ...;
                                                intervalSeconds: ...;
                                                name: ...;
                                                programs?: ...;
                                                schedule?: ...;
                                                timeAfterTriggerSeconds: ...;
                                                triggerType: ...;
                                                urLevelsOfCare?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                audit_template_id: ...;
                                                audit_templates: ...;
                                                created_at: ...;
                                                deleted: ...;
                                                enabled: ...;
                                                entity_id: ...;
                                                filters: ...;
                                                id: ...;
                                                interval_seconds: ...;
                                                last_run_at: ...;
                                                name: ...;
                                                schedule: ...;
                                                time_after_trigger_seconds: ...;
                                                trigger_type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { triggerId: ... };
                                            meta: object;
                                            output: {
                                                audit_template_id: ...;
                                                created_at: ...;
                                                deleted: ...;
                                                enabled: ...;
                                                entity_id: ...;
                                                filters: ...;
                                                id: ...;
                                                interval_seconds: ...;
                                                last_run_at: ...;
                                                name: ...;
                                                schedule: ...;
                                                time_after_trigger_seconds: ...;
                                                trigger_type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds: ...;
                                                clinicalLevelsOfCare?: ...;
                                                facilities?: ...;
                                                id: ...;
                                                intervalSeconds: ...;
                                                name: ...;
                                                programs?: ...;
                                                schedule?: ...;
                                                timeAfterTriggerSeconds: ...;
                                                urLevelsOfCare?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                audit_template_id: ...;
                                                audit_templates: ...;
                                                created_at: ...;
                                                deleted: ...;
                                                enabled: ...;
                                                entity_id: ...;
                                                filters: ...;
                                                id: ...;
                                                interval_seconds: ...;
                                                last_run_at: ...;
                                                name: ...;
                                                schedule: ...;
                                                time_after_trigger_seconds: ...;
                                                trigger_type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        chat: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    sendMessage: MutationProcedure<
                                        {
                                            input: { conversationId?: ...; messages: ...; patientId: ... };
                                            meta: object;
                                            output: RunCaseReviewChatResult;
                                        },
                                    >;
                                },
                            >,
                        >;
                        contacts: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { contactTypeId?: ...; fieldValues?: ... };
                                            meta: object;
                                            output: {
                                                contact_id: ...;
                                                contact_type: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                org_id: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { contactId: ... }; meta: object; output: void },
                                    >;
                                    get: QueryProcedure<
                                        {
                                            input: { contactId: ... };
                                            meta: object;
                                            output: {
                                                contact_id: ...;
                                                contact_type: ...;
                                                contact_type_id: ...;
                                                contact_type_name: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                fieldValues: ...;
                                                org_id: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                contactTypeId?: ...;
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                contactId: ...;
                                                contactTypeId?: ...;
                                                fieldValues?: ...;
                                            };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                },
                            >,
                        >;
                        contactTypes: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { customFields?: ...; name: ... };
                                            meta: object;
                                            output: {
                                                contact_type_id: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                org_id: ...;
                                                type: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { contactTypeId: ... }; meta: object; output: void },
                                    >;
                                    get: QueryProcedure<
                                        {
                                            input: { contactTypeId: ... };
                                            meta: object;
                                            output: {
                                                contact_type_id: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                fields: ...;
                                                org_id: ...;
                                                type: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                contactTypeId: ...;
                                                fieldIdsToRemove?: ...;
                                                fieldsToAdd?: ...;
                                                name?: ...;
                                            };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                },
                            >,
                        >;
                        dictionary: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    createConcept: MutationProcedure<
                                        {
                                            input: { name: ...; subject: ... };
                                            meta: object;
                                            output: { id: ...; name: ... };
                                        },
                                    >;
                                    listChartTitleLocations: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientSearch?: ...;
                                                title: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listChartTitlePatterns: QueryProcedure<
                                        {
                                            input: {
                                                conceptIds?: ...;
                                                cursor?: ...;
                                                facilityIds?: ...;
                                                includeMapped: ...;
                                                kind?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sort?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listChartTitlePatternTitles: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patternId: ...;
                                                titleSearch?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listConcepts: QueryProcedure<
                                        { input: { subject: ... }; meta: object; output: (...)[] },
                                    >;
                                    listConceptsWithRules: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sort?: ...;
                                                sortOrder?: ...;
                                                subject: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listConceptTitleRules: QueryProcedure<
                                        {
                                            input: { conceptId: ... };
                                            meta: object;
                                            output: ConceptTitleRules;
                                        },
                                    >;
                                    listCredentialEntries: QueryProcedure<
                                        { input: { search?: ... }; meta: object; output: (...)[] },
                                    >;
                                    listCredentialEntriesPage: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listCredentialProviders: QueryProcedure<
                                        {
                                            input: {
                                                credential: ...;
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                providerSearch?: ...;
                                            };
                                            meta: object;
                                            output: { items: ...; nextCursor: ...; summary: ...; total: ... };
                                        },
                                    >;
                                    listCredentials: QueryProcedure<
                                        {
                                            input: { includeMapped: ...; search?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listCredentialsPage: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                includeMapped: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listLevelOfCareEntries: QueryProcedure<
                                        { input: { search?: ... }; meta: object; output: (...)[] },
                                    >;
                                    listUnmappedLevelOfCareNames: QueryProcedure<
                                        { input: { search?: ... }; meta: object; output: (...)[] },
                                    >;
                                    mapChartTitlesToConcept: MutationProcedure<
                                        {
                                            input: { conceptId: ...; exactTitles: ...; patterns: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                    mapCredentials: MutationProcedure<
                                        {
                                            input: { conceptId: ...; credentials: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    mapLevelOfCareNames: MutationProcedure<
                                        {
                                            input: { conceptId: ...; levelOfCareIds: ...; programIds: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    saveCircleMatchers: MutationProcedure<
                                        {
                                            input: { conceptId: ...; matchers: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                    saveConceptExactTitles: MutationProcedure<
                                        {
                                            input: { conceptId: ...; titles: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                    unmapCredentials: MutationProcedure<
                                        {
                                            input: { conceptId: ...; matcherIds: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    unmapLevelOfCareNames: MutationProcedure<
                                        {
                                            input: { conceptId: ...; matcherIds: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    unmapTitlePattern: MutationProcedure<
                                        {
                                            input: { conceptId: ...; ruleId: ... };
                                            meta: object;
                                            output: { taggingError: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        facilities: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { integration?: ...; name: ...; timezone: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { id: ... }; meta: object; output: { success: ... } },
                                    >;
                                    hasEmrIntegratedFacilities: QueryProcedure<
                                        { input: void; meta: object; output: boolean },
                                    >;
                                    listInOrganization: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listWithFilterOptions: QueryProcedure<
                                        { input: void; meta: object; output: (...)[] },
                                    >;
                                    listWithIntegrations: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listWithIntegrationsPage: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listWithLevelsOfCare: QueryProcedure<
                                        { input: void; meta: object; output: (...)[] },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                admissionStartSource?: ...;
                                                id: ...;
                                                integration?: ...;
                                                name: ...;
                                                timezone?: ...;
                                            };
                                            meta: object;
                                            output: UpdateFacilityWithIntegrationResult;
                                        },
                                    >;
                                },
                            >,
                        >;
                        formRuns: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    deleteDocument: MutationProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: { deleted: ...; runId: ... };
                                        },
                                    >;
                                    download: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: {
                                                expiresInSeconds: ...;
                                                fileName: ...;
                                                isStale: ...;
                                                patientChartId: ...;
                                                runId: ...;
                                                signedUrl: ...;
                                            };
                                        },
                                    >;
                                    getAnswers: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: {
                                                answers: ...;
                                                formId: ...;
                                                isTerminal: ...;
                                                runId: ...;
                                                status: ...;
                                            };
                                        },
                                    >;
                                    getRetrievalScope: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: { runId: ...; scope: ... };
                                        },
                                    >;
                                    getStatus: QueryProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: {
                                                createdAt: ...;
                                                errorMsg: ...;
                                                finishedAt: ...;
                                                formId: ...;
                                                isTerminal: ...;
                                                patientId: ...;
                                                progress: ...;
                                                runId: ...;
                                                status: ...;
                                                totalFieldsSource: ...;
                                            };
                                        },
                                    >;
                                    getTemplateUrl: QueryProcedure<
                                        { input: { runId: ... }; meta: object; output: (...) | (...) },
                                    >;
                                    listForms: QueryProcedure<
                                        { input: void; meta: object; output: { items: ... } },
                                    >;
                                    refreshDocument: MutationProcedure<
                                        {
                                            input: { runId: ... };
                                            meta: object;
                                            output: { document: ...; runId: ... };
                                        },
                                    >;
                                    rerun: MutationProcedure<
                                        {
                                            input: {
                                                chosenContacts?: ...;
                                                includeEmr?: ...;
                                                runId: ...;
                                                selectedDocumentIds?: ...;
                                                selectedSessionIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                patientChartId: ...;
                                                previousRunId: ...;
                                                runId: ...;
                                                status: ...;
                                            };
                                        },
                                    >;
                                    revertAnswer: MutationProcedure<
                                        {
                                            input: { annotationId: ...; deferRender?: ...; runId: ... };
                                            meta: object;
                                            output: { answer: ...; document: ...; runId: ... };
                                        },
                                    >;
                                    start: MutationProcedure<
                                        {
                                            input: {
                                                chosenContacts?: ...;
                                                formId: ...;
                                                includeEmr?: ...;
                                                patientId: ...;
                                                selectedDocumentIds?: ...;
                                                selectedSessionIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: { patientChartId: ...; runId: ...; status: ... };
                                        },
                                    >;
                                    updateAnswer: MutationProcedure<
                                        {
                                            input: {
                                                annotationId: ...;
                                                deferRender?: ...;
                                                fontSize?: ...;
                                                runId: ...;
                                                value: ...;
                                            };
                                            meta: object;
                                            output: { answer: ...; document: ...; runId: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        formTemplates: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { fileName: ...; storageKey: ... };
                                            meta: object;
                                            output: { id: ... };
                                        },
                                    >;
                                    createUploadTarget: MutationProcedure<
                                        {
                                            input: { fileName: ...; sizeBytes: ... };
                                            meta: object;
                                            output: { bucket: ...; config: ...; key: ... };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        { input: { formId: ... }; meta: object; output: { id: ... } },
                                    >;
                                    detect: MutationProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: TemplateDetection;
                                        },
                                    >;
                                    detectWithExtend: MutationProcedure<
                                        { input: { formId: ... }; meta: object; output: { runId: ... } },
                                    >;
                                    get: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: {
                                                annotationCount: ...;
                                                context: ...;
                                                createdAt: ...;
                                                createdBy: ...;
                                                defaultFontSize: ...;
                                                fileName: ...;
                                                fileUrl: ...;
                                                id: ...;
                                                orgId: ...;
                                                requiredContactTypes: ...;
                                                shareWithOrg: ...;
                                                updatedAt: ...;
                                            };
                                        },
                                    >;
                                    getDetection: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: TemplateDetection;
                                        },
                                    >;
                                    getDocument: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: { documentUrl: ... };
                                        },
                                    >;
                                    getExtendDetection: QueryProcedure<
                                        {
                                            input: { formId: ...; runId: ... };
                                            meta: object;
                                            output: ExtendDetectionState;
                                        },
                                    >;
                                    getFields: QueryProcedure<
                                        {
                                            input: { formId: ... };
                                            meta: object;
                                            output: {
                                                conditionalRules: ...;
                                                fields: ...;
                                                formId: ...;
                                                requiredContactTypes: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    rename: MutationProcedure<
                                        {
                                            input: { fileName: ...; formId: ... };
                                            meta: object;
                                            output: { fileName: ...; id: ... };
                                        },
                                    >;
                                    setOrgSharing: MutationProcedure<
                                        {
                                            input: { formId: ...; shareWithOrg: ... };
                                            meta: object;
                                            output: { id: ...; shareWithOrg: ... };
                                        },
                                    >;
                                    testFill: MutationProcedure<
                                        {
                                            input: {
                                                annotationIds?: ...;
                                                chosenContacts?: ...;
                                                formId: ...;
                                                includeEmr?: ...;
                                                maxAiFields?: ...;
                                                patientId: ...;
                                                renderAnswers?: ...;
                                                renderPdf?: ...;
                                                selectedDocumentIds?: ...;
                                                selectedSessionIds?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                aiFieldCount: ...;
                                                aiFieldIds: ...;
                                                aiFieldsAnswered: ...;
                                                chunkSize: ...;
                                                degradations: ...;
                                                deterministicAnswerCount: ...;
                                                fields: ...;
                                                formId: ...;
                                                patientId: ...;
                                                pdf: ...;
                                                pdfOmittedReason: ...;
                                                skippedFieldIds: ...;
                                                truncated: ...;
                                                undrawnCount: ...;
                                                unpositionedCount: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                annotations: ...;
                                                context?: ...;
                                                defaultFontSize?: ...;
                                                formId: ...;
                                            };
                                            meta: object;
                                            output: SavedTemplate;
                                        },
                                    >;
                                    updateConditionalRules: MutationProcedure<
                                        {
                                            input: { formId: ...; rules: ... };
                                            meta: object;
                                            output: { formId: ...; rules: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        integrations: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    fullSync: MutationProcedure<
                                        {
                                            input: { dry_run?: ...; integration_id: ... };
                                            meta: object;
                                            output: {
                                                chart_reviews_enqueued: ...;
                                                patients_enqueued: ...;
                                                success: ...;
                                            };
                                        },
                                    >;
                                    getIntegrationLocations: QueryProcedure<
                                        {
                                            input: (...)
                                            | (...)
                                            | (...)
                                            | (...);
                                            meta: object;
                                            output: (...) | (...) | (...);
                                        },
                                    >;
                                    getPatientRunRecording: QueryProcedure<
                                        { input: { patientId: ... }; meta: object; output: { url: ... } },
                                    >;
                                    getPatientSyncStatus: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    syncAdmissions: MutationProcedure<
                                        {
                                            input: {
                                                dry_run?: ...;
                                                end_date?: ...;
                                                integration_id: ...;
                                                start_date?: ...;
                                            };
                                            meta: object;
                                            output: { error: ...; patients?: ...; stats?: ...; success: ... };
                                        },
                                    >;
                                    syncEpisode: MutationProcedure<
                                        {
                                            input: { episodeId: ...; syncDocuments?: ... };
                                            meta: object;
                                            output: SyncEpisodeServiceResult;
                                        },
                                    >;
                                    syncFacilityLevelsOfCare: MutationProcedure<
                                        {
                                            input: { integrationId: ... };
                                            meta: object;
                                            output: SyncFacilityLevelsOfCareServiceResult;
                                        },
                                    >;
                                    syncFacilityPrograms: MutationProcedure<
                                        {
                                            input: { integrationId: ... };
                                            meta: object;
                                            output: SyncFacilityProgramsServiceResult;
                                        },
                                    >;
                                    syncIntegration: MutationProcedure<
                                        {
                                            input: { dateRange?: ...; integrationId: ... };
                                            meta: object;
                                            output: void;
                                        },
                                    >;
                                    syncIntegrationEpisodes: MutationProcedure<
                                        {
                                            input: { endDate: ...; integrationId: ...; startDate: ... };
                                            meta: object;
                                            output: SyncIntegrationEpisodesServiceResult;
                                        },
                                    >;
                                    syncPatient: MutationProcedure<
                                        {
                                            input: { dryRun?: ...; patientId: ...; syncDocuments?: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    syncPatientEpisodes: MutationProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: DefaultValue<(...), (...)>;
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: { credentials?: ...; id: ...; label?: ...; status?: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                credentials: ...;
                                                entity_id: ...;
                                                facility_id: ...;
                                                id: ...;
                                                label: ...;
                                                last_sync: ...;
                                                status: ...;
                                                type: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    verifyEmrProxyConnection: MutationProcedure<
                                        {
                                            input: { apiKey: ...; integrationType: ...; orgId: ... };
                                            meta: object;
                                            output: EmrProxyOrgSummary;
                                        },
                                    >;
                                },
                            >,
                        >;
                        metrics: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    criteriaAssistants: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    criteriaDetail: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateId: ...;
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileId?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: { items: ...; nextCursor: ...; providers: ...; total: ... };
                                        },
                                    >;
                                    criteriaResponses: QueryProcedure<
                                        {
                                            input: {
                                                auditQuestionId: ...;
                                                auditTemplateId: ...;
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileId?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                status?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    metricsFacilities: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    metricsGrouped: QueryProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                cursor?: ...;
                                                dateRange: ...;
                                                dimension: ...;
                                                facilityIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                scoreRange?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                },
                            >,
                        >;
                        orgMembers: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    createInvite: MutationProcedure<
                                        {
                                            input: {
                                                email: ...;
                                                firstName: ...;
                                                lastName: ...;
                                                roleId: ...;
                                                title?: ...;
                                            };
                                            meta: object;
                                            output: InviteUserServiceResult;
                                        },
                                    >;
                                    getMemberByProfileId: QueryProcedure<
                                        {
                                            input: { profileId: ... };
                                            meta: object;
                                            output: {
                                                email: ...;
                                                first_name: ...;
                                                id: ...;
                                                is_superadmin: ...;
                                                last_name: ...;
                                                role: ...;
                                                role_id: ...;
                                                title: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                    listPendingInvites: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listRoles: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listUsers: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                roleId?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    removeMember: MutationProcedure<
                                        {
                                            input: { profileId: ... };
                                            meta: object;
                                            output: { profileId: ... };
                                        },
                                    >;
                                    resendInvite: MutationProcedure<
                                        {
                                            input: { pendingInviteId: ... };
                                            meta: object;
                                            output: ResendInviteServiceResult;
                                        },
                                    >;
                                    updateMember: MutationProcedure<
                                        {
                                            input: {
                                                email: ...;
                                                firstName: ...;
                                                isSuperadmin: ...;
                                                lastName: ...;
                                                profileId: ...;
                                                role: ...;
                                                title?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                email: ...;
                                                first_name: ...;
                                                id: ...;
                                                is_superadmin: ...;
                                                last_name: ...;
                                                role: ...;
                                                role_id: ...;
                                                title: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        orgSettings: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    list: QueryProcedure<
                                        { input: { entityId: ... }; meta: object; output: (...)[] },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: { entityId: ...; key: ...; value: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                entity_id: ...;
                                                id: ...;
                                                setting_key: ...;
                                                updated_at: ...;
                                                updated_by: ...;
                                                value: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientCharts: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    countForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; pieces?: ... };
                                            meta: object;
                                            output: { count: ... };
                                        },
                                    >;
                                    createForPatient: MutationProcedure<
                                        {
                                            input: { fileName: ...; patientId: ...; storageKey: ... };
                                            meta: object;
                                            output: {
                                                circle_metadata: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                embedding_count: ...;
                                                embedding_err_msg: ...;
                                                embedding_status: ...;
                                                entity_id: ...;
                                                extend_content_hash: ...;
                                                extend_run_id: ...;
                                                extend_source: ...;
                                                extended_at: ...;
                                                external_document_created_at: ...;
                                                external_document_id: ...;
                                                external_document_type: ...;
                                                external_document_updated_at: ...;
                                                file_name: ...;
                                                file_type: ...;
                                                file_url: ...;
                                                id: ...;
                                                integration_id: ...;
                                                is_ready: ...;
                                                packet_role: ...;
                                                packet_section_index: ...;
                                                page_end: ...;
                                                page_start: ...;
                                                parent_patient_chart_id: ...;
                                                patient_id: ...;
                                                raw_document: ...;
                                                run_id: ...;
                                                sources: ...;
                                                treatment_episode_id: ...;
                                                updated_at: ...;
                                            };
                                        },
                                    >;
                                    documentTypesForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ...; patientId: ... };
                                            meta: object;
                                            output: {
                                                circle_metadata: ...;
                                                created_at: ...;
                                                embedding_err_msg: ...;
                                                embedding_status: ...;
                                                external_document_type: ...;
                                                facility_timezone: ...;
                                                file_name: ...;
                                                file_type: ...;
                                                file_url: ...;
                                                id: ...;
                                                open_at_page: ...;
                                                packet: ...;
                                                packet_role: ...;
                                                page_end: ...;
                                                page_start: ...;
                                                patient_id: ...;
                                                raw_document: ...;
                                                signed_url: ...;
                                            };
                                        },
                                    >;
                                    getTraceLinks: QueryProcedure<
                                        {
                                            input: { patientChartId: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    listAllIdsForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                externalDocumentType?: ...;
                                                fileType?: ...;
                                                patientId: ...;
                                                pieces?: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listByIds: QueryProcedure<
                                        {
                                            input: { ids: ...; patientId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                externalDocumentType?: ...;
                                                fileType?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                pieces?: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                treatmentEpisodeId?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listGeneratedFormsForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listPacketPieces: QueryProcedure<
                                        {
                                            input: { packetId: ...; patientId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    preprocessForPatient: MutationProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: EnqueueChartPreprocessingResult;
                                        },
                                    >;
                                    reprocess: MutationProcedure<
                                        {
                                            input: { patientChartId: ...; patientId: ... };
                                            meta: object;
                                            output: { newRunIds: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientInsurances: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listForPatient: QueryProcedure<
                                        { input: { patientId: ... }; meta: object; output: (...)[] },
                                    >;
                                },
                            >,
                        >;
                        patients: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    clonePatientToEval: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                forceRun?: ...;
                                                patientId: ...;
                                            };
                                            meta: object;
                                            output: EnqueueClonePatientToEvalResult;
                                        },
                                    >;
                                    createPatient: MutationProcedure<
                                        {
                                            input: {
                                                addressCity?: ...;
                                                addressState?: ...;
                                                addressStreet1?: ...;
                                                addressStreet2?: ...;
                                                addressZipcode?: ...;
                                                dob?: ...;
                                                email?: ...;
                                                facilityId?: ...;
                                                firstName: ...;
                                                gender?: ...;
                                                intakeNotes?: ...;
                                                lastName: ...;
                                                phoneMobile?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                address_city: ...;
                                                address_state: ...;
                                                address_street1: ...;
                                                address_street2: ...;
                                                address_zipcode: ...;
                                                archive_reason: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                dob: ...;
                                                email: ...;
                                                entity_id: ...;
                                                external_patient_id: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                first_name: ...;
                                                gender: ...;
                                                intake_notes: ...;
                                                last_name: ...;
                                                last_updated_summary: ...;
                                                patient_id: ...;
                                                phone_mobile: ...;
                                                primary_provider_id: ...;
                                                status: ...;
                                                summary: ...;
                                            };
                                        },
                                    >;
                                    deletePatient: MutationProcedure<
                                        { input: { id: ... }; meta: object; output: { id: ... } },
                                    >;
                                    getCloneToEvalStatus: QueryProcedure<
                                        {
                                            input: { messageId: ... };
                                            meta: object;
                                            output: { status: ... };
                                        },
                                    >;
                                    getPatientById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                address_city: ...;
                                                address_state: ...;
                                                address_street1: ...;
                                                address_street2: ...;
                                                address_zipcode: ...;
                                                archive_reason: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                dob: ...;
                                                email: ...;
                                                entity_id: ...;
                                                external_patient_id: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                first_name: ...;
                                                gender: ...;
                                                intake_notes: ...;
                                                last_name: ...;
                                                last_updated_summary: ...;
                                                patient_id: ...;
                                                phone_mobile: ...;
                                                primary_provider_id: ...;
                                                status: ...;
                                                summary: ...;
                                            };
                                        },
                                    >;
                                    getPatientDetail: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                admitted_at: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                discharged_at: ...;
                                                dob: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                facility_name: ...;
                                                first_name: ...;
                                                last_name: ...;
                                                last_sync: ...;
                                                last_synced_documents: ...;
                                                latest_episode_mrn: ...;
                                                patient_id: ...;
                                                primary_provider_id: ...;
                                                provider_first_name: ...;
                                                provider_last_name: ...;
                                                provider_title: ...;
                                            };
                                        },
                                    >;
                                    getPatientOverview: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { patient: ...; recentSessions: ... };
                                        },
                                    >;
                                    listEpisodes: QueryProcedure<
                                        { input: { patientId: ... }; meta: object; output: (...)[] },
                                    >;
                                    listInOrganization: QueryProcedure<
                                        {
                                            input: {
                                                admissionStatus?: ...;
                                                cursor?: ...;
                                                facilityId?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                includeArchived?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientIds?: ...;
                                                patientSearch?: ...;
                                                primaryProviderId?: ...;
                                                programIds?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                status?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listProgramStays: QueryProcedure<
                                        {
                                            input: { episodeId: ...; patientId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    mergePatients: MutationProcedure<
                                        {
                                            input: { duplicatePatientId: ...; primaryPatientId: ... };
                                            meta: object;
                                            output: ExecutePatientMergeServiceResult;
                                        },
                                    >;
                                    setPatientArchived: MutationProcedure<
                                        {
                                            input: { archived: ...; patientId: ... };
                                            meta: object;
                                            output: { archived: ...; patientId: ... };
                                        },
                                    >;
                                    updatePatient: MutationProcedure<
                                        {
                                            input: {
                                                addressCity?: ...;
                                                addressState?: ...;
                                                addressStreet1?: ...;
                                                addressStreet2?: ...;
                                                addressZipcode?: ...;
                                                dob?: ...;
                                                email?: ...;
                                                facilityId?: ...;
                                                firstName: ...;
                                                gender?: ...;
                                                id: ...;
                                                intakeNotes?: ...;
                                                lastName: ...;
                                                phoneMobile?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                address_city: ...;
                                                address_state: ...;
                                                address_street1: ...;
                                                address_street2: ...;
                                                address_zipcode: ...;
                                                archive_reason: ...;
                                                archived: ...;
                                                archived_at: ...;
                                                created_at: ...;
                                                created_by: ...;
                                                dob: ...;
                                                email: ...;
                                                entity_id: ...;
                                                external_patient_id: ...;
                                                external_source: ...;
                                                facility_id: ...;
                                                first_name: ...;
                                                gender: ...;
                                                intake_notes: ...;
                                                last_name: ...;
                                                last_updated_summary: ...;
                                                patient_id: ...;
                                                phone_mobile: ...;
                                                primary_provider_id: ...;
                                                status: ...;
                                                summary: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientSessions: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                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: ...;
                                            };
                                        },
                                    >;
                                    generateNote: MutationProcedure<
                                        {
                                            input: {
                                                endedAt?: ...;
                                                fileUrl?: ...;
                                                manualText?: ...;
                                                patientId: ...;
                                                startedAt?: ...;
                                                templateId: ...;
                                            };
                                            meta: object;
                                            output: ProcessTextNoteResult;
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { patientSession: ...; sessionAuditRunIds: ... };
                                        },
                                    >;
                                    getLastTemplateForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: { templateId: ... };
                                        },
                                    >;
                                    getPlaybackUrl: QueryProcedure<
                                        {
                                            input: { sessionId: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    getRecentSessions: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: { sessions: ... };
                                        },
                                    >;
                                    listEvidenceOptions: QueryProcedure<
                                        {
                                            input: { limit?: ...; patientId: ... };
                                            meta: object;
                                            output: { items: ...; total: ... };
                                        },
                                    >;
                                    listForCurrentUser: QueryProcedure<
                                        {
                                            input: { from: ...; to: ... };
                                            meta: object;
                                            output: { sessions: ... };
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                dateFrom?: ...;
                                                dateTo?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                patientId: ...;
                                                search?: ...;
                                                sortOrder?: ...;
                                                status?: ...;
                                                templateIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    modifyAiNote: MutationProcedure<
                                        {
                                            input: { customPrompt?: ...; optionId: ...; sessionId: ... };
                                            meta: object;
                                            output: { ai_generated_note: ... };
                                        },
                                    >;
                                    regenerateCodes: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: GenerateSessionCodesResult;
                                        },
                                    >;
                                    switchTemplate: MutationProcedure<
                                        {
                                            input: { sessionId: ...; templateId: ... };
                                            meta: object;
                                            output: RegenerateNoteResult;
                                        },
                                    >;
                                    updateAiSummarizedNote: MutationProcedure<
                                        {
                                            input: { aiSummarizedNote: ...; id: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    updateCodes: MutationProcedure<
                                        {
                                            input: { codes: ...; codeType: ...; id: ... };
                                            meta: object;
                                            output: (...) | (...);
                                        },
                                    >;
                                    updatePrivateNote: MutationProcedure<
                                        {
                                            input: { id: ...; privateNote: ... };
                                            meta: object;
                                            output: {
                                                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: ...;
                                            };
                                        },
                                    >;
                                    updateSessionTime: MutationProcedure<
                                        {
                                            input: { endTimestamp: ...; id: ...; startTimestamp: ... };
                                            meta: object;
                                            output: {
                                                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: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        patientUtilizationReviews: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                },
                            >,
                        >;
                        profiles: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listEmrProfiles: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listInOrganization: QueryProcedure<
                                        {
                                            input: { cursor?: ...; limit?: ...; offset?: ...; search?: ... };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    updateProfile: MutationProcedure<
                                        {
                                            input: { firstName: ...; lastName: ...; title?: ... };
                                            meta: object;
                                            output: {
                                                clinic_size: ...;
                                                created_at: ...;
                                                customer_id: ...;
                                                email: ...;
                                                expectations: ...;
                                                external_system: ...;
                                                external_system_id: ...;
                                                first_name: ...;
                                                hear_about_us: ...;
                                                id: ...;
                                                is_superadmin: ...;
                                                last_name: ...;
                                                last_updated: ...;
                                                price_id: ...;
                                                profile_type: ...;
                                                session_limit: ...;
                                                subscription_status: ...;
                                                title: ...;
                                                user_id: ...;
                                                vertical: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        programStays: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    listForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                },
                            >,
                        >;
                        reviewDashboard: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    bulkArchive: MutationProcedure<
                                        {
                                            input: {
                                                auditTemplateIds?: ...;
                                                dateRange?: ...;
                                                includeNullTriggers?: ...;
                                                patientIds?: ...;
                                                preview?: ...;
                                                scoreRange?: ...;
                                                triggerIds?: ...;
                                            };
                                            meta: object;
                                            output: BulkArchiveAuditRunsOutput;
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                admissionDateRange?: ...;
                                                admissionStatus?: ...;
                                                auditTemplateIds?: ...;
                                                authEndDateRange?: ...;
                                                authStartDateRange?: ...;
                                                clientSearch?: ...;
                                                clinicalLevelOfCareIds?: ...;
                                                criteriaStatuses?: ...;
                                                cursor?: ...;
                                                dateRange?: ...;
                                                facilityIds?: ...;
                                                facilityIdsForClinicalLoc?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                facilityIdsForUrLoc?: ...;
                                                hasUnansweredManual?: ...;
                                                includeNullTriggers?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileIds?: ...;
                                                programIds?: ...;
                                                scoreRange?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                triggerIds?: ...;
                                                type?: ...;
                                                urLevelOfCareIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    listGrouped: QueryProcedure<
                                        {
                                            input: {
                                                admissionDateRange?: ...;
                                                admissionStatus?: ...;
                                                auditTemplateIds?: ...;
                                                authEndDateRange?: ...;
                                                authStartDateRange?: ...;
                                                clientSearch?: ...;
                                                clinicalLevelOfCareIds?: ...;
                                                criteriaStatuses?: ...;
                                                cursor?: ...;
                                                dateRange?: ...;
                                                facilityIds?: ...;
                                                facilityIdsForClinicalLoc?: ...;
                                                facilityIdsForLoc?: ...;
                                                facilityIdsForProgram?: ...;
                                                facilityIdsForUrLoc?: ...;
                                                hasUnansweredManual?: ...;
                                                includeNullTriggers?: ...;
                                                levelOfCareIds?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                profileIds?: ...;
                                                programIds?: ...;
                                                scoreRange?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                triggerIds?: ...;
                                                type?: ...;
                                                urLevelOfCareIds?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                },
                            >,
                        >;
                        rulebook: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                conceptId: ...;
                                                gradeOpenPeriods?: ...;
                                                quantifier?: ...;
                                                spec: ...;
                                                trigger: ...;
                                                window: ...;
                                            };
                                            meta: object;
                                            output: CreateRuleOutput;
                                        },
                                    >;
                                    evaluateRuleNow: MutationProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: ListFindingsOutput;
                                        },
                                    >;
                                    get: QueryProcedure<
                                        { input: { id: ... }; meta: object; output: RuleSummaryDto },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: { enabled?: ... };
                                            meta: object;
                                            output: ListRulesOutput;
                                        },
                                    >;
                                    listFindings: QueryProcedure<
                                        {
                                            input: { patientId: ... };
                                            meta: object;
                                            output: ListFindingsOutput;
                                        },
                                    >;
                                    revise: MutationProcedure<
                                        {
                                            input: {
                                                conceptId: ...;
                                                gradeOpenPeriods?: ...;
                                                quantifier?: ...;
                                                ruleId: ...;
                                                spec: ...;
                                                trigger: ...;
                                                window: ...;
                                            };
                                            meta: object;
                                            output: ReviseRuleOutput;
                                        },
                                    >;
                                    setEnabled: MutationProcedure<
                                        {
                                            input: { enabled: ...; ruleId: ... };
                                            meta: object;
                                            output: SetRuleEnabledOutput;
                                        },
                                    >;
                                    softDelete: MutationProcedure<
                                        {
                                            input: { reason: ...; ruleId: ... };
                                            meta: object;
                                            output: SoftDeleteRuleOutput;
                                        },
                                    >;
                                },
                            >,
                        >;
                        savedFilters: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                columnVisibility?: ...;
                                                filters: ...;
                                                name: ...;
                                                pageKey: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                                viewMode?: ...;
                                            };
                                            meta: object;
                                            output: SavedViewDto;
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: DeleteSavedFilterOutput;
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: { pageKey: ... };
                                            meta: object;
                                            output: ListSavedFiltersOutput;
                                        },
                                    >;
                                    rename: MutationProcedure<
                                        {
                                            input: { id: ...; name: ... };
                                            meta: object;
                                            output: SavedViewDto;
                                        },
                                    >;
                                    resolveLabels: QueryProcedure<
                                        {
                                            input: {
                                                assignees?: ...;
                                                assistantIds?: ...;
                                                facilityIds?: ...;
                                                patientIds?: ...;
                                                providerIds?: ...;
                                                triggerIds?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                assigneeItems: ...;
                                                assistantItems: ...;
                                                facilityItems: ...;
                                                patientItems: ...;
                                                providerItems: ...;
                                                triggerItems: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                columnVisibility: ...;
                                                filters: ...;
                                                id: ...;
                                                sortBy: ...;
                                                sortOrder: ...;
                                                viewMode: ...;
                                            };
                                            meta: object;
                                            output: SavedViewDto;
                                        },
                                    >;
                                },
                            >,
                        >;
                        storage: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    createSessionUploadTarget: MutationProcedure<
                                        {
                                            input: { contentType: ...; patientId: ... };
                                            meta: object;
                                            output: { bucket: ...; config: ...; key: ... };
                                        },
                                    >;
                                    uploadCredentials: QueryProcedure<
                                        { input: void; meta: object; output: StorageCredentials },
                                    >;
                                },
                            >,
                        >;
                        superadmin: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    aiFeedback: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                addComment: ...;
                                                createLinearIssue: ...;
                                                deleteComment: ...;
                                                list: ...;
                                                listComments: ...;
                                                setSeverity: ...;
                                                setStatus: ...;
                                                updateComment: ...;
                                            },
                                        >,
                                    >;
                                    auditRuns: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                compareQuestion: ...;
                                                getQuestionById: ...;
                                                list: ...;
                                                requeue: ...;
                                                rerunQuestionV3: ...;
                                                resolveCompareDefaults: ...;
                                            },
                                        >,
                                    >;
                                    automationRuns: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                filterOptions: ...;
                                                get: ...;
                                                getRecording: ...;
                                                list: ...;
                                                listGroupedByPatient: ...;
                                                retry: ...;
                                            },
                                        >,
                                    >;
                                    evalClones: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<{ delete: ...; list: ... }>,
                                    >;
                                    evals: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                createDatasetExamples: ...;
                                                runDateResolutionExperiment: ...;
                                                runExpandQuestionExperiment: ...;
                                                runExperiment: ...;
                                            },
                                        >,
                                    >;
                                    impersonation: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                endImpersonation: ...;
                                                getCurrentImpersonation: ...;
                                                startImpersonation: ...;
                                                startUserImpersonation: ...;
                                            },
                                        >,
                                    >;
                                    orgs: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            { create: ...; get: ...; list: ...; setArchived: ... },
                                        >,
                                    >;
                                    orgUsers: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                list: ...;
                                                listClients: ...;
                                                listRoles: ...;
                                                transferClients: ...;
                                                updateRole: ...;
                                            },
                                        >,
                                    >;
                                    templates: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<
                                            {
                                                list: ...;
                                                listCreators: ...;
                                                listForExport: ...;
                                                restore: ...;
                                            },
                                        >,
                                    >;
                                    usage: BuiltRouter<
                                        {
                                            ctx: TRPCContext;
                                            errorShape: DefaultErrorShape;
                                            meta: object;
                                            transformer: false;
                                        },
                                        DecorateCreateRouterOptions<{ get: ...; listFacilities: ... }>,
                                    >;
                                },
                            >,
                        >;
                        teams: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    addTeamMembers: MutationProcedure<
                                        {
                                            input: { profileIds: ...; teamId: ... };
                                            meta: object;
                                            output: (...)[];
                                        },
                                    >;
                                    createTeam: MutationProcedure<
                                        {
                                            input: { memberIds: ...; name: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                created_by: ...;
                                                entity_id: ...;
                                                id: ...;
                                                name: ...;
                                            };
                                        },
                                    >;
                                    listTeams: QueryProcedure<
                                        { input: void; meta: object; output: (...)[] },
                                    >;
                                    removeTeamMember: MutationProcedure<
                                        {
                                            input: { profileId: ...; teamId: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                profile_id: ...;
                                                team_id: ...;
                                                user_entity_id: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        templates: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: {
                                                additionalAiInstructions?: ...;
                                                checkCpt?: ...;
                                                checkDsm5?: ...;
                                                checkIcd10?: ...;
                                                hiddenInstructions?: ...;
                                                isAllowBulletPoints?: ...;
                                                isUnstructuredNarrative?: ...;
                                                linkedAuditTemplateIds?: ...;
                                                sections?: ...;
                                                title: ...;
                                            };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    duplicate: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    getById: QueryProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: { linkedAuditTemplates: ...; sections: ...; template: ... };
                                        },
                                    >;
                                    list: QueryProcedure<
                                        {
                                            input: {
                                                cursor?: ...;
                                                deletedOnly?: ...;
                                                includeDeleted?: ...;
                                                limit?: ...;
                                                offset?: ...;
                                                search?: ...;
                                                sortBy?: ...;
                                                sortOrder?: ...;
                                            };
                                            meta: object;
                                            output: PaginatedResponse<(...)>;
                                        },
                                    >;
                                    restore: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    toggleSharing: MutationProcedure<
                                        {
                                            input: { id: ...; shared: ... };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                    update: MutationProcedure<
                                        {
                                            input: {
                                                additionalAiInstructions?: ...;
                                                checkCpt?: ...;
                                                checkDsm5?: ...;
                                                checkIcd10?: ...;
                                                hiddenInstructions?: ...;
                                                id: ...;
                                                isAllowBulletPoints?: ...;
                                                isUnstructuredNarrative?: ...;
                                                linkedAuditTemplateIds?: ...;
                                                sections?: ...;
                                                title?: ...;
                                            };
                                            meta: object;
                                            output: {
                                                additional_ai_instructions: ...;
                                                check_cpt: ...;
                                                check_demo: ...;
                                                check_dsm_5: ...;
                                                check_icd_10: ...;
                                                created_by: ...;
                                                created_by_circle: ...;
                                                deleted: ...;
                                                hidden_instructions: ...;
                                                id: ...;
                                                is_allow_bullet_points: ...;
                                                is_unstructured_narrative: ...;
                                                last_updated: ...;
                                                last_used: ...;
                                                original_template_id: ...;
                                                shared_with_org_id: ...;
                                                title: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        userPrompts: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    create: MutationProcedure<
                                        {
                                            input: { prompt: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                is_pinned: ...;
                                                prompt: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                    delete: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                is_pinned: ...;
                                                prompt: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                    list: QueryProcedure<{ input: void; meta: object; output: (...)[] }>;
                                    togglePin: MutationProcedure<
                                        {
                                            input: { id: ... };
                                            meta: object;
                                            output: {
                                                created_at: ...;
                                                id: ...;
                                                is_pinned: ...;
                                                prompt: ...;
                                                user_id: ...;
                                            };
                                        },
                                    >;
                                },
                            >,
                        >;
                        utilization: BuiltRouter<
                            {
                                ctx: TRPCContext;
                                errorShape: DefaultErrorShape;
                                meta: object;
                                transformer: false;
                            },
                            DecorateCreateRouterOptions<
                                {
                                    episodeAuthorizations: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId: ... };
                                            meta: object;
                                            output: { authorizations: ...; canSeePayer: ... };
                                        },
                                    >;
                                    facilityLedger: QueryProcedure<
                                        {
                                            input: (...) & (...);
                                            meta: object;
                                            output: {
                                                canSeePayer: ...;
                                                facility: ...;
                                                freshness: ...;
                                                programs: ...;
                                                rows: ...;
                                                serviceTypes: ...;
                                            };
                                        },
                                    >;
                                    listFacilities: QueryProcedure<
                                        {
                                            input: { from: ...; to: ... };
                                            meta: object;
                                            output: { activePatients: ...; facilities: ...; freshness: ... };
                                        },
                                    >;
                                    listForPatient: QueryProcedure<
                                        {
                                            input: { patientId: ...; treatmentEpisodeId?: ... };
                                            meta: object;
                                            output: { events: ...; timezone: ... };
                                        },
                                    >;
                                },
                            >,
                        >;
                    },
                >,
            >,
        >