export type DeleteApiPatientsPatientIdPoliciesPolicyIdArgs = {patient_id: number, policy_id: number}; export type DeleteApiPatientsPatientIdPoliciesPolicyIdOptions = {baseUrl?: string | undefined, RequireAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Policy * * DELETE /patients/{patient_id}/policies/{policy_id} */ export const deleteApiPatientsPatientIdPoliciesPolicyId = async (args: DeleteApiPatientsPatientIdPoliciesPolicyIdArgs, options?: DeleteApiPatientsPatientIdPoliciesPolicyIdOptions) => { const {baseUrl = "https://sandbox.elationemr.com/api/2.0", fetch: fetchFn = fetch, RequireAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (RequireAuthentication !== undefined) headers.set('authorization', `Bearer ${RequireAuthentication}`) const url = `${baseUrl.replace(/\/+$/, '')}/patients/${encodeURIComponent(String(args.patient_id))}/policies/${encodeURIComponent(String(args.policy_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };