use of org.openmrs.module.coreapps.htmlformentry.EncounterDispositionTagHandler in project openmrs-module-coreapps by openmrs.
the class CoreAppsActivator method contextRefreshed.
/**
* @see ModuleActivator#contextRefreshed()
*/
public void contextRefreshed() {
ConceptService conceptService = Context.getConceptService();
EmrApiProperties emrApiProperties = Context.getRegisteredComponent("emrApiProperties", EmrApiProperties.class);
DispositionService dispositionService = Context.getRegisteredComponent("dispositionService", DispositionService.class);
AdtService adtService = Context.getRegisteredComponent("adtService", AdtService.class);
UiUtils uiUtils = Context.getRegisteredComponent("uiUtils", BasicUiUtils.class);
if (ModuleFactory.isModuleStarted("htmlformentry")) {
HtmlFormEntryService htmlFormEntryService = Context.getService(HtmlFormEntryService.class);
EncounterDiagnosesTagHandler encounterDiagnosesTagHandler = CoreAppsActivator.setupEncounterDiagnosesTagHandler(conceptService, adtService, emrApiProperties, uiUtils);
htmlFormEntryService.addHandler(CoreAppsConstants.HTMLFORMENTRY_ENCOUNTER_DIAGNOSES_TAG_NAME, encounterDiagnosesTagHandler);
EncounterDispositionTagHandler encounterDispositionTagHandler = CoreAppsActivator.setupEncounterDispositionTagHandler(emrApiProperties, dispositionService, adtService);
htmlFormEntryService.addHandler(CoreAppsConstants.HTMLFORMENTRY_ENCOUNTER_DISPOSITION_TAG_NAME, encounterDispositionTagHandler);
htmlFormEntryService.addHandler(CoreAppsConstants.HTMLFORMENTRY_CODED_OR_FREE_TEXT_OBS_TAG_NAME, new CodedOrFreeTextObsTagHandler());
}
log.info("Core Apps Module refreshed");
}
use of org.openmrs.module.coreapps.htmlformentry.EncounterDispositionTagHandler in project openmrs-module-coreapps by openmrs.
the class CoreAppsActivator method setupEncounterDispositionTagHandler.
/**
* Public static so it can be used in tests
* @param emrApiProperties
* @return
*/
public static EncounterDispositionTagHandler setupEncounterDispositionTagHandler(EmrApiProperties emrApiProperties, DispositionService dispositionService, AdtService adtService) {
EncounterDispositionTagHandler encounterDispositionTagHandler = new EncounterDispositionTagHandler();
encounterDispositionTagHandler.setEmrApiProperties(emrApiProperties);
encounterDispositionTagHandler.setDispositionService(dispositionService);
encounterDispositionTagHandler.setAdtService(adtService);
return encounterDispositionTagHandler;
}
Aggregations