export type CreateApiRegisteredUrlForPrescriptionCommunicationEventsArgs = {body: {service: string, event: 'prescription.communication', event_time: number, timestamp?: number | undefined, transaction_id: string, business_id: string, client_id?: string | undefined, data: {actor_oid?: string | undefined, appointment_id: string, clinic_id: string, doc_name?: ({salutation?: string | undefined, first_name?: string | undefined, last_name?: string | undefined}) | undefined, doctor_id: string, patient_id: string, patient_name?: ({salutation?: string | undefined, first_name?: string | undefined, last_name?: string | undefined}) | undefined, prescription_id: string, prescription_url: string}}}; export type CreateApiRegisteredUrlForPrescriptionCommunicationEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Prescription Communication Event * * POST /registered_url_for_prescription_communication_events */ export const createApiRegisteredUrlForPrescriptionCommunicationEvents = async (args: CreateApiRegisteredUrlForPrescriptionCommunicationEventsArgs, options?: CreateApiRegisteredUrlForPrescriptionCommunicationEventsOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/registered_url_for_prescription_communication_events${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 };