@Test public void testGetEncountersByProvider() throws Exception { Map<String, String> params = new HashMap(); params.put("provider", "68547121-1b70-465e-99ee-c9df45jf9j32"); String results = controller.getEncountersByProvider(params, request); List encounters = (ArrayList) (SimpleObject.parseJson(results).get("results")); Assert.assertEquals(1, encounters.size()); }
@RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() public String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request) throws ResponseException { initEncounterController(); List<Provider> providers = new ArrayList(); providers.add(Context.getProviderService().getProviderByUuid(params.get("provider"))); List<Encounter> encounters = service.getEncounters(null, null, null, null, null, null, providers, null, null, true); ArrayList results = new ArrayList(); for (Encounter encounter : encounters) { results.add(getEncounterAsSimpleObject(encounter)); } return gson.toJson(new SimpleObject().add("results", results)); }
RaxaEncounterController extends BaseRestController { @RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() public String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request) throws ResponseException { initEncounterController(); List<Provider> providers = new ArrayList(); providers.add(Context.getProviderService().getProviderByUuid(params.get("provider"))); List<Encounter> encounters = service.getEncounters(null, null, null, null, null, null, providers, null, null, true); ArrayList results = new ArrayList(); for (Encounter encounter : encounters) { results.add(getEncounterAsSimpleObject(encounter)); } return gson.toJson(new SimpleObject().add("results", results)); } }
RaxaEncounterController extends BaseRestController { @RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() public String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request) throws ResponseException { initEncounterController(); List<Provider> providers = new ArrayList(); providers.add(Context.getProviderService().getProviderByUuid(params.get("provider"))); List<Encounter> encounters = service.getEncounters(null, null, null, null, null, null, providers, null, null, true); ArrayList results = new ArrayList(); for (Encounter encounter : encounters) { results.add(getEncounterAsSimpleObject(encounter)); } return gson.toJson(new SimpleObject().add("results", results)); }  }
RaxaEncounterController extends BaseRestController { @RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() public String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request) throws ResponseException { initEncounterController(); List<Provider> providers = new ArrayList(); providers.add(Context.getProviderService().getProviderByUuid(params.get("provider"))); List<Encounter> encounters = service.getEncounters(null, null, null, null, null, null, providers, null, null, true); ArrayList results = new ArrayList(); for (Encounter encounter : encounters) { results.add(getEncounterAsSimpleObject(encounter)); } return gson.toJson(new SimpleObject().add("results", results)); }  void initEncounterController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New Encounter") @ResponseBody Object createNewEncounter(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() String getEncounterByUuidFull(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request); }
RaxaEncounterController extends BaseRestController { @RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() public String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request) throws ResponseException { initEncounterController(); List<Provider> providers = new ArrayList(); providers.add(Context.getProviderService().getProviderByUuid(params.get("provider"))); List<Encounter> encounters = service.getEncounters(null, null, null, null, null, null, providers, null, null, true); ArrayList results = new ArrayList(); for (Encounter encounter : encounters) { results.add(getEncounterAsSimpleObject(encounter)); } return gson.toJson(new SimpleObject().add("results", results)); }  void initEncounterController(); @RequestMapping(method = RequestMethod.POST) @WSDoc("Save New Encounter") @ResponseBody Object createNewEncounter(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = "/{uuid}", method = RequestMethod.GET) @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() String getEncounterByUuidFull(@PathVariable("uuid") String uuid, HttpServletRequest request); @RequestMapping(method = RequestMethod.GET, params = "provider") @WSDoc("Gets Full representation of Encounter for the uuid path") @ResponseBody() String getEncountersByProvider(@RequestParam Map<String, String> params, HttpServletRequest request);  }