Cohort builder error on openmrs 2.1.2.

Good find people!

(Yes, I’m not surprised that Cohort Builder is broken due to the Platform 2.1.x changes. It would be good if some dev can research exactly what’s broken and how to fix it. (“This commit” that Bailly links to is relevant, but it doesn’t seem to be the latest code.)

FWIW, the problem started happening with this commit:

Can someone please create a ticket for this?


Just created a ticket and committed a proposed fix

@wyclif if you review and approve, i will back port to the 2.1.x branch

1 Like

Hey I’m having a similar issue only that, instead of 0 , I get a “?” for all cohort. I’m also on 2.1.2 Any ideas?

Sorry, I took this conversation to the #dev channel, in this other thread: More changes to the new Cohort Membership model

To summarize the current state:

  • changes introduced in Platform 2.1.x have broken the cohort builder module
  • I’m proposing a change to the platform (see that other thread) that will address this in the “right way”
    • someone is working on this ticket now
    • this will require releasing a new Platform 2.1.3

Now that I write this I realize we should consider doing a quick-hack fix purely in the cohort builder code. @dkayiwa, thinking back to the original fix you proposed, would it be possible to do something like this purely within the module? (This would let us get the module fixed immediately for people running the latest platform release.)

I have created this ticket and attached a compiled module with the hack:

If the hack is approved, and @judy you test to confirm that all is well, i can release the module.

@aramirez, you also could test this.

@darius, I already did, take a look a couple of posts up.

@aramirez I mean, Daniel just did a quick-fix for this issue, and before he officially releases it he’d like a real user to test it.

See the attached file here:

@darius @dkayiwa test this fix with version 2.1.2,

I still get the ? in the values, but now also get this warning message:

No class by name: DWRCohortBuilderService

@aramirez are you running a new query? Or just looking at existing ones? Which new query did you run? And how did you update the module? Can you also confirm by going to the Administration Manage modules page to confirm that the version is 2.0.5-snapshot?

On my side, I tested it with OpenMRS Version: 2.1.1 and I’m now getting results when I run searches.

The results are sometimes wrong though! Especially when I use patient attributes and composition searches.

I agree with @rubailly, still get incorrect results after doing search of the patient attributes like males or females

@dkayiwa running new query from encounters tab, module updated via web, version was confirmed 2.0.5 . As other members have mentioned rolled back to 2.0.6 and it seems to work fine in that version.

@dkayiwa my saved queries do not show up…but i am able to run new ones - they spit out wrong results though – for example …My DB has 600 + patients but on cohort builder only shows 186 patients

@aramirez where did you get 2.0.6 ?

sorry, missed a word. OpenMRS Platform 2.0.6

@judy i have just made a second attempt at hacking the module to fix this problem. Can you test it and tell us what happens? The compiled module is attached on the JIRA ticket

@dkayiwa- I tested it again on OpenMRS Version: 2.1.1 and I’m getting correct results. The issue with wrong results when querying for Patient Attributes is solved as well…

@ejustine -it would be good to test this on your side as well and confirm if everything is working fine.