export type GetApiPatientsPatientIdPatientFrequencyStatementItemsArgs = {patient_id: number, date_since: string, date_until: string, disaggregated: boolean}; export type GetApiPatientsPatientIdPatientFrequencyStatementItemsOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the patient's summary metrics for the star plot graph * * GET /patients/{patient_id}/patient_frequency_statement_items */ export const getApiPatientsPatientIdPatientFrequencyStatementItems = async (args: GetApiPatientsPatientIdPatientFrequencyStatementItemsArgs, options: GetApiPatientsPatientIdPatientFrequencyStatementItemsOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.date_since != null) query.append("date_since", String(args.date_since)) if (args.date_until != null) query.append("date_until", String(args.date_until)) if (args.disaggregated != null) query.append("disaggregated", String(args.disaggregated)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/patients/${encodeURIComponent(String(args.patient_id))}/patient_frequency_statement_items${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };