I have just upgraded to platform 1.12.0 and I am unable to run unit tests involving drug orders. I have established the error to be associated with order activation field.
The generated query keeps referencing startDate yet my module depends on openmrs 1.12.0 and reporting 0.9.8.1. The generated query looks like below:
select do.patient.patientId as patientId, do as do from org.openmrs.DrugOrder as do where do.voided = :param1 and do.patient.patientId in (2,6,7,8,999) and do.concept in (:param2) and do.startDate <= :param3
Any idea on what I could be doing wrong? Thanks in advance
Are you running the reference application or core with a couple of modules?
Typically not all module versions will support the all core versions. I would say make sure you have upgraded all your modules to their latest versions.
Hi @mseaton. An example unit test is at this link and it fails when evaluating DrugOrdersForPatientDataDefinition. Please let me know if I need to provide more information.
@aojwang, the DrugOrdersForPatientDataEvaluator is designed to adjust for differences in the drug order model between versions 1.9 and 1.10 in OpenMRS. Have you updated your pom.xml to change openMRSVersion to the appropriate version? Can you debug your unit test to see the value of OpenmrsConstants.OPENMRS_VERSION_SHORT? This is what the evaluator is looking at.
I had also expected it to adjust as you have explained. I debugged and even added (ModuleUtil.compareVersion(
OpenmrsConstants.OPENMRS_VERSION_SHORT, “1.10”) to the test to get the value. It always evaluated to -1 and that is what made me think that may be there is some configuration I didn’t get right.
That constant had a value of ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}. It wasn’t a number