/**
 * Generated by orval v7.21.0 🍺
 * Do not edit manually.
 * MBHS
 * Multidimensional Behavioral Health Screen
 * OpenAPI spec version: 1.0.0
 */
import { useQuery } from "@tanstack/react-query";
import type {
  DataTag,
  DefinedInitialDataOptions,
  DefinedUseQueryResult,
  QueryClient,
  QueryFunction,
  QueryKey,
  UndefinedInitialDataOptions,
  UseQueryOptions,
  UseQueryResult,
} from "@tanstack/react-query";

import type {
  DashboardControllerGetClientsChartV1Params,
  DashboardControllerGetCompletedScreeningsV1Params,
  DashboardControllerGetHighRiskCasesV1Params,
  DashboardControllerGetPendingScreeningsV1Params,
  DashboardControllerGetScreeningsChartV1Params,
  PMClientsChartResponse,
  PMCompletedScreeningsResponse,
  PMDashboardStatsResponse,
  PMHighRiskCasesResponse,
  PMPendingScreeningsResponse,
  PMScreeningsChartResponse,
} from "../generated.schemas";

import { customInstance } from "../../../config/axios";

type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];

/**
 * @summary Get dashboard statistics
 */
export const dashboardControllerGetStatisticsV1 = (
  options?: SecondParameter<typeof customInstance>,
  signal?: AbortSignal,
) => {
  return customInstance<PMDashboardStatsResponse>(
    { url: `/v1/practice-manager/dashboard/statistics`, method: "GET", signal },
    options,
  );
};

export const getDashboardControllerGetStatisticsV1QueryKey = () => {
  return [`/v1/practice-manager/dashboard/statistics`] as const;
};

export const getDashboardControllerGetStatisticsV1QueryOptions = <
  TData = Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
  TError = void,
