TRUNK-4217 | Order Validations -
1) durationUnits can not be null if duration is present.
2) quantityUnits,doseUnits or durationUnits should be of type Units of Measure class
3) startDate should not be before encounter's encounterDateTime.
4) if scheduledDate is set, urgency should be ON_SCHEDULED_DATE.
5) order.orderType.javaClass should match order.class, subclasses
Addressed review comments to fix comparison of orderType.class and the validates order type - TRUNK-4217

Addressed review comments to fix comparison of orderType.class and the validates order type - TRUNK-4217

Follow up
Added the changeset that ensures no existing order are neither drug nor test orders
Follow up to fix failing unti test
Added an encounter to the test dataset for patient with id 2
Follow up to fix failing test in PersonServiceTest
Follow up to apply auto format changes
Implemented rejecting orders where patient, careSetting, concept or drug if is drug order have changed - TRUNK-4217
Fixed Order.frequency name in Order.hbm file
TRUNK-4332 Add getDiscontinationOrder - post review fixes
Updated the return types of clone method in Order subclasses so that the caller doesn't have to type cast the returned instance

Updated the return types of clone method in Order subclasses so that the caller doesn't have to type cast the returned instance
Updated OrderService.saveOrder to reject previous orders that have differing concepts or drugs for drug orders - TRUNK-4217
Refactored and improved code in OrderServiceImpl.saveOrder, OrderValidator and added more unit tests around validating orders - TRUNK-4217