Example #1
0
 @GetTags(type = Patient.class)
 public TagList getAllTagsPatient() {
   TagList tagList = new TagList();
   tagList.add(new Tag((String) null, "Patient", "DogLabel"));
   tagList.add(new Tag("http://cats", "AllCat", "CatLabel"));
   return tagList;
 }
Example #2
0
 @GetTags
 public TagList getAllTags() {
   TagList tagList = new TagList();
   tagList.add(new Tag((String) null, "AllDog", "DogLabel"));
   tagList.add(new Tag("http://cats", "AllCat", "CatLabel"));
   return tagList;
 }
Example #3
0
 @GetTags(type = Observation.class)
 public TagList getAllTagsObservationIdVersion(@IdParam IdDt theId) {
   TagList tagList = new TagList();
   tagList.add(
       new Tag(
           (String) null, "Patient" + theId.getIdPart() + theId.getVersionIdPart(), "DogLabel"));
   tagList.add(new Tag("http://cats", "AllCat", "CatLabel"));
   return tagList;
 }
Example #4
0
  @Test
  public void testGetAllTagsPatientIdVersion() throws Exception {

    HttpGet httpGet =
        new HttpGet("http://localhost:" + ourPort + "/Patient/111/_history/222/_tags");
    HttpResponse status = ourClient.execute(httpGet);

    String responseContent = IOUtils.toString(status.getEntity().getContent());
    IOUtils.closeQuietly(status.getEntity().getContent());

    ourLog.info("Response was:\n{}", responseContent);

    assertEquals(200, status.getStatusLine().getStatusCode());

    TagList actual = ourCtx.newXmlParser().parseTagList(responseContent);
    TagList expected = new TagList();
    expected.addTag(null, "Patient111222", "DogLabel");
    expected.addTag("http://cats", "AllCat", "CatLabel");
    assertEquals(expected, actual);
  }
Example #5
0
  @Test
  public void testAddTagsById() throws Exception {

    TagList tagList = new TagList();
    tagList.addTag("scheme", "term", "label");

    HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/111/_tags");
    httpPost.setEntity(
        new StringEntity(
            ourCtx.newJsonParser().encodeTagListToString(tagList),
            ContentType.create(EncodingEnum.JSON.getResourceContentType(), "UTF-8")));
    HttpResponse status = ourClient.execute(httpPost);

    String responseContent = IOUtils.toString(status.getEntity().getContent());
    IOUtils.closeQuietly(status.getEntity().getContent());

    ourLog.info("Response was:\n{}", responseContent);

    assertEquals(200, status.getStatusLine().getStatusCode());
    assertEquals("add111", ourLastOutcome);
    assertEquals(tagList, ourLastTagList);
  }