Search in sources :

Example 1 with CodedOrFreeTextObsTagHandler

use of org.openmrs.module.coreapps.htmlformentry.CodedOrFreeTextObsTagHandler 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");
}
Also used : DispositionService(org.openmrs.module.emrapi.disposition.DispositionService) AdtService(org.openmrs.module.emrapi.adt.AdtService) HtmlFormEntryService(org.openmrs.module.htmlformentry.HtmlFormEntryService) EmrApiProperties(org.openmrs.module.emrapi.EmrApiProperties) EncounterDiagnosesTagHandler(org.openmrs.module.coreapps.htmlformentry.EncounterDiagnosesTagHandler) ConceptService(org.openmrs.api.ConceptService) EncounterDispositionTagHandler(org.openmrs.module.coreapps.htmlformentry.EncounterDispositionTagHandler) CodedOrFreeTextObsTagHandler(org.openmrs.module.coreapps.htmlformentry.CodedOrFreeTextObsTagHandler) BasicUiUtils(org.openmrs.ui.framework.BasicUiUtils) UiUtils(org.openmrs.ui.framework.UiUtils)

Aggregations

ConceptService (org.openmrs.api.ConceptService)1 CodedOrFreeTextObsTagHandler (org.openmrs.module.coreapps.htmlformentry.CodedOrFreeTextObsTagHandler)1 EncounterDiagnosesTagHandler (org.openmrs.module.coreapps.htmlformentry.EncounterDiagnosesTagHandler)1 EncounterDispositionTagHandler (org.openmrs.module.coreapps.htmlformentry.EncounterDispositionTagHandler)1 EmrApiProperties (org.openmrs.module.emrapi.EmrApiProperties)1 AdtService (org.openmrs.module.emrapi.adt.AdtService)1 DispositionService (org.openmrs.module.emrapi.disposition.DispositionService)1 HtmlFormEntryService (org.openmrs.module.htmlformentry.HtmlFormEntryService)1 BasicUiUtils (org.openmrs.ui.framework.BasicUiUtils)1 UiUtils (org.openmrs.ui.framework.UiUtils)1