Hi everyone,
I customized my bahmni 0.80 installation with patient attributes and some other stuff.
My problem is on the workflow that stopped working between Bahmni-OpenELIS.
On any patient I can make an Order and I can see it in OpenELIS, I can “collect the sample”, I can input the results and validate it.
Before, the results would show up in Bahmni correctly.
Now after customizing bahmni, the Orders results are showing empty.
What could be the problem here? Can someone tell me how Bahmni gets this results for displaying, is it by Atom Feed or direct connection to PostgreSQL?
Can anyone replicate? Try to make an Order for any patient, go to OpenELIS, collect, give results & validate it, and then see if those results show in the patient dashboard.
Hi,
I recreated everything. You can see the results in Lab Results Display control in Patient Dashboard. You can also see them inside the Visits tab under Lab Investigation and Investigation Chart sections . Below is the screenshot showing the lab results in the patient dashboard.
I’ve tried again to debug the issue and it seems that it happened even before applying the scripts to remove demo data.
New things I found:
A) I seem to have the problem in my fresh installations of CentOS (with selinux and iptables disabled, following the guide “Install on CentOS”, and without using the script to remove demo data.
B) It seems to work on the vagrant box provided, but using the script to remove demo data made it stop working.
As asked about my tables.
— in openmrs sql db ----
“failed_events” have 11 rows with data (from 2015-07-03), “failed_event_retry_log” has 55 rows with data (from 2015-06-26) - installation A) (My CentOS).
I’ll check on my installation B) (Vagrant Box). Update: Exactly the same as A)
— in openelis sql db ----
“failed_events” have 38 rows with data (all from 2016-05-03), “failed_event_retry_log” has 3896 rows with data (from 2015 and latest are from 2016-05-03) - installation A) (My CentOS).
I’ll check on my installation B) (Vagrant Box). Update: Exactly the same as A)
Just took entire evening to reproduce this again:
On the vagrant box, with it working, after running the script to remove the demo data it stops working, as I reported before - reproduced 3 times.
binduak, maybe the script didn’t ran correctly, check the output for errors… I managed to confirm it to stop working exactly after the scripts were run and the demo data was removed. Some table must have crucial data for the Bahmni->Openelis connection to work.
Update: Can anyone tell me what the “markers” table in both databases do?
I believe this is the one responsible for the problems.
Update2: Narrowed it down to the problem: it’s on the query that changes the table “event_records” on both databases. If I use the provided .sql files only, and don’t touch “event_records”, it works! Any ideas why?
Below are the links to see the latest feeds published by MRS, ELIS and ERP
MRS:
Encounters - view-source:http://dockerhost:8080/openmrs/ws/atomfeed/encounter/recent (Consumed by Elis,ERP)
- ERP creates a Sale Order
Patient- view-source:http://dockerhost:8080/openmrs/ws/atomfeed/patient/recent (Consumed by Elis, ERP)
- ERP creates a customer.
Lab Feed - view-source:http://dockerhost:8080/openmrs/ws/atomfeed/lab/recent (Consumed by Elis)
Drug Feed - view-source:http://dockerhost:8080/openmrs/ws/atomfeed/drug/recent (Consumed by ERP)
Reference Data Feed - http://dockerhost:8080/reference-data/ws/feed/recent - Not available
Elis:
Patient Feed - view-source:http://dockerhost:8080/openelis/ws/feed/patient/recent (Consumed by MRS,ERP)
- ERP Creates a sale order.
Result Feed - view-source:http://dockerhost:8080/openelis/ws/feed/result/recent (Consumed by MRS)
ERP:
Product - http://dockerhost:8080/openerp-atomfeed-service/feed/product/recent (Consumed by Elis)
Sale Order - http://dockerhost:8080/openerp-atomfeed-service/feed/sale_order/recent (Consumed by MRS)
binduak, thanks for explaining.
So, to resume, I got it working on the vagrant box by not running the sql that deletes “event_records” and the one that changes “markers” for both databases.
Can anyone tell me why it works only if these two tables are not modified, keeping the demo data?
“Atom feed” architecture has both client and server…
Server keeps publishing the events and clients will read required events… Atom feed is an xml based sync… which means each page termed as feed will have set of events…
event_records is a table in the server side with the entries of all the events generated. In this approach it is the client’s responsibility to keep track of the last read event which is usually recorded in markers table at client side.
Now lets take an example:
EMR to ELIS Patient sync (EMR is Server and ELIS as Client)
In the EMR, a patient is created which will generate an entry in event_records table. Now Elis should read the event_record’s table of EMR and match the event_id with the id in markers table to find out the latest events generated after it has last read.
The workaround I did is not perfect - It worked on the Vagrant Box, but it didn’t work on my CentOS machine that I installed following the “Installed using CentOS” guide.
Even copied the databases from the now working vagrant box to my server, but it doesn’t work there.
I can’t comprehend why.
Is there any place where I can see the problems with the Atom feed? (btw, the table “failed_events” / “failed_event_retry_log” are empty on openmrs and clinlims).
The problem is from ELIS to EMR (can’t view the results of a test on the EMR patient dashboard).
I did your Elis to EMR, and noticed that after starting bahmni-lab, after some minutes the markers were updated, but the EMR still can’t access the Elis results.
Then, I did your EMR to ELIS, and after starting openmrs, the markers were never inserted again on the table of openmrs database.
There are NO failed events on openmrs database (it also don’t have markers).
I can always send the orders to OpenElis and I can see them there and collect sample and put results & validate, but they never travel back for the dashboard.
I found out the problem in “openmrs.log”, it shows up when I start openmrs:
I installed Bahmni 0.80 following “Install Bahmni on CentOS”, and everything works but this! I believe the module responsible has some problem in the initialization and can never update or get things from the feed - that’s why in openmrs database the “markers” table never updates itself again, or why I don’t even see a single “failed_event” on it either.
What can happen for the module org.bahmni.module.elisatomfeedclient to be failing these tasks?
Bahmni installer for CentOS has an issue - in my CentOS I noticed I was missing the openelis-atomfeed-client-0.80-SNAPSHOT.omod, so I went to check how is it on the Vagrant Box and I learned the .omod is present in /opt/openmrs/modules but as a sym link, because in reality it resides in /opt/bahmni-lab-connect/modules/openelis-atomfeed-client-0.80-SNAPSHOT.omod.
Someone forgot to program the installer to make this sym link… So the feature was broken all the time…
We have to re-install bahmni-lab-connect whenever you re-install openmrs. Because bahmni-lab-connect is the one creating the sym link to openelis-atomfeed-client-0.80-SNAPSHOT.omod after /opt/openmrs/modules created.
openmrs creates /opt/openmrs/modules folder.
bahmni-emr is the one copying all the relevant omods required by Bahmni into /opt/openmrs/modules.
bahmni-lab-connect creates the link to openelis-atomfeed-client-<bahmni.version>-SNAPSHOT.omod.
Below are the commands to re-install bahmni-lab-connect
i have an issue i can order lab and i can receive lab order in openls however after collecting sample and validating lab result, i cant see anything bahmni Dashboard. i check clinlinms database i found some error
I am having same issue here: test results are not being displayed in patient dashboard.
Bahmni version: 0.89
Tried reinstalling lab connector module and “delete from markers” in OpenELIS DB. It didn’t work.
I get the following exception in openmrs log:
31-07-2017 17:39:16 [ERROR] OpenElisPatientFailedEventsFeedClientImpl - openelisatomfeedclient:failed feed execution while running failed eventsjava.lang.NullPointerException
java.lang.NullPointerException
31-07-2017 17:39:16 [ERROR] TimerSchedulerTask - FATAL ERROR: Task [class org.openmrs.scheduler.tasks.TaskThreadedInitializationWrapper] failed due to exception [java.lang.RuntimeException]
java.lang.RuntimeException: java.lang.NullPointerException
at org.bahmni.module.elisatomfeedclient.api.client.impl.OpenElisPatientFailedEventsFeedClientImpl.processFailedEvents(OpenElisPatientFailedEventsFeedClientImpl.java:75)
at sun.reflect.GeneratedMethodAccessor1098.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
at com.sun.proxy.$Proxy280.processFailedEvents(Unknown Source)
at org.bahmni.module.elisatomfeedclient.api.task.OpenElisPatientFeedFailedEventsTask.execute(OpenElisPatientFeedFailedEventsTask.java:13)
at org.openmrs.scheduler.tasks.TaskThreadedInitializationWrapper.execute(TaskThreadedInitializationWrapper.java:67)
at org.openmrs.scheduler.timer.TimerSchedulerTask.execute(TimerSchedulerTask.java:94)
at org.openmrs.api.context.Daemon$2.run(Daemon.java:135)
Caused by: java.lang.NullPointerException
I have confirmed that samples were collected, entered all results and validated all of them in OpenELIS. Still I can’t see the results in the patient summary. Thanks in advance