>(options?: {
  query?: Partial<
    UseQueryOptions<
      Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
      TError,
      TData
    >
  >;
  request?: SecondParameter<typeof customInstance>;
}) => {
  const { query: queryOptions, request: requestOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ?? getDashboardControllerGetStatisticsV1QueryKey();

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>
  > = ({ signal }) =>
    dashboardControllerGetStatisticsV1(requestOptions, signal);

  return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
    Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
    TError,
    TData
  > & { queryKey: DataTag<QueryKey, TData, TError> };
};

export type DashboardControllerGetStatisticsV1QueryResult = NonNullable<
  Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>
>;
export type DashboardControllerGetStatisticsV1QueryError = void;

export function useDashboardControllerGetStatisticsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
  TError = void,
>(
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetStatisticsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
  TError = void,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetStatisticsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
  TError = void,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get dashboard statistics
 */

export function useDashboardControllerGetStatisticsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
  TError = void,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetStatisticsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions =
    getDashboardControllerGetStatisticsV1QueryOptions(options);

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * @summary Get screenings over time chart data
 */
export const dashboardControllerGetScreeningsChartV1 = (
  params?: DashboardControllerGetScreeningsChartV1Params,
  options?: SecondParameter<typeof customInstance>,
  signal?: AbortSignal,
) => {
  return customInstance<PMScreeningsChartResponse>(
    {
      url: `/v1/practice-manager/dashboard/screenings-chart`,
      method: "GET",
      params,
      signal,
    },
    options,
  );
};

export const getDashboardControllerGetScreeningsChartV1QueryKey = (
  params?: DashboardControllerGetScreeningsChartV1Params,
) => {
  return [
    `/v1/practice-manager/dashboard/screenings-chart`,
    ...(params ? [params] : []),
  ] as const;
};

export const getDashboardControllerGetScreeningsChartV1QueryOptions = <
  TData = Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetScreeningsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
) => {
  const { query: queryOptions, request: requestOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getDashboardControllerGetScreeningsChartV1QueryKey(params);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>
  > = ({ signal }) =>
    dashboardControllerGetScreeningsChartV1(params, requestOptions, signal);

  return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
    Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
    TError,
    TData
  > & { queryKey: DataTag<QueryKey, TData, TError> };
};

export type DashboardControllerGetScreeningsChartV1QueryResult = NonNullable<
  Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>
>;
export type DashboardControllerGetScreeningsChartV1QueryError = void;

export function useDashboardControllerGetScreeningsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
  TError = void,
>(
  params: undefined | DashboardControllerGetScreeningsChartV1Params,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetScreeningsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetScreeningsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetScreeningsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetScreeningsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get screenings over time chart data
 */

export function useDashboardControllerGetScreeningsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetScreeningsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetScreeningsChartV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getDashboardControllerGetScreeningsChartV1QueryOptions(
    params,
    options,
  );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * @summary Get clients over time chart data
 */
export const dashboardControllerGetClientsChartV1 = (
  params?: DashboardControllerGetClientsChartV1Params,
  options?: SecondParameter<typeof customInstance>,
  signal?: AbortSignal,
) => {
  return customInstance<PMClientsChartResponse>(
    {
      url: `/v1/practice-manager/dashboard/clients-chart`,
      method: "GET",
      params,
      signal,
    },
    options,
  );
};

export const getDashboardControllerGetClientsChartV1QueryKey = (
  params?: DashboardControllerGetClientsChartV1Params,
) => {
  return [
    `/v1/practice-manager/dashboard/clients-chart`,
    ...(params ? [params] : []),
  ] as const;
};

export const getDashboardControllerGetClientsChartV1QueryOptions = <
  TData = Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetClientsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
) => {
  const { query: queryOptions, request: requestOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getDashboardControllerGetClientsChartV1QueryKey(params);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>
  > = ({ signal }) =>
    dashboardControllerGetClientsChartV1(params, requestOptions, signal);

  return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
    Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
    TError,
    TData
  > & { queryKey: DataTag<QueryKey, TData, TError> };
};

export type DashboardControllerGetClientsChartV1QueryResult = NonNullable<
  Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>
>;
export type DashboardControllerGetClientsChartV1QueryError = void;

export function useDashboardControllerGetClientsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
  TError = void,
>(
  params: undefined | DashboardControllerGetClientsChartV1Params,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetClientsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetClientsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetClientsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetClientsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get clients over time chart data
 */

export function useDashboardControllerGetClientsChartV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
  TError = void,
>(
  params?: DashboardControllerGetClientsChartV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetClientsChartV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getDashboardControllerGetClientsChartV1QueryOptions(
    params,
    options,
  );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * @summary Get high-risk cases
 */
export const dashboardControllerGetHighRiskCasesV1 = (
  params?: DashboardControllerGetHighRiskCasesV1Params,
  options?: SecondParameter<typeof customInstance>,
  signal?: AbortSignal,
) => {
  return customInstance<PMHighRiskCasesResponse>(
    {
      url: `/v1/practice-manager/dashboard/high-risk`,
      method: "GET",
      params,
      signal,
    },
    options,
  );
};

export const getDashboardControllerGetHighRiskCasesV1QueryKey = (
  params?: DashboardControllerGetHighRiskCasesV1Params,
) => {
  return [
    `/v1/practice-manager/dashboard/high-risk`,
    ...(params ? [params] : []),
  ] as const;
};

export const getDashboardControllerGetHighRiskCasesV1QueryOptions = <
  TData = Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
  TError = void,
>(
  params?: DashboardControllerGetHighRiskCasesV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
) => {
  const { query: queryOptions, request: requestOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getDashboardControllerGetHighRiskCasesV1QueryKey(params);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>
  > = ({ signal }) =>
    dashboardControllerGetHighRiskCasesV1(params, requestOptions, signal);

  return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
    Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
    TError,
    TData
  > & { queryKey: DataTag<QueryKey, TData, TError> };
};

export type DashboardControllerGetHighRiskCasesV1QueryResult = NonNullable<
  Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>
>;
export type DashboardControllerGetHighRiskCasesV1QueryError = void;

export function useDashboardControllerGetHighRiskCasesV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
  TError = void,
>(
  params: undefined | DashboardControllerGetHighRiskCasesV1Params,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetHighRiskCasesV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
  TError = void,
>(
  params?: DashboardControllerGetHighRiskCasesV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetHighRiskCasesV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
  TError = void,
>(
  params?: DashboardControllerGetHighRiskCasesV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get high-risk cases
 */

export function useDashboardControllerGetHighRiskCasesV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
  TError = void,
>(
  params?: DashboardControllerGetHighRiskCasesV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetHighRiskCasesV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getDashboardControllerGetHighRiskCasesV1QueryOptions(
    params,
    options,
  );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * @summary Get pending screenings
 */
export const dashboardControllerGetPendingScreeningsV1 = (
  params?: DashboardControllerGetPendingScreeningsV1Params,
  options?: SecondParameter<typeof customInstance>,
  signal?: AbortSignal,
) => {
  return customInstance<PMPendingScreeningsResponse>(
    {
      url: `/v1/practice-manager/dashboard/pending`,
      method: "GET",
      params,
      signal,
    },
    options,
  );
};

export const getDashboardControllerGetPendingScreeningsV1QueryKey = (
  params?: DashboardControllerGetPendingScreeningsV1Params,
) => {
  return [
    `/v1/practice-manager/dashboard/pending`,
    ...(params ? [params] : []),
  ] as const;
};

export const getDashboardControllerGetPendingScreeningsV1QueryOptions = <
  TData = Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
  TError = void,
>(
  params?: DashboardControllerGetPendingScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
) => {
  const { query: queryOptions, request: requestOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getDashboardControllerGetPendingScreeningsV1QueryKey(params);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>
  > = ({ signal }) =>
    dashboardControllerGetPendingScreeningsV1(params, requestOptions, signal);

  return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
    Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
    TError,
    TData
  > & { queryKey: DataTag<QueryKey, TData, TError> };
};

export type DashboardControllerGetPendingScreeningsV1QueryResult = NonNullable<
  Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>
>;
export type DashboardControllerGetPendingScreeningsV1QueryError = void;

export function useDashboardControllerGetPendingScreeningsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
  TError = void,
>(
  params: undefined | DashboardControllerGetPendingScreeningsV1Params,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetPendingScreeningsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
  TError = void,
>(
  params?: DashboardControllerGetPendingScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
          TError,
          Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetPendingScreeningsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
  TError = void,
>(
  params?: DashboardControllerGetPendingScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get pending screenings
 */

export function useDashboardControllerGetPendingScreeningsV1<
  TData = Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
  TError = void,
>(
  params?: DashboardControllerGetPendingScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetPendingScreeningsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getDashboardControllerGetPendingScreeningsV1QueryOptions(
    params,
    options,
  );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * @summary Get completed screenings
 */
export const dashboardControllerGetCompletedScreeningsV1 = (
  params?: DashboardControllerGetCompletedScreeningsV1Params,
  options?: SecondParameter<typeof customInstance>,
  signal?: AbortSignal,
) => {
  return customInstance<PMCompletedScreeningsResponse>(
    {
      url: `/v1/practice-manager/dashboard/completed`,
      method: "GET",
      params,
      signal,
    },
    options,
  );
};

export const getDashboardControllerGetCompletedScreeningsV1QueryKey = (
  params?: DashboardControllerGetCompletedScreeningsV1Params,
) => {
  return [
    `/v1/practice-manager/dashboard/completed`,
    ...(params ? [params] : []),
  ] as const;
};

export const getDashboardControllerGetCompletedScreeningsV1QueryOptions = <
  TData = Awaited<
    ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
  >,
  TError = void,
>(
  params?: DashboardControllerGetCompletedScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
) => {
  const { query: queryOptions, request: requestOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getDashboardControllerGetCompletedScreeningsV1QueryKey(params);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>
  > = ({ signal }) =>
    dashboardControllerGetCompletedScreeningsV1(params, requestOptions, signal);

  return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
    Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>,
    TError,
    TData
  > & { queryKey: DataTag<QueryKey, TData, TError> };
};

export type DashboardControllerGetCompletedScreeningsV1QueryResult =
  NonNullable<
    Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>
  >;
export type DashboardControllerGetCompletedScreeningsV1QueryError = void;

export function useDashboardControllerGetCompletedScreeningsV1<
  TData = Awaited<
    ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
  >,
  TError = void,
>(
  params: undefined | DashboardControllerGetCompletedScreeningsV1Params,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<
            ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
          >,
          TError,
          Awaited<
            ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetCompletedScreeningsV1<
  TData = Awaited<
    ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
  >,
  TError = void,
>(
  params?: DashboardControllerGetCompletedScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<
            ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
          >,
          TError,
          Awaited<
            ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useDashboardControllerGetCompletedScreeningsV1<
  TData = Awaited<
    ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
  >,
  TError = void,
>(
  params?: DashboardControllerGetCompletedScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get completed screenings
 */

export function useDashboardControllerGetCompletedScreeningsV1<
  TData = Awaited<
    ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>
  >,
  TError = void,
>(
  params?: DashboardControllerGetCompletedScreeningsV1Params,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof dashboardControllerGetCompletedScreeningsV1>>,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customInstance>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions =
    getDashboardControllerGetCompletedScreeningsV1QueryOptions(params, options);

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  query.queryKey = queryOptions.queryKey;

  return query;
}
