O3 Framework / getVisitStore
getVisitStore():
StoreApi<VisitStoreState>
Defined in: packages/framework/esm-emr-api/src/visit-utils.ts:78
Returns the global visit store that manages the current visit state. The store contains information about the current patient’s visit and provides methods for subscribing to visit state changes.
StoreApi<VisitStoreState>
The global visit store instance.
import { getVisitStore } from '@openmrs/esm-framework';
const store = getVisitStore();
const unsubscribe = store.subscribe((state) => {
console.log('Current patient:', state.patientUuid);
});