Integrating openmrs-module-openconceptlab with Bahmni

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 [OWA-63] - OpenMRS Issues.

@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 Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog

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.

@raff and @darius As I am not able to bring up the UI of openconceptlab, trying to understand the behavior of module by posting using Postman. Created a separate thread for it.

Can you please check and respond. TIA

@pramidat I just tried this in my bahmni vagrant (just downloaded a vanilla 0.90 box yesterday, and I do not have local dev folders linked yet).

I just dropped the owa module (1.8.1) and the openconceptlab module (1.2.1) in my /opt/openmrs/modules folder, restarted the openmrs service, and the OWA loads (without my having to set appBaseUrl). I still get the same error (error in the JS console) that I mentioned earlier in the thread, but not a 404.

This probably doesn’t help you, and I’m not in a position to debug anything right now, but it’s possible that things will work without needing the hack mentioned by Sanish. I’m also hoping that @binduak can share whether she had to do any special configuration.

Hi @pramidat,

The below are the steps that I have followed to configure openconceptlab OWA in OpenMRS

  1. Added latest owa-1.8.1.omod in /opt/openmrs/modules folder

  2. Added openconceptlab-1.2.0.omod in /opt/openmrs/modules folder

  3. Cloned openmrs-module-openconceptlab repo and ran the below commands from inside owa folder.

      npm install 
      npm run build:prod
    

openconceptlab.zip will be created. I couldn’t upload the openconceptlab.zip file from openmrs -> Admin -> Manage Apps. I also got Permission Denied exception as mentioned in the thread.

  1. Copied the openconceptlab.zip file to /opt/openmrs/owa folder and extracted the zip file. (I haven’t changed anything from openmrs -> settings under Open Web Apps Module )

Configure openconceptlab OWA in Bahmni: One can also configure openconceptlab OWA in Bahmni homepage. Add the below piece of code in /var/www/bahmni_config/openmrs/app/home/extension.json

"owaocl": {
    "id": "openmrs.owa.ocl",
    "extensionPointId": "org.bahmni.home.dashboard",
    "type": "link",
    "translationKey": "OCL",
    "url": "https://192.168.33.11/openmrs/owa/openconceptlab/index.html#!/",
    "icon": "fa-user",
    "order": 14,
    "requiredPrivilege": "app:registration"
  }

Please let me know if you need any help.

1 Like

The steps that @binduak. This approach worked. I could see some UI with “Subscription” button. Don’t see input elements for URL and Token. Nothing happens on hitting the Subscription button. Looks like some UI issues from OWA of openconceptlab.

Just wanted to let you know that I released open concept lab module 1.2.2 on Friday, which should have a working UI.