Advertisement
Guest User

Untitled

a guest
Dec 20th, 2022
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. package org.openmrs.module.drugmaster.web.controller;
  2.  
  3. import java.util.HashMap;
  4. import java.util.List;
  5. import java.util.Map;
  6. import java.util.UUID;
  7.  
  8. import org.springframework.http.HttpStatus;
  9. import org.springframework.http.ResponseEntity;
  10. import org.springframework.stereotype.Controller;
  11. import org.openmrs.api.context.Context;
  12. import org.openmrs.module.drugmaster.Drugs;
  13. import org.openmrs.module.drugmaster.api.DrugmasterService;
  14. import org.springframework.web.bind.annotation.PathVariable;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RequestMethod;
  17.  
  18. @Controller
  19. @RequestMapping(value = "/rest/v1/drugmaster/")
  20. public class DrugApiResources {
  21.  
  22. @RequestMapping(value = "/vtm", method = RequestMethod.GET)
  23. public ResponseEntity<?> getProvinceList() {
  24. List<Drugs> res = Context.getService(DrugmasterService.class).GetVTMDrugs();
  25. Map<String, Object> map = new HashMap<String, Object>();
  26. map.put("datalist", res);
  27. return new ResponseEntity<Object>(map, HttpStatus.OK);
  28. }
  29.  
  30. @RequestMapping(value = "/vmp/{id}", method = RequestMethod.GET)
  31. public Drugs GetVMPDrugs(@PathVariable(value = "id") String id) {
  32. Drugs res = Context.getService(DrugmasterService.class).GetVMPDrugs(id);
  33. return res;
  34. }
  35.  
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement