export type CreateApiV1ConsultationsPidVitalSignsArgs = {pid: string, 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 CreateApiV1ConsultationsPidVitalSignsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Record a vital sign * * POST /v1/consultations/{pid}/vital_signs */ export const createApiV1ConsultationsPidVitalSigns = async (args: CreateApiV1ConsultationsPidVitalSignsArgs, options?: CreateApiV1ConsultationsPidVitalSignsOptions) => { 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${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };