O3 Framework / getVisitTypes
getVisitTypes(
url):Promise<VisitType[]>
Defined in: packages/framework/esm-emr-api/src/visit-type.ts:30
Fetches all available visit types from the OpenMRS REST API.
string = visitTypesUrl
The endpoint to read from, defaulting to visitTypesUrl. This exists so that the function can be passed straight to SWR as a fetcher, which calls it with the cache key.
Promise<VisitType[]>
A Promise that resolves with an array of VisitType objects.
import { getVisitTypes } from '@openmrs/esm-framework';
const visitTypes = await getVisitTypes();
console.log('Available visit types:', visitTypes);