Bahmni Connect: Unable to fetch concepts on the Visit screen

Hi team!

On the Bahmni demo, Bahmni Connect app, I am not able to enter observations for a new patient I have created, on the Visit screen:

The call is made for Nutritional Values:

Nutritional Values

The response is undefined:

response is undefined

(cc: @sumanmaity112)

Check your /var/www/bahmni_config/openmrs/apps/registration/extension.js

You can either delete the extension definitions (org.bahmni.registration.conceptSetGroup.observations) or have a set different conceptSet. From v0.90, you can also leverage the new Forms 2.0 based forms (created using Form Builder). Check 8. Configure Visit Details form for details

Sorry, I thought this was for the online version. Although, this should also suffice for connect.

@shashikanth, @hanishap can you confirm?

@angshuonline here I just mean to report this bug I see on the demo server https://demo.mybahmni.org/bahmni-connect/ (and I also have the same problem on my own server)

So, this is what happened. Registration 2nd page, was supported only from 0.90 version. the database in demo is not updated so that when the sync happens, the relevant concepts (Nutritional Values and its child members HEIGHT and WEIGHT) are not synced.

For any concept (or set) to be available in Bahmni Connect, you have to add them in the “Offline Concepts” first.

More information https://bahmni.atlassian.net/wiki/spaces/BAH/pages/40501300/Bahmni+Connect+sync+-+Pull+and+Push

btw, till the demo database is rectified, this is likely to happen again. We use a database dump for the demo sites, and this gets reset every night. So permanent fix is to set the database entries right.

Thanks. That works now.

Is there any particular reason why we have to specify child concepts as well?

I mean it seems much simpler to add the parent only, and have the children automatically taken into account.

I think its because there can be several levels of nesting :frowning:

Can be improved.

Hi @mksrom,

Let say you have a concept set which has n number of children and those children are not leaf concept, they have again n number children for some level. But in case of bahmni connect, you might be interested in some children of the concept, not all of them. In that scenario, its better to add those concepts manually to offline concepts

OK I see. I was under the impression that one would rather want to have a form, or not have it at all. And not necessarily having a form with only certain members…

If one needs to have a limited set of child concepts, I would prefer building a specific “offline” form with only the needed members.

I am saying this because it will be difficult to maintain this “Offline concepts” set with all the children concepts. Especially if one has to always carefully put the child concepts before the parent concepts (as explained by @angshuonline on Slack)

But anyway this is not applicable with the Form Builder right?

@sumanmaity112 @angshuonline, It seems that the createOfflineConcepts.py script does not copy all the concepts. It only copies the children of the ‘All Observation Templates’ concept. In the case of the Registration 2nd screen (Visit screen), concepts are not copied (they do not belong to All Observation Template).

In my case I am maintaining all concepts as CSVs, loaded via a module Activator.

I would like to also maintain the ‘Offline Concepts’ concept this way.

The thing is that when the concept is created by the activator, no record is created in the event_records table. Maybe the scheduler is not started when the activator runs? And therefore nothing happens in the event log too.

Is there a way to tell/force events to the scheduler so the event_records get updated?

Being unable to find more information about this specific problem, I have had to modify the copyOfflineConcepts.py Python script to also include members of the ‘Registration Offline Concepts’ concepts set.

This way all concepts are made available for syncing. See https://bahmni.atlassian.net/browse/BAH-449

This is not an ideal solution but it will do for now.