Circle V2 API Docs
    Preparing search index...
    patientsRouter: BuiltRouter<
        {
            ctx: TRPCContext;
            errorShape: DefaultErrorShape;
            meta: object;
            transformer: false;
        },
        DecorateCreateRouterOptions<
            {
                createPatient: MutationProcedure<
                    {
                        input: {
                            addressCity?: string;
                            addressState?: string;
                            addressStreet1?: string;
                            addressStreet2?: string;
                            addressZipcode?: string;
                            dob?: string;
                            email?: string;
                            facilityId?: string;
                            firstName: string;
                            gender?: string;
                            intakeNotes?: string;
                            lastName: string;
                            phoneMobile?: string;
                        };
                        meta: object;
                        output: {
                            address_city: string
                            | null;
                            address_state: string | null;
                            address_street1: string | null;
                            address_street2: string | null;
                            address_zipcode: string | null;
                            created_at: DbDate;
                            created_by: UserId | null;
                            dob: string | null;
                            email: string | null;
                            entity_id: number & { __brand: "EntityId" } | null;
                            external_patient_id: string | null;
                            external_source:
                                | "kipu"
                                | "lightningstep"
                                | "sunwave"
                                | "qualifacts_insync"
                                | null;
                            facility_id: string & { __brand: "FacilityId" }
                            | null;
                            first_name: string | null;
                            gender: string | null;
                            intake_notes: string | null;
                            last_name: string | null;
                            last_updated_summary: string | null;
                            patient_id: PatientId;
                            phone_mobile: string | null;
                            primary_provider_id: string & { __brand: "ProfileId" } | null;
                            status: string | null;
                            summary: LegacyPatientSummary | null;
                        };
                    },
                >;
                deletePatient: MutationProcedure<
                    { input: { id: string }; meta: object; output: { id: PatientId } },
                >;
                getPatientById: QueryProcedure<
                    {
                        input: { id: string };
                        meta: object;
                        output: {
                            address_city: string | null;
                            address_state: string | null;
                            address_street1: string | null;
                            address_street2: string | null;
                            address_zipcode: string | null;
                            created_at: DbDate;
                            created_by: UserId | null;
                            dob: string | null;
                            email: string | null;
                            entity_id: number & { __brand: "EntityId" } | null;
                            external_patient_id: string | null;
                            external_source:
                                | "kipu"
                                | "lightningstep"
                                | "sunwave"
                                | "qualifacts_insync"
                                | null;
                            facility_id: string & { __brand: "FacilityId" }
                            | null;
                            first_name: string | null;
                            gender: string | null;
                            intake_notes: string | null;
                            last_name: string | null;
                            last_updated_summary: string | null;
                            patient_id: PatientId;
                            phone_mobile: string | null;
                            primary_provider_id: string & { __brand: "ProfileId" } | null;
                            status: string | null;
                            summary: LegacyPatientSummary | null;
                        };
                    },
                >;
                getPatientDetail: QueryProcedure<
                    {
                        input: { id: string };
                        meta: object;
                        output: {
                            admitted_at: string | null;
                            created_at: DbDate;
                            discharged_at: string | null;
                            dob: string | null;
                            external_source:
                                | "kipu"
                                | "lightningstep"
                                | "sunwave"
                                | "qualifacts_insync"
                                | null;
                            facility_id: string & { __brand: "FacilityId" }
                            | null;
                            facility_name: string | null;
                            first_name: string | null;
                            last_name: string | null;
                            last_sync: string | null;
                            patient_id: PatientId;
                            primary_provider_id: string & { __brand: "ProfileId" } | null;
                            provider_first_name: string | null;
                            provider_last_name: string | null;
                            provider_title: string | null;
                        };
                    },
                >;
                getPatientOverview: QueryProcedure<
                    {
                        input: { id: string };
                        meta: object;
                        output: {
                            patient: {
                                admitted_at: string | null;
                                created_at: DbDate;
                                creator_first_name: string | null;
                                creator_last_name: string | null;
                                discharged_at: string | null;
                                external_source:
                                    | "kipu"
                                    | "lightningstep"
                                    | "sunwave"
                                    | "qualifacts_insync"
                                    | null;
                                facility_name: string
                                | null;
                                first_name: string | null;
                                last_name: string | null;
                                last_sync: string | null;
                                last_updated_summary: string | null;
                                patient_id: PatientId;
                                provider_first_name: string | null;
                                provider_last_name: string | null;
                                provider_title: string | null;
                                summary: LegacyPatientSummary | null;
                            };
                            recentSessions: {
                                ai_summarized_note: string
                                | null;
                                as_summarized_note_type: string | null;
                                audit_run_id: string & { __brand: ... } | null;
                                audit_status:
                                    | "error"
                                    | "pass"
                                    | "fail"
                                    | "needs_review"
                                    | "pending"
                                    | "in_progress"
                                    | "not_started"
                                    | null;
                                case_id: string & { __brand: ... }
                                | null;
                                cpt_code: unknown[] | null;
                                created_at: DbDate;
                                created_by: string | null;
                                dsm_code: { code: ...; description: ...; status: ... }[] | null;
                                end_timestamp: DbDate;
                                error_msg: string | null;
                                file_url: string | null;
                                icd_code: { code: ...; description: ...; status: ... }[] | null;
                                id: SessionId;
                                manual_entry: boolean | null;
                                patient_id: string & { __brand: ... } | null;
                                private_note: string | null;
                                progress_status:
                                    | "initialized"
                                    | "processing"
                                    | "transcribing"
                                    | "complete"
                                    | "failed"
                                    | null;
                                selected_template: | {
                                    additional_ai_instructions?: (...)
                                    | (...);
                                    check_cpt?: (...) | (...) | (...);
                                    check_demo?: (...) | (...) | (...);
                                    check_dsm_5?: (...) | (...) | (...);
                                    check_icd_10?: (...) | (...) | (...);
                                    created_by?: (...) | (...) | (...);
                                    created_by_circle?: (...) | (...) | (...);
                                    hidden_instructions?: (...) | (...) | (...);
                                    id: TemplateId;
                                    is_allow_bullet_points?: (...) | (...) | (...);
                                    is_unstructured_narrative?: (...) | (...) | (...);
                                    last_updated?: (...) | (...) | (...);
                                    last_used?: (...) | (...) | (...);
                                    name?: (...) | (...);
                                    original_template_id?: (...) | (...);
                                    sections: (...)[];
                                    selected_audit_template_ids?: (...) | (...);
                                    shared_with_org_id?: (...) | (...);
                                    title: string;
                                    [key: string]: unknown;
                                }
                                | null;
                                start_timestamp: DbDate;
                                transcript: string
                                | null;
                                updated_by: number | null;
                            }[];
                        };
                    },
                >;
                listEpisodes: QueryProcedure<
                    {
                        input: { patientId: string };
                        meta: object;
                        output: {
                            admission_date: string;
                            discharge_date: string | null;
                            external_id: string | null;
                            facility_name: string | null;
                            id: TreatmentEpisodeId;
                            integration_id: string | null;
                            integration_status: "error" | "active" | "inactive" | null;
                            last_synced_documents: string | null;
                            status: string | null;
                        }[];
                    },
                >;
                listInOrganization: QueryProcedure<
                    {
                        input: {
                            cursor?: number;
                            facilityId?: unknown;
                            limit?: number;
                            offset?: number;
                            patientIds?: unknown;
                            patientSearch?: string;
                            primaryProviderId?: unknown;
                            sortBy?: "name"
                            | "created_at"
                            | "admitted_at"
                            | "discharged_at";
                            sortOrder?: "asc" | "desc";
                            status?: unknown;
                        };
                        meta: object;
                        output: PaginatedResponse<
                            {
                                admitted_at: string
                                | null;
                                created_at: DbDate;
                                discharged_at: string | null;
                                dob: string | null;
                                entity_id: number & { __brand: "EntityId" } | null;
                                facility_id: string & { __brand: "FacilityId" } | null;
                                facility_name: string | null;
                                first_name: string | null;
                                last_name: string | null;
                                last_updated_summary: string | null;
                                patient_id: PatientId;
                                primary_provider_id: string & { __brand: "ProfileId" } | null;
                                provider_first_name: string | null;
                                provider_last_name: string | null;
                                provider_title: string | null;
                                status: string | null;
                            },
                        >;
                    },
                >;
                mergePatients: MutationProcedure<
                    {
                        input: { duplicatePatientId: string; primaryPatientId: string };
                        meta: object;
                        output: ExecutePatientMergeServiceResult;
                    },
                >;
                updatePatient: MutationProcedure<
                    {
                        input: {
                            addressCity?: string;
                            addressState?: string;
                            addressStreet1?: string;
                            addressStreet2?: string;
                            addressZipcode?: string;
                            dob?: string;
                            email?: string;
                            facilityId?: string;
                            firstName: string;
                            gender?: string;
                            id: string;
                            intakeNotes?: string;
                            lastName: string;
                            phoneMobile?: string;
                        };
                        meta: object;
                        output: {
                            address_city: string
                            | null;
                            address_state: string | null;
                            address_street1: string | null;
                            address_street2: string | null;
                            address_zipcode: string | null;
                            created_at: DbDate;
                            created_by: UserId | null;
                            dob: string | null;
                            email: string | null;
                            entity_id: number & { __brand: "EntityId" } | null;
                            external_patient_id: string | null;
                            external_source:
                                | "kipu"
                                | "lightningstep"
                                | "sunwave"
                                | "qualifacts_insync"
                                | null;
                            facility_id: string & { __brand: "FacilityId" }
                            | null;
                            first_name: string | null;
                            gender: string | null;
                            intake_notes: string | null;
                            last_name: string | null;
                            last_updated_summary: string | null;
                            patient_id: PatientId;
                            phone_mobile: string | null;
                            primary_provider_id: string & { __brand: "ProfileId" } | null;
                            status: string | null;
                            summary: LegacyPatientSummary | null;
                        };
                    },
                >;
            },
        >,
    > = ...