use of org.openmrs.module.htmlformentry.HtmlFormEntryService in project openmrs-module-pihcore by PIH.
the class HtmlFormSetup method setupHtmlFormEntryTagHandlers.
public static void setupHtmlFormEntryTagHandlers() throws Exception {
HtmlFormEntryService htmlFormEntryService = Context.getService(HtmlFormEntryService.class);
htmlFormEntryService.addHandler(PihCoreConstants.HTMLFORMENTRY_CAUSE_OF_DEATH_LIST_TAG_NAME, new CauseOfDeathListTagHandler());
htmlFormEntryService.addHandler(PihCoreConstants.HTMLFORMENTRY_PAST_MEDICAL_HISTORY_CHECKBOX_TAG_NAME, new PastMedicalHistoryCheckboxTagHandler());
htmlFormEntryService.addHandler(PihCoreConstants.HTMLFORMENTRY_FAMILY_HISTORY_RELATIVE_CHECKBOXES_TAG_NAME, new FamilyHistoryRelativeCheckboxesTagHandler());
}
use of org.openmrs.module.htmlformentry.HtmlFormEntryService 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.htmlformentry.HtmlFormEntryService in project openmrs-module-coreapps by openmrs.
the class CoreAppsActivator method stopped.
/**
* @see ModuleActivator#stopped()
*/
public void stopped() {
try {
HtmlFormEntryService htmlFormEntryService = Context.getService(HtmlFormEntryService.class);
htmlFormEntryService.getHandlers().remove(CoreAppsConstants.HTMLFORMENTRY_ENCOUNTER_DIAGNOSES_TAG_NAME);
htmlFormEntryService.getHandlers().remove(CoreAppsConstants.HTMLFORMENTRY_ENCOUNTER_DISPOSITION_TAG_NAME);
} catch (Exception ex) {
// pass
}
log.info("Core Apps Module stopped");
}
use of org.openmrs.module.htmlformentry.HtmlFormEntryService in project openmrs-module-mirebalais by PIH.
the class HtmlFormSetup method setupHtmlForms.
// set up html forms--this must happen *after* MDS packages are installed, so that forms defined in code/github
// take precedent over any in MDS packages; therefore we still do this in the Mirebalais module, not PIH Core
public static void setupHtmlForms(Config config) throws Exception {
try {
ResourceFactory resourceFactory = ResourceFactory.getInstance();
FormService formService = Context.getFormService();
HtmlFormEntryService htmlFormEntryService = Context.getService(HtmlFormEntryService.class);
// forms installed across all implementations
List<String> htmlforms = new ArrayList(Arrays.asList("pihcore:htmlforms/admissionNote.xml", "pihcore:htmlforms/patientRegistration.xml", "pihcore:htmlforms/patientRegistration-rs.xml", "pihcore:htmlforms/surgicalPostOpNote.xml", "pihcore:htmlforms/vitals.xml", "pihcore:htmlforms/transferNote.xml", "pihcore:htmlforms/dischargeNote.xml", "pihcore:htmlforms/outpatientConsult.xml", "pihcore:htmlforms/edNote.xml", "pihcore:htmlforms/deathCertificate.xml", "pihcore:htmlforms/oncologyConsult.xml", "pihcore:htmlforms/mentalHealth.xml", "pihcore:htmlforms/section-chief-complaint.xml", "pihcore:htmlforms/section-history.xml", "pihcore:htmlforms/section-exam.xml", "pihcore:htmlforms/section-dx.xml", "pihcore:htmlforms/section-peds-feeding.xml", "pihcore:htmlforms/section-peds-supplements.xml", "pihcore:htmlforms/section-plan.xml", "pihcore:htmlforms/section-ncd.xml", "pihcore:htmlforms/section-lab-order.xml", "pihcore:htmlforms/section-family-planning.xml", "pihcore:htmlforms/socio-econ.xml", "pihcore:htmlforms/primary-care-adult-initial.xml", "pihcore:htmlforms/primary-care-adult-followup.xml", "pihcore:htmlforms/primary-care-peds-initial.xml", "pihcore:htmlforms/primary-care-peds-followup.xml", "pihcore:htmlforms/ncd-adult-initial.xml", "pihcore:htmlforms/ncd-adult-followup.xml"));
// add any country-specific forms
if (config.getCountry().equals(ConfigDescriptor.Country.HAITI)) {
htmlforms.addAll(Arrays.asList("pihcore:htmlforms/haiti/hiv/zl/hiv-intake.xml", "pihcore:htmlforms/haiti/patientRegistration-contact.xml", "pihcore:htmlforms/haiti/patientRegistration-social.xml", "pihcore:htmlforms/haiti/patientRegistration-insurance.xml", "pihcore:htmlforms/haiti/checkin.xml", "pihcore:htmlforms/haiti/liveCheckin.xml", "pihcore:htmlforms/haiti/hiv/zl/hiv-followup.xml", "pihcore:htmlforms/haiti/hiv/zl/vct.xml", "pihcore:htmlforms/haiti/hiv/zl/section-hiv-serology.xml", "pihcore:htmlforms/haiti/hiv/zl/section-symptoms.xml", "pihcore:htmlforms/haiti/hiv/zl/section-who-stages.xml", "pihcore:htmlforms/haiti/hiv/zl/section-hiv-oi.xml", "pihcore:htmlforms/haiti/hiv/zl/section-hiv-state.xml", "pihcore:htmlforms/haiti/hiv/iSantePlus/Adherence.xml", "pihcore:htmlforms/haiti/hiv/iSantePlus/SaisiePremiereVisiteAdult.xml", "pihcore:htmlforms/haiti/hiv/iSantePlus/SaisiePremiereVisitePediatrique.xml", "pihcore:htmlforms/haiti/hiv/iSantePlus/VisiteDeSuivi.xml", "pihcore:htmlforms/haiti/hiv/iSantePlus/VisiteDeSuiviPediatrique.xml"));
} else if (config.getCountry().equals(ConfigDescriptor.Country.LIBERIA)) {
htmlforms.addAll(Arrays.asList("pihcore:htmlforms/liberia/checkin.xml", "pihcore:htmlforms/liberia/liveCheckin.xml", "pihcore:htmlforms/liberia/patientRegistration-contact.xml", "pihcore:htmlforms/liberia/patientRegistration-social.xml"));
} else if (config.getCountry().equals(ConfigDescriptor.Country.SIERRA_LEONE)) {
htmlforms.addAll(Arrays.asList("pihcore:htmlforms/patientRegistration.xml", "pihcore:htmlforms/patientRegistration-rs.xml", "pihcore:htmlforms/sierra_leone/checkin.xml", "pihcore:htmlforms/sierra_leone/liveCheckin.xml", "pihcore:htmlforms/sierra_leone/patientRegistration-contact.xml", "pihcore:htmlforms/sierra_leone/patientRegistration-social.xml"));
}
if (htmlforms != null) {
for (String htmlform : htmlforms) {
HtmlFormUtil.getHtmlFormFromUiResource(resourceFactory, formService, htmlFormEntryService, htmlform);
}
}
} catch (Exception e) {
// this is a hack to get component test to pass until we find the proper way to mock this
if (ResourceFactory.getInstance().getResourceProviders() == null) {
log.error("Unable to load HTML forms--this error is expected when running component tests");
} else {
throw e;
}
}
}
Aggregations