Can Bahmni add new module?

Hi I’m a doctor who’s working with my IT friends to implement Bahmni in my hospital. I’m impressed with flexibility of this software but one thing is it lack of Drug Allergy module.

because OpenMRS has allergyui module which is very good. so we are trying to install this module by placing allergyui-1.0.omod and allergyapi-1.0.1.omod in /opt/openmrs/modules

and it didn’t work. so we want to find out why and how from openmrs log and we couldn’t find out.

Anyone please give me a guide for installing new module in Bahmni.

Thanks Pi

**I installed Bahmni ver 0.89(openMRS Version: 2.1.0 Build 7eadd7) on CentOS 6.9(full) in the cloud.

Hi @zacrify,

Allergy UI was not designed to be a UI layer for Bahmni (but rather for the OpenMRS Reference Application). Depending on the technology used (I haven’t looked yet) it may or may not be straightforward to integrate it within Bahmni Apps - that is the UI layer of Bahmni.

If your goal is indeed to integrate Allergy UI in Bahmni, then you will have to start troubleshooting step by step what’s required to be done. For a start, what did the logs say?

@mksd Hi Thanks for quick response this is a log

May 31, 2017 2:16:15 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet openmrs
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(
	at org.springframework.web.servlet.HttpServletBean.init(
	at javax.servlet.GenericServlet.init(
	at org.openmrs.web.DispatcherServlet.init(
	at org.apache.catalina.core.StandardWrapper.initServlet(
	at org.apache.catalina.core.StandardWrapper.loadServlet(
	at org.apache.catalina.core.StandardWrapper.allocate(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.AbstractHttp11Processor.process(
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$ Source)
	at org.apache.tomcat.util.threads.TaskThread$
	at Source)

@zacrify, as of OpenMRS Platform version 2.0 you no longer need the allergyapi module (because that functionality was moved into openmrs-core).

Also the latest release of the allergyui module is 1.7.0, which you can get here:

Try removing allergyapi, and using the latest allergyui, and see if things start up properly. If so, you’ll want to look at an equivalent URL to and see if you see the correct screen or not.

Hi @darius I tried to use allergyui 1.7.0 as you said but the problem is the same my Bahmni was not start.

I tried to direct link to allergies page and found this error


//edit waiting for 5 min I can connect to Bahmni again but no allergy ui in patient dashboard

@darius I went to manage module in admin and found this error on allergyui module

Module Allergy UI Module cannot be started because it requires the following module(s): uicommons 2.1, uiframework 3.9 Please install and start these modules first.

Bahmni has both as part of its distro, but older versions. You can find newer versions on Modulus and try out if that unlocks the issue:

Thanks @mksd after installed new uicommons, uiframework OpenMRS was crashed (but openmrs service in console is still running)

I checked in module manager many modules were error due to this changed.

this is log


At first (and quick) sight the log seems unrelated to the original problem.

By upgrading those two modules you might stumble upon further similar issues with other modules down the line. You will have to troubleshoot this step by step:

  • Is it ok to upgrade UI Framework only?
  • Is it ok to upgrade UI Commons only?
  • How did you actually upgrade them? You would have to remove the older version from the modules/ folder, copy the new one, and restart OpenMRS, is that what you did?

Hi @mksd Sorry for late reply. I’m busy with other job for the last week.

I did try to remove UI Commons and UI framework and install new version but it make other modules crashed.

I did tried to install allergyui1.0 and allergyapi1.0.1 as I thought this 2 modules were installed in openmrs 2.1.0, the same version as bahmni 0.89(openmrs ver 2.1.0)

but it made bahmni crashed with this error

by the way i’m not understand why upgrading only UI framework or UI common would work.(Sorry I have no background IT )

(actually I saw you are working on a project in Cambodia. Is it possible to contact you in personal? I tried to implement Bahmni in Thailand)