@Test public void retirePatientList_shouldRetireAPatientList() throws Exception { PatientList pl1 = service.getPatientListByUuid(getUuid()); Assert.assertFalse(pl1.isRetired()); controller.retirePatientList(getUuid(), "testing", request, response); PatientList pl2 = service.getPatientListByUuid(getUuid()); Assert.assertTrue(pl2.isRetired()); Assert.assertEquals("testing", pl2.getRetireReason()); }
@RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody public Object retirePatientList(@PathVariable("uuid") String uuid, @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initPatientListController(); PatientList patientList = service.getPatientListByUuid(uuid); if (patientList != null) { patientList.setRetired(true); patientList.setRetireReason(reason); patientList.setRetiredBy(Context.getAuthenticatedUser()); service.updatePatientList(patientList); } return RestUtil.noContent(response); }
PatientListController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody public Object retirePatientList(@PathVariable("uuid") String uuid, @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initPatientListController(); PatientList patientList = service.getPatientListByUuid(uuid); if (patientList != null) { patientList.setRetired(true); patientList.setRetireReason(reason); patientList.setRetiredBy(Context.getAuthenticatedUser()); service.updatePatientList(patientList); } return RestUtil.noContent(response); } }
PatientListController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody public Object retirePatientList(@PathVariable("uuid") String uuid, @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initPatientListController(); PatientList patientList = service.getPatientListByUuid(uuid); if (patientList != null) { patientList.setRetired(true); patientList.setRetireReason(reason); patientList.setRetiredBy(Context.getAuthenticatedUser()); service.updatePatientList(patientList); } return RestUtil.noContent(response); }  }
PatientListController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody public Object retirePatientList(@PathVariable("uuid") String uuid, @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initPatientListController(); PatientList patientList = service.getPatientListByUuid(uuid); if (patientList != null) { patientList.setRetired(true); patientList.setRetireReason(reason); patientList.setRetiredBy(Context.getAuthenticatedUser()); service.updatePatientList(patientList); } return RestUtil.noContent(response); }  void initPatientListController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New PatientList") @ResponseBody Object createNewPatientList(@RequestBody SimpleObject post, HttpServletRequest request,
	        HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing patient list") @ResponseBody Object updatePatientList(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
	        HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Patient Lists in the system") @ResponseBody() String getAllPatientLists(HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "q") @WSDoc("Gets Patient Lists by name") @ResponseBody() String getPatientListsByName(@RequestParam("q") String query, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Patient Lists for the uuid path") @ResponseBody() String getAllPatientListByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET, params = "v") @WSDoc("Gets Full representation of Patient Lists for the uuid path") @ResponseBody() String getAllPatientListByUuidFull(@PathVariable("uuid") String uuid, @RequestParam("v") String rep,
	        HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, params = "encounterType") @WSDoc("Gets Patients Without Saving the Patient list") @ResponseBody() String getPatientsInPatientList(@RequestParam Map<String, String> params, HttpServletRequest request); @RequestMapping(value = "/optimized", method = RequestMethod.GET, params = "encounterType") @WSDoc("Gets Patients Without Saving the Patient list") @ResponseBody() String getPatientsInPatientListV2(@RequestParam Map<String, String> params, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody Object retirePatientList(@PathVariable("uuid") String uuid,
	        @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request,
	        HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "purge") @ResponseBody Object purgePatientList(@PathVariable("uuid") String uuid, HttpServletRequest request,
	        HttpServletResponse response); }
PatientListController extends BaseRestController { @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody public Object retirePatientList(@PathVariable("uuid") String uuid, @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request, HttpServletResponse response) throws ResponseException { initPatientListController(); PatientList patientList = service.getPatientListByUuid(uuid); if (patientList != null) { patientList.setRetired(true); patientList.setRetireReason(reason); patientList.setRetiredBy(Context.getAuthenticatedUser()); service.updatePatientList(patientList); } return RestUtil.noContent(response); }  void initPatientListController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New PatientList") @ResponseBody Object createNewPatientList(@RequestBody SimpleObject post, HttpServletRequest request,
	        HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.POST) @WSDoc("Updates an existing patient list") @ResponseBody Object updatePatientList(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
	        HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET) @WSDoc("Get All Unretired Patient Lists in the system") @ResponseBody() String getAllPatientLists(HttpServletRequest request, HttpServletResponse response); @RequestMapping(method = RequestMethod.GET, params = "q") @WSDoc("Gets Patient Lists by name") @ResponseBody() String getPatientListsByName(@RequestParam("q") String query, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Patient Lists for the uuid path") @ResponseBody() String getAllPatientListByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET, params = "v") @WSDoc("Gets Full representation of Patient Lists for the uuid path") @ResponseBody() String getAllPatientListByUuidFull(@PathVariable("uuid") String uuid, @RequestParam("v") String rep,
	        HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, params = "encounterType") @WSDoc("Gets Patients Without Saving the Patient list") @ResponseBody() String getPatientsInPatientList(@RequestParam Map<String, String> params, HttpServletRequest request); @RequestMapping(value = "/optimized", method = RequestMethod.GET, params = "encounterType") @WSDoc("Gets Patients Without Saving the Patient list") @ResponseBody() String getPatientsInPatientListV2(@RequestParam Map<String, String> params, HttpServletRequest request); @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "!purge") @WSDoc("Retires the Patient List") @ResponseBody Object retirePatientList(@PathVariable("uuid") String uuid,
	        @RequestParam(value = "reason", defaultValue = "web service call") String reason, HttpServletRequest request,
	        HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE, params = "purge") @ResponseBody Object purgePatientList(@PathVariable("uuid") String uuid, HttpServletRequest request,
	        HttpServletResponse response);  }