Source:
<code>protected PageableResult doSearch(RequestContext context) throws ResponseException { String patientUuid = context.getRequest().getParameter("patient"); String stat = context.getRequest().getParameter("status"); if ((StringUtils.isNotEmpty(patientUuid)) && StringUtils.equals(stat, "any")) { try { throw new MissingRequiredIdentifierException("Sorry You did not Specify a Patient #UUID"); } <START> catch (MissingRequiredIdentifierException e) { <END> Util.log("Error :", e); } } if (patientUuid != null) { Patient patient = ((PatientResource1_8) Context.getService(RestService.class).getResourceBySupportedClass( Patient.class)).getByUniqueId(patientUuid); if (patient == null) { throw new ObjectNotFoundException(); } if (context.getType() != null) { PageableResult ret = (PageableResult) findAndInvokeSubclassHandlerMethod(context.getType(), "getActiveOrders", patient, context); if (ret != null) { return ret; } } String careSettingUuid = context.getRequest().getParameter("careSetting"); String asOfDateString = context.getRequest().getParameter("asOfDate"); CareSetting careSetting = null; Date asOfDate = null; if (StringUtils.isNotBlank(asOfDateString)) { asOfDate = (Date) ConversionUtil.convert(asOfDateString, Date.class); } if (StringUtils.isNotBlank(careSettingUuid)) { careSetting = ((CareSettingResource1_10) Context.getService(RestService.class).getResourceBySupportedClass( CareSetting.class)).getByUniqueId(careSettingUuid); } String status = context.getRequest().getParameter("status"); List<Order> orders = OrderUtil.getOrders(patient, careSetting, null, status, asOfDate, context.getIncludeAll()); if (context.getType() != null) { filterByType(orders, context.getType()); } return new NeedsPaging<Order>(orders, context); } return new EmptySearchResult(); }</code><technical_language>catching this? I want throw exception in this case</technical_language>

Target:
protected PageableResult doSearch(RequestContext context) throws ResponseException { String patientUuid = context.getRequest().getParameter("patient"); if (patientUuid != null) { Patient patient = ((PatientResource1_8) Context.getService(RestService.class).getResourceBySupportedClass( Patient.class)).getByUniqueId(patientUuid); if (patient == null) { throw new ObjectNotFoundException(); } if (context.getType() != null) { PageableResult ret = (PageableResult) findAndInvokeSubclassHandlerMethod(context.getType(), "getActiveOrders", patient, context); if (ret != null) { return ret; } } String careSettingUuid = context.getRequest().getParameter("careSetting"); String asOfDateString = context.getRequest().getParameter("asOfDate"); CareSetting careSetting = null; Date asOfDate = null; if (StringUtils.isNotBlank(asOfDateString)) { asOfDate = (Date) ConversionUtil.convert(asOfDateString, Date.class); } if (StringUtils.isNotBlank(careSettingUuid)) { careSetting = ((CareSettingResource1_10) Context.getService(RestService.class).getResourceBySupportedClass( CareSetting.class)).getByUniqueId(careSettingUuid); } String status = context.getRequest().getParameter("status"); List<Order> orders = OrderUtil.getOrders(patient, careSetting, null, status, asOfDate, context.getIncludeAll()); if (context.getType() != null) { filterByType(orders, context.getType()); } return new NeedsPaging<Order>(orders, context); } return new EmptySearchResult(); }