O3 Framework / saveVisit
saveVisit(
payload,abortController):Promise<FetchResponse<Visit>>
Defined in: packages/framework/esm-emr-api/src/visit-utils.ts:134
Creates a new visit by sending a POST request to the OpenMRS REST API.
The visit data to create, including patient UUID, visit type, start datetime, and other visit attributes.
AbortController
An AbortController to allow cancellation of the request.
Promise<FetchResponse<Visit>>
A Promise that resolves with the FetchResponse containing the created Visit.
import { saveVisit } from '@openmrs/esm-framework';
const abortController = new AbortController();
const response = await saveVisit({
patient: 'patient-uuid',
visitType: 'visit-type-uuid',
startDatetime: new Date().toISOString()
}, abortController);