export type CreateApiV1RegistrationsArgs = {body: {patient?: number | undefined, provider?: number | undefined, appointment?: number | undefined, code?: number | undefined, tagging?: string | undefined}}; export type CreateApiV1RegistrationsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check a patient in * * POST /v1/registrations */ export const createApiV1Registrations = async (args: CreateApiV1RegistrationsArgs, options?: CreateApiV1RegistrationsOptions) => { 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/registrations${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 };