Circle V2 API Docs
    Preparing search index...

    Variable patientsRepoConst

    patientsRepo: DbRepo<
        {
            countInOrganization: (
                params: ListPatientsInOrganizationParams,
            ) => Promise<number>;
            create: (
                params: {} & {
                    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;
                },
            ) => Promise<
                {
                    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;
                },
            >;
            delete: (id: PatientId, entityId: EntityId) => Promise<void>;
            getById: (
                id: PatientId,
            ) => Promise<
                {
                    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;
                },
            >;
            getDetail: (
                id: PatientId,
            ) => Promise<
                {
                    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;
                },
            >;
            getLabelsByIds: (
                ids: PatientId[],
            ) => Promise<
                {
                    first_name: string
                    | null;
                    last_name: string | null;
                    patient_id: PatientId;
                }[],
            >;
            getOverview: (
                id: PatientId,
            ) => Promise<
                {
                    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;
                },
            >;
            listByExternalIdsForFacility: (
                params: {
                    externalPatientIds: string[];
                    externalSource:
                        | "kipu"
                        | "lightningstep"
                        | "sunwave"
                        | "qualifacts_insync";
                    facilityId: FacilityId;
                },
            ) => Promise<
                {
                    external_patient_id: string
                    | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    patient_id: PatientId;
                }[],
            >;
            listInOrganization: (
                params: ListPatientsInOrganizationParams,
            ) => Promise<
                {
                    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;
                }[],
            >;
            moveReferences: (
                params: { sourcePatientId: PatientId; targetPatientId: PatientId },
            ) => Promise<
                {
                    reassignedRowCounts: {
                        case_documents: number;
                        cases: number;
                        form_runs: number;
                        patient_admissions: number;
                        patient_charts: number;
                        patient_insurances: number;
                        patient_utilization_reviews: number;
                        sessions: number;
                        treatment_plans: number;
                    };
                },
            >;
            update: (
                id: PatientId,
                params: {
                    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;
                },
            ) => Promise<
                {
                    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;
                },
            >;
            upsert: (
                rows: (
                    {} & {
                        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;
                    }
                )[],
            ) => Promise<
                {
                    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;
                }[],
            >;
        },
    > = ...