export type PatchApiV1ConsultationsPidVitalSignsIdArgs = {pid: string, id: number, body: {recorded_at?: string | undefined, height?: number | undefined, weight?: number | undefined, bp_systolic?: number | undefined, bp_diastolic?: number | undefined, pulse?: number | undefined, temperature?: number | undefined, blood_glucose?: number | undefined, spo2?: number | undefined, respiratory_rate?: number | undefined}}; export type PatchApiV1ConsultationsPidVitalSignsIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Edit a vital sign * * PATCH /v1/consultations/{pid}/vital_signs/{id} */ export const patchApiV1ConsultationsPidVitalSignsId = async (args: PatchApiV1ConsultationsPidVitalSignsIdArgs, options?: PatchApiV1ConsultationsPidVitalSignsIdOptions) => { const {baseUrl = "https://developer.yezza.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("X-Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/consultations/${encodeURIComponent(String(args.pid))}/vital_signs/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };