Merge pull request #412 from teleivo/RAD-303 RAD-303 Rethink exceptions of API
teleivo <mrteleivo@gmail.com>
42199881d858a646c1afd092b48622063bbfb0fb
RAD-303 Rethink exceptions of API
throw openmrs APIException in service methods for cases violating business rules, and IllegalArgumentException for cases that are programming errors.
APIExceptions are thrown using message codes from the message properties files, so the client code can catch those and display the error message to the user.
* RadiologyStudyService.saveRadiologyStudy() does not allow saving existing
* use throw APIException in RadiologyOrderServie.placeRadiologyOrder() and
discontinueRadiologyOrder()
* catch APIException in RadiologyOrderFormController.saveRadiologyOrder()
* reduce code in catch block in
RadiologyOrderFormController.saveRadiologyOrder() only to the service call
* return in save/discontinueRadiologyOrder in controller after redirect since
model objects in model and view will not be used.