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.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170)
	at org.springframework.context.support.AbstractApplicationContext.getInternalParentBeanFactory(AbstractApplicationContext.java:1107)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:200)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:126)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
	at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
	at org.openmrs.web.DispatcherServlet.init(DispatcherServlet.java:84)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown 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: https://modules.openmrs.org/#/show/215/allergy-ui-module

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 https://demo.openmrs.org/openmrs/allergyui/allergies.page?patientId=41d874f3-1d34-4e69-863c-cdac025d00ba 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

https://pastebin.com/hZ1h0GHE

Thanks

//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 https://pastebin.com/fkP8xQfu

Thanks

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

https://pastebin.com/NinRRrwr

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)