export type GetApiPatientsIdAttachmentsNameCompressedMd5Args = {'If-None-Match'?: string | undefined, id: string, name: string}; export type GetApiPatientsIdAttachmentsNameCompressedMd5Options = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get MD5 of attachment on disk * * GET /patients/{id}/attachments/{name}/compressed-md5 */ export const getApiPatientsIdAttachmentsNameCompressedMd5 = async (args: GetApiPatientsIdAttachmentsNameCompressedMd5Args, options?: GetApiPatientsIdAttachmentsNameCompressedMd5Options) => { const {baseUrl = "https://orthanc.uclouvain.be/demo", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args['If-None-Match'] != null) headers.set("If-None-Match", String(args['If-None-Match'])) const url = `${baseUrl.replace(/\/+$/, '')}/patients/${encodeURIComponent(String(args.id))}/attachments/${encodeURIComponent(String(args.name))}/compressed-md5${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };