O3 Framework / getAttachments
getAttachments(
patientUuid,includeEncounterless,abortController):Promise<FetchResponse<any>>
Defined in: packages/framework/esm-emr-api/src/attachments.ts:46
Fetches all attachments for a specific patient from the OpenMRS server.
string
The UUID of the patient whose attachments should be fetched.
boolean
Whether to include attachments that are not associated with any encounter.
AbortController
An AbortController to allow cancellation of the request.
Promise<FetchResponse<any>>
A Promise that resolves with the FetchResponse containing an array of attachments.
import { getAttachments } from '@openmrs/esm-framework';
const abortController = new AbortController();
const response = await getAttachments('patient-uuid', true, abortController);
console.log(response.data.results);