Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.openmrs.module.drugmaster.web.controller;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.UUID;
- import org.springframework.http.HttpStatus;
- import org.springframework.http.ResponseEntity;
- import org.springframework.stereotype.Controller;
- import org.openmrs.api.context.Context;
- import org.openmrs.module.drugmaster.Drugs;
- import org.openmrs.module.drugmaster.api.DrugmasterService;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- @Controller
- @RequestMapping(value = "/rest/v1/drugmaster/")
- public class DrugApiResources {
- @RequestMapping(value = "/vtm", method = RequestMethod.GET)
- public ResponseEntity<?> getProvinceList() {
- List<Drugs> res = Context.getService(DrugmasterService.class).GetVTMDrugs();
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("datalist", res);
- return new ResponseEntity<Object>(map, HttpStatus.OK);
- }
- @RequestMapping(value = "/vmp/{id}", method = RequestMethod.GET)
- public Drugs GetVMPDrugs(@PathVariable(value = "id") String id) {
- Drugs res = Context.getService(DrugmasterService.class).GetVMPDrugs(id);
- return res;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement