Circle V2 API Docs
    Preparing search index...
    integrationsRouter: BuiltRouter<
        {
            ctx: TRPCContext;
            errorShape: DefaultErrorShape;
            meta: object;
            transformer: false;
        },
        DecorateCreateRouterOptions<
            {
                fullSync: MutationProcedure<
                    {
                        input: { dry_run?: boolean; integration_id: string };
                        meta: object;
                        output: {
                            chart_reviews_enqueued: number;
                            patients_enqueued: number;
                            success: true;
                        };
                    },
                >;
                getIntegrationLocations: QueryProcedure<
                    {
                        input: | {
                            credentials: {
                                api_id: string;
                                api_secret: string;
                                realm_id: string;
                                sunwave_email: string;
                            };
                            type: "sunwave";
                        }
                        | { credentials: { bearer_token: string }; type: "lightningstep" }
                        | { credentials: { app_id: string }; type: "kipu" };
                        meta: object;
                        output:
                            | {
                                facilities: {
                                    id: number;
                                    level_of_cares: {
                                        id: ...;
                                        is_inpatient: ...;
                                        legacy_id: ...;
                                        name: ...;
                                    }[];
                                    name: string;
                                    programs: { id: ...; name: ... }[];
                                }[];
                            }
                            | { locations: { location_id: number; location_name: string }[] }
                            | { locations: { id: number; name: string }[] };
                    },
                >;
                syncAdmissions: MutationProcedure<
                    {
                        input: {
                            dry_run?: boolean;
                            end_date?: string;
                            integration_id: string;
                            start_date?: string;
                        };
                        meta: object;
                        output: {
                            error: null;
                            patients?: { first_name: string; id: number; last_name: string }[];
                            stats?: {
                                date_range?: { end?: (...) | (...); start?: (...) | (...) };
                                records_fetched: number;
                                records_upserted?: number;
                            };
                            success: true;
                        };
                    },
                >;
                syncPatient: MutationProcedure<
                    {
                        input: {
                            dryRun?: boolean;
                            patientId: string;
                            syncDocuments?: boolean;
                        };
                        meta: object;
                        output: { success: true };
                    },
                >;
                update: MutationProcedure<
                    {
                        input: {
                            id: string;
                            integration?: | {
                                credentials: {
                                    app_id: string;
                                    location_id: number;
                                    location_name?: string;
                                };
                                type: "kipu";
                            }
                            | {
                                credentials: {
                                    bearer_token: string;
                                    location_ids: number[];
                                    location_name?: string;
                                };
                                type: "lightningstep";
                            }
                            | {
                                credentials: {
                                    api_id: string;
                                    api_secret: string;
                                    location_name?: string;
                                    realm_id: string;
                                    service_facility_id: number;
                                    sunwave_email: string;
                                };
                                type: "sunwave";
                            };
                            label?: string;
                            status?: "active"
                            | "inactive";
                        };
                        meta: object;
                        output: {
                            created_at: DbDate;
                            created_by: string
                            | null;
                            credentials:
                                | {
                                    access_id: string;
                                    app_id: string;
                                    location_id: number;
                                    location_name?: string;
                                    secret_key: string;
                                }
                                | {
                                    bearer_token: string;
                                    location_ids: number[];
                                    location_name?: string;
                                }
                                | {
                                    api_id: string;
                                    api_secret: string;
                                    location_name?: string;
                                    realm_id: string;
                                    service_facility_id: number;
                                    sunwave_email: string;
                                };
                            entity_id: number & { __brand: "EntityId" };
                            facility_id: FacilityId | null;
                            id: IntegrationId;
                            label: string | null;
                            last_sync: string | null;
                            status: "active" | "inactive" | "error";
                            type: "kipu" | "lightningstep" | "sunwave";
                            updated_at: DbDate;
                        };
                    },
                >;
            },
        >,
    > = ...