Integrating openmrs-module-openconceptlab with Bahmni

Tags: #<Tag:0x00007f6001062440> #<Tag:0x00007f6001062378> #<Tag:0x00007f60010622b0>

When I added the base URL as https://192.168.33.10/owa/ , then when I click on openconceptlab, https://192.168.33.10/owa/openconceptlab/index.html is opening up but the page is blank.

If I added the base URl as https://192.168.33.10/openmrs/owa/ and after the mounting and binding, when I click on openconceptlab, https://192.168.33.10/openmrs/owa/openconceptlab/index.html 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 https://addons.openmrs.org/#/show/org.openmrs.module.open-concept-lab

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 org.apache.commons.io.FileUtils.listFiles(FileUtils.java:293) at org.openmrs.module.owa.activator.OwaActivator.contextRefreshed(OwaActivator.java:85) at org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:929) at org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:866) at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:656) at org.openmrs.web.Listener.performWebStartOfModules(Listener.java:635) at org.openmrs.web.Listener.startOpenmrs(Listener.java:266) at org.openmrs.web.WebDaemon$1.run(WebDaemon.java:42)

(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

So, the problem is that in our Bahmni build of OpenMRS there is no WEB-INF/bundledOwas folder, and this leads to an uncaught exception. I don’t know if that’s actually specific to our Bahmni build, or in general, but it seems like the wrong behavior.

I created https://issues.openmrs.org/browse/OWA-63.

@raff after working around the above bug, the OWA successfully loads. If I go to https://localhost/openmrs/owa/openconceptlab/index.html it redirects to https://localhost/openmrs/owa/openconceptlab/index.html#!/ and I see only one green rounded rectangle (perhaps the header) with no text, and the js console shows:

Uncaught Error: [$injector:unpr] Unknown provider: $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate <- $compile <- $$animateQueue
http://errors.angularjs.org/1.6.6/$injector/unpr?p0=%24%24HashMapProvider%20%3C-%20%24%24HashMap%20%3C-%20%24%24animateQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue
    at vendor.bundle.js:2
    at vendor.bundle.js:2
    at Object.n [as get] (vendor.bundle.js:2)
    at vendor.bundle.js:2
    at n (vendor.bundle.js:2)
    at r (vendor.bundle.js:2)
    at Object.o [as invoke] (vendor.bundle.js:2)
    at vendor.bundle.js:2
    at n (vendor.bundle.js:2)
    at r (vendor.bundle.js:2)

@darius, I’ve just merged and released your fix in the OWA module, thanks!

Not sure about the js error. It doesn’t show for me, but let me try clearing cache / using different browser.

Update: I was able to reproduce it… looking for a fix.

FYI I don’t see the new version of owa-1.8.1 on bintray yet.

It may take up to 3 hours to show up unless https://ci.openmrs.org/browse/AR-DM/latest is triggered manually, which I just did…

@darius, are you able to easily test https://openmrs.jfrog.io/openmrs/snapshots/org/openmrs/module/openconceptlab-omod/1.2.2-SNAPSHOT/openconceptlab-omod-1.2.2-20171211.123958-2.jar (after renaming to omod)?

I installed it. After restarting OpenMRS, at https://localhost/openmrs/module/owa/manage.form I still see version 1.2.0 of the OWA (and I get the same error).

I still don’t see 1.8.1 version at https://addons.openmrs.org/#/show/org.openmrs.module.open-web-apps-module

@pramidat the addons server has an additional delay since it only indexes things every 4 hours. So you can get 1.8.1 directly from https://bintray.com/openmrs/omod/owa

Have the files been updated in the openmrs_application_data_dir/owa/openconceptlab? Did you try Ctrl+F5? (I forgot to change the version so ignore that)

I did try shift-reload. I also just now deleted the folder and restarted OpenMRS (so it got recreated), and I still get the same error:

Uncaught Error: [$injector:unpr] Unknown provider: $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate <- $compile <- $$animateQueue
http://errors.angularjs.org/1.6.7/$injector/unpr?p0=%24%24HashMapProvider%20%3C-%20%24%24HashMap%20%3C-%20%24%24animateQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue
    at vendor.bundle.js:2
    at vendor.bundle.js:2
    at Object.n [as get] (vendor.bundle.js:2)
    at vendor.bundle.js:2
    at n (vendor.bundle.js:2)
    at r (vendor.bundle.js:2)
    at Object.o [as invoke] (vendor.bundle.js:2)
    at vendor.bundle.js:2
    at n (vendor.bundle.js:2)
    at r (vendor.bundle.js:2)

I tried with version 1.8.1. With that I no longer see the java.lang.IllegalArgumentException: Parameter ‘directory’ is not a directory at error, but, still seeing the below error when I opened the status page, (https://192.168.33.10/openmrs/owa/openconceptlab/index.html#/)

HTTP Status 404 - /openmrs/owa/openconceptlab/index.html

type Status report

message /openmrs/owa/openconceptlab/index.html

description The requested resource is not available.

Apache Tomcat/8.0.12

@pramidat, have you tried starting from https://localhost/openmrs/module/owa/manage.form and clicking the link? (It wouldn’t be localhost for you.)

For me the url it goes to is https://localhost/openmrs/owa/openconceptlab/index.html#!/ (i.e. there’s a ! between the # and the /.).

I have not set an app base url, i.e. my settings are:

(I’m using docker rather than vagrant now, which is why my urls are localhost, but I assume otherwise things should work the same…)

@raff, just to make sure I tried this out in a new browser, and then I deployed an SDK server (to remove the Bahmni variable) and I get exactly the same behavior.

By the way it also says that it tries to load angular more than once. (I wonder if there’s a copy of angular in the openmrs-contrib-uicommons bundle?)

@darius openconcept lab owa is not loading by default. If I set the “appBaseUrl” as empty and “appFolderPath” as “/opt/openmrs/owa”, I see “You have no apps installed” message in https://192.168.33.10/openmrs/module/owa/manage.form.

For it to work, I have followed the way suggested by @sanish i.e. changed my App Folder Path to “/var/www/html/owa/”. In my vagrant folder /var/www/html/owa/, linked openconceptlab to the openceptlab module in my local: lrwxrwxrwx. 1 root root 46 Dec 5 16:37 openconceptlab -> /bahmni/openmrs-module-openconceptlab/owa/app/ Also, checked out version 1.2.1 (tag) of openmrs-module-openconceptlab. With this, I am able to see openceptlab app in https://192.168.33.10/openmrs/module/owa/manage.form.

But, when I opened the app, it goes to https://192.168.33.10/openmrs/owa/openconceptlab/index.html which is an empty page.

I tried the url https://192.168.33.10/openmrs/owa/openconceptlab/index.html#!/ manually. But, that is also empty.