Guest User

Untitled

a guest
Jul 21st, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. package org.openmrs.module.coreapps.page.controller.conditionlist;
  2.  
  3. /**
  4. * The contents of this file are subject to the OpenMRS Public License
  5. * Version 1.0 (the "License"); you may not use this file except in
  6. * compliance with the License. You may obtain a copy of the License at
  7. * http://license.openmrs.org
  8. * <p>
  9. * Software distributed under the License is distributed on an "AS IS"
  10. * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  11. * License for the specific language governing rights and limitations
  12. * under the License.
  13. * <p>
  14. * Copyright (C) OpenMRS, LLC. All Rights Reserved.
  15. */
  16.  
  17. import org.openmrs.ui.framework.page.PageModel;
  18. import org.springframework.web.bind.annotation.RequestParam;
  19. import org.apache.commons.lang.StringUtils;
  20. import org.openmrs.Patient;
  21. import org.openmrs.api.context.Context;
  22. import org.openmrs.module.coreapps.CoreAppsConstants;
  23. import org.openmrs.ui.framework.UiUtils;
  24. import javax.servlet.http.HttpServletRequest;
  25. import javax.servlet.http.HttpSession;
  26. import org.openmrs.ui.framework.annotation.SpringBean;
  27. import org.springframework.validation.BeanPropertyBindingResult;
  28. import org.springframework.validation.Errors;
  29. import org.springframework.validation.ObjectError;
  30. import org.openmrs.Condition;
  31.  
  32. import java.util.Collections;
  33.  
  34. public class EditConditionPageController {
  35.  
  36. public void controller(PageModel model, @RequestParam(value = "returnUrl", required = false) String returnUrl) {
  37. model.addAttribute("returnUrl", returnUrl);
  38. }
  39.  
  40. public String post(@RequestParam("patientId") Patient patient,
  41. @RequestParam(value = "returnUrl", required = false) String returnUrl,
  42. @RequestParam("condition") Condition condition,
  43. PageModel model,UiUtils ui,
  44. HttpSession session) {
  45. System.out.println("EditConditionController");
  46. System.out.println(condition);
  47. return "redirect:coreapps/conditionlist/editCondition.page?patientId=" + patient.getPatientId() + "&returnUrl=" + ui.urlEncode(returnUrl);
  48. }
  49. }
Add Comment
Please, Sign In to add comment