Details
-
Bug
-
Status: Closed
-
TBD
-
Resolution: Won't Fix
-
OpenMRS 1.7.0, OpenMRS 1.7.1, OpenMRS 1.7.2, OpenMRS 1.7.3, OpenMRS 1.7.4, OpenMRS 1.8.0, OpenMRS 1.8.1, OpenMRS 1.8.2, OpenMRS 1.8.3, OpenMRS 1.8.4
-
None
-
None
Description
When troubleshooting a bug, we came across an apparent bug in the 1.7.x and 1.8.x releases. The getEncounters method in HibernateEncounterDAO.java, passes in Collection<User> providers. However, providers are actually persons in the encounter table so the following code is passing in the wrong ids:
if (providers != null && providers.size() > 0) { crit.add(Expression.in("provider", providers)); }
Instead of passing a list of person ids, like it should, it is passing a list of user ids. As of version 1.7.x, I believe, User no longer extended Person, so the user_id and person_id were no longer guaranteed to be the same. The fix for this issue, I believe, is to change the method so the parameter is Collection<Person> providers. Since, according to the wiki, 1.7.x and 1.8.x are both still support versions, bug fixes needs to be backported to these two versions.