Integrating openmrs-module-openconceptlab with Bahmni

We are trying to integrate Bahmni with OCL for which we are planning to use Openmrs-module-openconceptlab. I have loaded the openconceptlab omod successfully. I see that opencocnpetlab module has it’s own OWA. So, loaded openmrs-module-owa module and tried to upload But, I see some errors. @raff Is the approach that I am following correct? Please let me know if I am missing something.

You could also just copy into /opt/openmrs/owa.

Looks like you followed the required steps, what errors did you get?

I am getting HTTP Status 500 - (Permission denied) error. I placed in /opt/openmrs/owa/ and restarted openmrs service. But, still the package was not uploaded.

When I ran the command ‘npm run build:prod’ in openmrs-module-openconceptlab/owa/, I am getting the below error but is being generated in same folder (not in dist folder as mentioned in I am uploading the same zip package from openmrs.

ERROR in Path must be a string. Received undefined Child html-webpack-plugin for “index.html”: + 1 hidden modules

Assuming you’re on Vagrant or Docker, have you tried this?

chown -R bahmni:bahmni /opt/openmrs/owa

Yes. I did it, but still see the same issue.

You manually copied the .zip into /opt/openmrs/owa, ran chown, restarted OpenMRS and then what exactly is that you observe?

When I go to Manage Apps, I still see ‘You have no apps installed’. And when I go to status page of openconceptlab, I am getting the below error: HTTP Status 404 - /openmrs/owa/openconceptlab/index.html

type Status report

message /openmrs/owa/openconceptlab/index.html

description The requested resource is not available.

I get the same error message for both the dev and prod builds:

ERROR in Path must be a string. Received undefined

Before anything else I’d try to get a clean build of the OWA. Even though the .zip is generated it might be unfit for properly serving the OWA.

Googling around shows that this can be because of a Node version, see here. The trick might be to build with Node < 6.0.0. I just did this and could build without errors (using n that you can install with npm install -g n):

sudo n 5.12.0
rm package-lock.json
npm install
npm run build:prod

Thank you. Followed the same steps (On mac had to use brew install n) and npm run build:prod is now successful. I have loaded the to /opt/openmrs/owa/, did chown and restarted openmrs. But, I still see ‘You have no apps installed’ message, when tried to upload manually also I see ‘Permission denied’ error.

The point was to rule out that the problem was coming from the zipped OWA itself. Btw just to be entirely sure, you might want to try with another zipped OWA, such as a sample one created with the Yeoman generator (the Angular one for instance.)

Could you get a complete stack trace of this permission denied error?

Full Stack Trace:

HTTP Status 500 - (Permission denied)

type Exception report

message (Permission denied)

description The server encountered an internal error that prevented it from fulfilling this request.

exception (Permission denied) Method) Source) Source) Source) org.apache.commons.fileupload.disk.DiskFileItem.write( org.springframework.web.multipart.commons.CommonsMultipartFile.transferTo( org.openmrs.module.owa.web.controller.AddAppController.upload( sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod( org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle( org.springframework.web.servlet.DispatcherServlet.doDispatch( org.springframework.web.servlet.DispatcherServlet.doService( org.springframework.web.servlet.FrameworkServlet.processRequest( org.springframework.web.servlet.FrameworkServlet.doPost( javax.servlet.http.HttpServlet.service( org.springframework.web.servlet.FrameworkServlet.service( javax.servlet.http.HttpServlet.service( org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter( org.openmrs.web.filter.GZIPFilter.doFilterInternal( org.springframework.web.filter.OncePerRequestFilter.doFilter( org.openmrs.module.web.filter.ModuleFilterChain.doFilter( org.openmrs.module.owa.filter.OwaFilter.doFilter( org.openmrs.module.web.filter.ModuleFilterChain.doFilter( org.openmrs.module.web.filter.ModuleFilter.doFilter( org.openmrs.web.filter.OpenmrsFilter.doFilterInternal( org.springframework.web.filter.OncePerRequestFilter.doFilter( org.springframework.web.filter.OncePerRequestFilter.doFilter( org.openmrs.web.filter.StartupFilter.doFilter( org.openmrs.web.filter.StartupFilter.doFilter( org.openmrs.web.filter.StartupFilter.doFilter( org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal( org.springframework.web.filter.OncePerRequestFilter.doFilter(

@mjsanish I remember that you mentioned something similar, did you ever solve this?

@mksd @pramidat I have also faced same “Permission denied” issue. I am not able to resolve “Permission denied” issue but I am able to integrate my bedmanagement OWA for the development environment. It may be not appropriate for your condition.

Here steps that work for me.

  1. Changes OpenMRS > admin > Open Web Apps Module > setting

  1. Since I am using Vagrant for development, I link the host source content of my OWA app to the vagrant /var/www/html/owa

  2. And bedmanagement OWA appear at OpenMRS > admin > Open Web Apps Module > Manage Apps

  3. On click Bed Management OWA it showup my bedmanagement OWA.

1 Like

Thank you @mjsanish I tried the above steps to deploy openconceptlab owa in my local. Just changed the App Base URL in settings to as the URL when we click on Openmrs->Administration->Open Concept Lab->Status Page is

With this, I can see the OWA loaded successfully, but when I tried to open openconceptlab, I still see the same error.

@pramidat It will work if you set Base URL to instead of

If you really want Base URL to then you have to mount and bind /var/www/html/owa folder to /opt/openmrs/openmrs/owa as below.

$ sudo mkdir /opt/openmrs/openmrs/owa/
$ sudo chown -R bahmni:bahmni /opt/openmrs/openmrs/owa/
$ sudo mount --bind /var/www/html/owa /opt/openmrs/openmrs/owa/

Then check

1 Like

When I added the base URL as , then when I click on openconceptlab, is opening up but the page is blank.

If I added the base URl as and after the mounting and binding, when I click on openconceptlab, is opening but getting the same error :frowning:

@raff can you please let me know what is the base URL for openconceptlab module

@pramidat, I’m sorry, but I released a version of openconceptlab with a broken UI. I will fix it ASAP.

Update: Taking a step back. I heard about an issue with the UI earlier this week and assumed you had the same, but it is most likely not the case. I just tested and it works for me…

http://localhost:8080/openmrs/owa/openconceptlab/index.html#/ is the entry url.

The base url is empty in my OWA config.

Also the owa should be automatically deployed with a module. No need to do it manually. Please make sure you have the latest version of the Open Web Apps module (1.8.0) as well if it is not working that way.

Lastly, aside from the page being blank, do you see any errors in browser console?

I tested using http://localhost:8080/openmrs/owa as base URL in OWA config and it worked as well.

Could you also look for any errors in server logs?

Also assuming you are using openconceptlab 1.2.1

Update: I was able to reproduce your issue :slight_smile: If I enter http://localhost:8080/openmrs/owa/ as base URL I see blank page for openconceptlab/index.html, whereas when I skip the last slash ( http://localhost:8080/openmrs/owa) it works!

I installed the owa 1.8.0 and openconceptlab 1.2.1 modules on top of Bahmni and I see this error in the activator:

11-12-2017 06:34:15 [WARN ] ModuleUtil - Unable to invoke method on the module’s activator java.lang.IllegalArgumentException: Parameter ‘directory’ is not a directory at at org.openmrs.module.owa.activator.OwaActivator.contextRefreshed( at org.openmrs.module.ModuleUtil.refreshApplicationContext( at org.openmrs.module.web.WebModuleUtil.refreshWAC( at org.openmrs.web.Listener.performWebStartOfModules( at org.openmrs.web.Listener.performWebStartOfModules( at org.openmrs.web.Listener.startOpenmrs( at org.openmrs.web.WebDaemon$

(I’m stepping into a meeting now so I haven’t been able to debug at all.)

And at https://localhost/openmrs/module/owa/manage.form I see

You have no apps installed