use of org.openmrs.module.emrapi.disposition.actions.DispositionAction in project openmrs-module-pihcore by PIH.
the class ApplyDispositionAction method applyDispositionActions.
void applyDispositionActions(FormEntrySession session, DispositionService dispositionService) {
DispositionDescriptor dispositionDescriptor = dispositionService.getDispositionDescriptor();
Encounter encounter = session.getEncounter();
Disposition disposition = null;
Obs dispositionObsGroup = null;
for (Obs candidate : encounter.getObsAtTopLevel(false)) {
if (dispositionDescriptor.isDisposition(candidate)) {
dispositionObsGroup = candidate;
disposition = dispositionService.getDispositionFromObsGroup(dispositionObsGroup);
}
}
if (disposition != null && disposition.getActions() != null) {
for (String actionBeanName : disposition.getActions()) {
DispositionAction action = getBean(actionBeanName, DispositionAction.class);
action.action(new EncounterDomainWrapper(encounter), dispositionObsGroup, null);
}
}
}
Aggregations