Unable to render Composition Query - Failed to evaluate sub-query

Tags: #<Tag:0x00007fe2ecd0c330> #<Tag:0x00007fe2ecd0c268>

I was able to get the indicator report to render perfectly via the Ref App UI but it leads to another issue. The report render only a single indicator report and throws an error when i create a Composition Query e.g. adding more than one indicator to generate another indicator report. See the output here … Have you previously come across this error?

Message Request processing failed; nested exception is org.openmrs.module.reporting.evaluation.EvaluationException: Failed to evaluate sub-query

Did you look at this error message?

Failed to evaluate sub-query 'ART' of composition 'ART-Total number of HIV-positive people newly enrolled in clinical care during the month (excludes transfer-in)' because: The property 'ART' cannot be found in the database. (Maybe someone deleted it?)

Looks like you have called with key ART in your setCompositionString() method of the definitions but it is lacking in the addSearch() method as a key, or it is renamed to something else. Just make sure all that are called in the setcompositionstring method are found in the addSearch method.

@dkayiwa Yes i saw the message but how do i define the ART to allow me to render without error. I have searched and tweak all my queries but couldn’t find any of them to render.

@ningosi I might have missed the process, can you point me to the setCompositionString() and how to go about this?

If you can share the code that is being executed to bring out that error, then I can easily tell where that is coming from

Thanks @ningosi but I am referring to this Cohort Definition. Please take a look and let me know

Looks like the link you have shared is incomplete, however I thought the source code is somewhere in github where I could check direclty

Go to demo.openmrs.org - Follow this directory: System Administration - Advanced Administration - Administration - Manage Report Definitions - Cohort Queries - Composition Query. Check if you can define indicators and create a composition query. Thanks

Ok. I tried creating one here but trying to add the cohort definitions I got this in the console https://pastebin.com/8hwKCYMj maybe @dkayiwa can comment on that