The above throws an exception that i have not been able to determine, am invoking into this from a module which was working before but i can’t know what messed around with it to fail as of yesterday even when i run the old code onto which it was working.
org.hibernate.HibernateException: Unable to locate named class SIMPLE
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
org.openmrs.api.db.hibernate.HibernateOrderDAO.getOrders(HibernateOrderDAO.java:151)
org.openmrs.api.impl.OrderServiceImpl.getAllOrdersByPatient(OrderServiceImpl.java:476)
This was caused by drug_order.dosing_type storing SIMPLE instead of org.openmrs.SimpleDosingInstructions, as last changed in 1.11.5 at:
this property is meant to store a class reference string either org.openmrs.SimpleDosingInstructions or org.openmrs.FreeTextDosingInstructions instead of, ‘SIMPLE’ or ‘FREE_TEXT’ as of the above last changeset.
A quick fix is to manually update the database or run it in a module’s liquibase changeset.
I have filed an intro ticket to get this fixed and most essentially back ported to all craving platform versions for this change such as 1.11.x.
Hmm, so to be clear, it looks like that changeset, which was written in Dec 2013, has always been wrong, ever since the Platform 1.10.0 release.
Since nobody has reported this error before, I guess that nobody has upgraded a database from pre-1.10 to 1.10+ that contains drug orders, and then tried to use those drug orders!