I get errors in bahmni when ordering lab tests for patient! They are not appearing in openelis Errors in bahmni-lab log https://pastebin.com/h7yWh8vi
Moving this to the Bahmni category
[Note: Warning from Bahmni team] Do not delete data from markers table/etc before truly understanding the problem. This is very risky, especially in production systems!! (Read full thread below before performing any deletes!)
Hi @yusto Please cheack configuration necessary for atomfeed communications are in atomfeed.properties file e.g. /opt/bahmni-lab/bahmni-lab/WEB-INF/classes/ atomfeed.properties
Also, try with the following steps.
Stop tomcat, openmrs, and bahmni-lab service.
Login to openmrs database and run the following statements.
mysql -uroot -p openmrs
delete from failed_events;
delete from event_records;
delete from markers;
delete from event_records_offset_marker;
delete from event_records_queue;
Similarly login to openelis DB and run the same above statements for delete records.
psql -Uclinlims clinlims
Start tomcat, openmrs and bahmni-lab service.
Hello @sushantpatil1214… I did this before but it wasnt helpful
Hi,
I would recommend to troubleshoot the following,
- /opt/bahmni-lab/bahmni-lab/WEB-INF/classes/atomfeed.properties
Verify that the openmrs.user and openmrs.password are same in database as well. You can try to login from openmrs admin panel to verify.
- /opt/openmrs/bahmnicore.properties
Verify that the openelis.user and openelis.password are same in database as well. You can try to login from ELIS to verify.
- Check the markers are updating or not from database (select * from markers) in both openmrs and openelis. Removing the record from markers will set the marker to start from the beginning which is not recommended to perform in production where there is large volume of data. This will take long time to reach the marker to last record and you will see the latest record are not available in EMR/ELIS because markers are running in the background. If the markers are way behind you can advance them (by updating in the table) to a recent state (which point you are sure that the records were already synced) to faster the process.
all the configuration Are Ok… Now its only sync Sample Data and fails to sync test data! in department
Hi,
- Please do not randomly delete entries in “failed_events” or “event_records” or “markers” and other tables. They are there for a reason, and try to figure out what is the error first. If you delete the entries, especially on production systems, you will do more harm.
- check the “failed_events” and optionally “failed_event_retry_log” table. Try to identify the entries and the errors that are relevant. in failed_events, for a row, you can set the “retries” to 0, (if the value is 5). this will cause the event to be retried. maybe this will get resolved automatically (some dependency missing or some network calls failed last time etc). if not, check the log
tail -F /var/log/bahmni-lab/bahmni-lab.log
am getting this! { “categories”: [ { “scheme”: null, “label”: null, “schemeResolved”: null, “term”: “lab” } ], “id”: “tag:atomfeed.ict4h.org:d3b33261-a87b-476c-a02e-43ec20b9b53e”, “content”: “/openmrs/ws/rest/v1/reference-data/sample/3ebc90b6-a7ab-427f-8b8b-ae3a3b3381d8”, “feedUri”: null, “updatedDate”: null, “title”: “sample”, “dateCreated”: null }
Failed processing event in feed [http://localhost:8050/openmrs/ws/atomfeed/lab/1] us.mn.state.health.lims.common.exception.LIMSRuntimeException: Error while saving panel - kimeojava.lang.RuntimeException: us.mn.state.health.lims.common.exception.LIMSRuntimeException: Error while saving panel - kimeo at org.bahmni.feed.openelis.feed.transaction.support.AtomFeedHibernateTransactionManager.executeWithTransaction(AtomFeedHibernateTransactionManager.java:51) at org.ict4h.atomfeed.client.service.AtomFeedClient.processEvents(AtomFeedClient.java:68) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.processEvents(OpenELISFeedReaderJob.java:73) at org.bahmni.feed.openelis.feed.job.OpenELISFeedReaderJob.execute(OpenELISFeedReaderJob.java:57) at org.quartz.core.JobRunShell.run(JobRunShell.java:207) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560) Caused by: us.mn.state.health.lims.common.exception.LIMSRuntimeException: Error while saving panel - kimeo at org.bahmni.feed.openelis.feed.event.LabFeedEventWorker.process(LabFeedEventWorker.java:95) at org.ict4h.atomfeed.client.service.AtomFeedClient$EventProcessor.doInTransaction(AtomFeedClient.java:168) at org.ict4h.atomfeed.transaction.AFTransactionWorkWithoutResult.execute(AFTransactionWorkWithoutResult.java:6) at org.bahmni.feed.openelis.feed.transaction.support.AtomFeedHibernateTransactionManager.executeWithTransaction(AtomFeedHibernateTransactionManager.java:42) … 5 more Caused by: us.mn.state.health.lims.common.exception.LIMSException: Error while saving panel - kimeo at org.bahmni.feed.openelis.feed.service.impl.TypeOfSampleService.createOrUpdate(TypeOfSampleService.java:71) at org.bahmni.feed.openelis.feed.event.LabFeedEventWorker.process(LabFeedEventWorker.java:64) … 8 more
- Check the above panel “kimeo” in OpenMRS concept dictionary. The tests and panels must follow certain conventions, check the WIKI documentation
- Check if this is the only entry in the “failed_events”. If there are others, its possible that there are interdependencies … like a test in a panel was not set appropriately and subsequently the panel also fails.
I did it again… this time I dont get errors!!But doesnt create test on this tab openelis/TestMenu.do
well, if its a panel, then it should be in the openelis/PanelMenu.do
panel sync its self in openelis/PanelMenu.do But test doesnt… Still wondering because I did the same procedure in (new bahmni instance and worked)… But the existing one has issues! course I even started creating new test, new department, new sample and didnt work
Let me Give explaination problem I faced from the beginning: The main issue was patients were not able to sync into lab! when doctor order lab test. So I decide to remove all test in department, sample, panel! and start a fresh (*not deleting them). I created new lab test, new sample, new department its started giving me those errors… Error while saving panel, Error while saving department, error while saving sample
I decide to remove the lab test and and the existing one! that lab test worked! like it synced sample and tests and I was able to see a patient! so if I add another lab test in that sample and department! the error start! (error while saving…) So the only lab test that works is only that and if I start new sample, new department, new panel! different lab test it fails to sync *I tried the same procedure with new bahmni instance and works very well without any problem *This is a production server! I just had its instance… trying to make it work before I go to live one which as the same issue
- never try these on production server
- syncing patient to lab has got nothing to syncing lab orders/accessions. I am assuming that you mention sync patients to lab, you actually mean syncing lab orders/accessions to ELIS.
- Like the WIKI documentation mentioned, setup data.
- go one by one and ensure that each entity is created. If you create a whole lot of linked entities, then you will find it tough to troubleshoot which one is causing the error.
- samples are usually a limited set (blood, urine, stool, CSF etc) - if you have them already defined, don’t create another type again! This is represented as a “ConvSet” in openmrs, just add a new test/panel to this set.
- same for department (hematology department under “Lab Departments”). Ensure you add your test/panel under a representative department.
- and then add the test / panel under “all tests and panels” set.
- if you are creating a panel like “Routine Stool”, then you must first create the individual tests, add them to the “sample” and “department” and “all tests and panels”, add the test to the “Routine stool” panel,
- Note, even the panel must be added under the 3 sets - sample, department, all tests and panels.
The WIKI page also has a video that shows that. (its in Hindi, but you will get the idea).
At each step, go to OpenELIS and check whether such information has synced or not. If not, then you know something at that step is not correct. If something does not work, then as explained above, try to figure out from the logs, (And the database tables that I mentioned) - about the error, instead of just retying again!
Is it okay you have a call with @yusto ? he seems so frustrated with the blocker. Kindly help him out.
I wouldn’t want to encourage this, as we have limited time for such 1-1 interactions. He can join the core team standup tomorrow and if we have time, we will try to help him.
@jwnasambu if you did not know, @angshuonline is one of the bahmni experts that we have in our community. So, following his advice, is key to getting this resolved in a sustainable way.
I didn’t know that. I was just looking at the urgency of @yusto assuming he is implementing bahmni . @angshuonline I believe he is the safe hands and I go with your suggestion.
This helped me… I made sure My panel was added into “sample”, “department”, all_tests _and_panels. So Far I added 5 Lab test and worked without any errors!
Quick Question: Is naming a concept (lab test )with a name with “&, /, -” e.g Blood group & RH Factor does it cause problems?
- I just read it on talk.opemrs… just to be so sure (Editing OpenELIS Panels - #4 by stephencoduor)