Search in sources :

Example 1 with EncounterDiagnosesTagHandler

use of org.openmrs.module.coreapps.htmlformentry.EncounterDiagnosesTagHandler 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)

Example 2 with EncounterDiagnosesTagHandler

use of org.openmrs.module.coreapps.htmlformentry.EncounterDiagnosesTagHandler in project openmrs-module-coreapps by openmrs.

the class CoreAppsActivator method setupEncounterDiagnosesTagHandler.

/**
 * Public static so it can be used in tests
 * @param conceptService
 * @param emrApiProperties
 * @return
 */
public static EncounterDiagnosesTagHandler setupEncounterDiagnosesTagHandler(ConceptService conceptService, AdtService adtService, EmrApiProperties emrApiProperties, UiUtils uiUtils) {
    EncounterDiagnosesTagHandler encounterDiagnosesTagHandler = new EncounterDiagnosesTagHandler();
    encounterDiagnosesTagHandler.setEmrApiProperties(emrApiProperties);
    encounterDiagnosesTagHandler.setConceptService(conceptService);
    encounterDiagnosesTagHandler.setAdtService(adtService);
    encounterDiagnosesTagHandler.setUiUtils(uiUtils);
    return encounterDiagnosesTagHandler;
}
Also used : EncounterDiagnosesTagHandler(org.openmrs.module.coreapps.htmlformentry.EncounterDiagnosesTagHandler)

Aggregations

EncounterDiagnosesTagHandler (org.openmrs.module.coreapps.htmlformentry.EncounterDiagnosesTagHandler)2 ConceptService (org.openmrs.api.ConceptService)1 CodedOrFreeTextObsTagHandler (org.openmrs.module.coreapps.htmlformentry.CodedOrFreeTextObsTagHandler)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