Examples of PatientList


Examples of org.raxa.module.raxacore.PatientList

  /**
   * Test of GetEncountersInPatientList method, of class PatientListServiceImpl given provider uuid.
   */
  @Test
  public void testGetEncountersInPatientListShouldFilterDrugOrders() {
    PatientList p = new PatientList();
    p.setCreator(new User());
    p.setName("GetPatientsTestList");
    p.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383ctyr" + "&containsOrderType=drugOrder");
    List<Encounter> encs = s.getEncountersInPatientList(p);
    //testing encounterType
   
    assertEquals(encs.size(), 1);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * @see PatientListController#retirePatientList(String,String,HttpServletRequest, HttpServletResponse)
   * @verifies void a location attribute type
   */
  @Test
  public void retirePatientList_shouldRetireAPatientList() throws Exception {
    PatientList pl1 = service.getPatientListByUuid(getUuid());
    Assert.assertFalse(pl1.isRetired());
    controller.retirePatientList(getUuid(), "testing", request, response);
    PatientList pl2 = service.getPatientListByUuid(getUuid());
    Assert.assertTrue(pl2.isRetired());
    Assert.assertEquals("testing", pl2.getRetireReason());
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  /**
   * Test of getPatientsInPatientList method, of class PatientListServiceImpl.
   */
  @Test
  public void testGetPatientsInPatientListShouldReturnPatients() {
    PatientList p = new PatientList();
    p.setCreator(new User());
    p.setName("GetPatientsTestList");
    p.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1"
            + "&startDate=2000-01-01T00:00:00&endDate=2012-01-02T00:00:00");
    List<Patient> pList = s.getPatientsInPatientList(p);
    //testing encounterType
    assertEquals(pList.size() > 0, Boolean.TRUE);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  @WSDoc("Save New PatientList")
  @ResponseBody
  public Object createNewPatientList(@RequestBody SimpleObject post, HttpServletRequest request,
          HttpServletResponse response) throws ResponseException {
    initPatientListController();
    PatientList patientList = new PatientList();
    patientList.setName(post.get("name").toString());
    patientList.setDescription(post.get("description").toString());
    if (post.get("searchQuery") != null) {
      patientList.setSearchQuery(post.get("searchQuery").toString());
    }
    PatientList created = service.savePatientList(patientList);
    SimpleObject obj = new SimpleObject();
    obj.add("uuid", created.getUuid());
    obj.add("name", created.getName());
    obj.add("description", created.getDescription());
    return RestUtil.created(response, obj);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  /**
   * Test of getPatientsInPatientList method, of class PatientListServiceImpl.
   */
  @Test
  public void testGetPatientsInPatientListShouldNotReturnPatientsWithInvalidDates() {
    PatientList p = new PatientList();
    p.setCreator(new User());
    p.setName("GetPatientsTestList");
    p.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1"
            + "&startDate=2012-01-02T00:00:0&endDate=2012-01-01T00:00:00");
    List<Patient> pList = s.getPatientsInPatientList(p);
    assertEquals(pList.size(), 0);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  @WSDoc("Updates an existing patient list")
  @ResponseBody
  public Object updatePatientList(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
          HttpServletRequest request, HttpServletResponse response) throws ResponseException {
    initPatientListController();
    PatientList patientList = service.getPatientListByUuid(uuid);
    patientList.setName(post.get("name").toString());
    patientList.setDescription(post.get("description").toString());
    if (post.get("searchQuery") != null) {
      patientList.setSearchQuery(post.get("searchQuery").toString());
    }
    PatientList created = service.updatePatientList(patientList);
    SimpleObject obj = new SimpleObject();
    obj.add("uuid", created.getUuid());
    obj.add("name", created.getName());
    obj.add("description", created.getDescription());
    return RestUtil.noContent(response);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test of getPatientsInPatientList method, of class PatientListServiceImpl.
   */
  @Test
  public void testGetPatientsInPatientListShouldUsePrivileges() {
    Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer"));
    PatientList p = new PatientList();
    p.setCreator(new User());
    p.setName("GetPatientsTestList");
    p.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1"
            + "&startDate=2000-01-01T00:00:00&endDate=2012-01-02T00:00:00");
    List<Patient> pList = null;
    try {
      pList = s.getPatientsInPatientList(p);
      //if we don't throw exception fail - no privileges required!
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  @WSDoc("Gets Patient Lists for the uuid path")
  @ResponseBody()
  public String getAllPatientListByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request)
          throws ResponseException {
    initPatientListController();
    PatientList patientList = service.getPatientListByUuid(uuid);
    SimpleObject obj = new SimpleObject();
    obj.add("uuid", patientList.getUuid());
    obj.add("name", patientList.getName());
    obj.add("description", patientList.getDescription());
    ArrayList patients = new ArrayList();
    List<Patient> patientsInPatientList = service.getPatientsInPatientList(patientList);
    for (Patient p : patientsInPatientList) {
      SimpleObject patient = new SimpleObject();
      patient.add("uuid", p.getUuid());
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  @WSDoc("Gets Full representation of Patient Lists for the uuid path")
  @ResponseBody()
  public String getAllPatientListByUuidFull(@PathVariable("uuid") String uuid, @RequestParam("v") String rep,
          HttpServletRequest request) throws ResponseException {
    initPatientListController();
    PatientList patientList = service.getPatientListByUuid(uuid);
    SimpleObject obj = new SimpleObject();
    obj.add("uuid", patientList.getUuid());
    obj.add("name", patientList.getName());
    obj.add("description", patientList.getDescription());
    obj.add("searchQuery", patientList.getSearchQuery());
    ArrayList patients = new ArrayList();
    List<Patient> patientsInPatientList = service.getPatientsInPatientList(patientList);
    for (Patient p : patientsInPatientList) {
      SimpleObject patient = new SimpleObject();
      patient.add("uuid", p.getUuid());
      patient.add("display", p.getPersonName().getFullName());
      patient.add("gender", p.getGender());
      patient.add("age", p.getAge());
      ArrayList encounters = new ArrayList();
      List<Encounter> encountersInPatientList = service.getEncountersInPatientList(patientList);
      for (Encounter e : encountersInPatientList) {
        if (e.getPatient().equals(p)) {
          SimpleObject encounter = new SimpleObject();
          encounter.add("uuid", e.getUuid());
          encounter.add("display", e.getEncounterType().getName() + " - " + e.getEncounterDatetime());
          encounter.add("encounterType", e.getEncounterType().getUuid());
          encounter.add("encounterDatetime", df.format(e.getEncounterDatetime()));
          if (e.getProvider() != null) {
            encounter.add("provider", e.getProvider().getUuid());
          } else {
            encounter.add("provider", null);
          }
          ArrayList obsArray = new ArrayList();
          Set<Obs> obsAll = e.getObs();
          for (Obs o : obsAll) {
            SimpleObject obs = new SimpleObject();
            obs.add("uuid", o.getUuid());
            obs.add("display", o.getConcept().getName().getName() + " = "
                    + o.getValueAsString(request.getLocale()));
            obs.add("obsDatetime", df.format(o.getObsDatetime()));
            obs.add("value", o.getValueAsString(request.getLocale()));
            obs.add("comment", o.getComment());
            if (o.getOrder() != null) {
              obs.add("order", o.getOrder().getUuid());
            } else {
              obs.add("order", null);
            }
            obsArray.add(obs);
          }
          encounter.add("obs", obsArray);
          encounters.add(encounter);
        }
      }
      patient.add("encounters", encounters);
      patients.add(patient);
    }
    obj.add("patients", patients);
    if (rep.equals("full")) {
      obj.add("retired", patientList.getRetired());
      if (patientList.getRetired()) {
        obj.add("retiredBy", patientList.getRetiredBy().getUuid());
        obj.add("retireReason", patientList.getRetireReason());
      }
      SimpleObject auditInfo = new SimpleObject();
      auditInfo.add("creator", patientList.getCreator().getUuid());
      auditInfo.add("dateCreated", df.format(patientList.getDateCreated()));
      if (patientList.getChangedBy() != null) {
        auditInfo.add("changedBy", patientList.getChangedBy().getUuid());
        auditInfo.add("dateChanged", df.format(patientList.getDateChanged()));
      }
      obj.add("auditInfo", auditInfo);
    }
    obj.add("resourceVersion", getResourceVersion());
    return gson.toJson(obj);
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   */
  @Test
  public void testUpdatePatientListShouldUsePrivileges() {
    Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer"));
    Context.getUserContext().addProxyPrivilege("View Patient Lists");
    PatientList patientList = s.getPatientList(1);
    patientList.setName("NewNameList");
    try {
      s.updatePatientList(patientList);
      //if we don't throw exception fail - no privileges required!
      fail("No privileges required for updatePatientList");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.