Examples of PatientList


Examples of org.raxa.module.raxacore.PatientList

   * Test of getPatientList method, of class HibernatePatientListDAO.
   */
  @Test
  public void testGetPatientList() {
    Integer patientListId = 1;
    PatientList result = dao.getPatientList(patientListId);
    String name = result.getName();
    assertEquals("TestList1", name);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  /**
   * Test of updatePatientList method, of class HibernatePatientListDAO.
   */
  @Test
  public void testUpdatePatientList() {
    PatientList patientList = dao.getPatientList(1);
    patientList.setName("NewNameList");
    dao.updatePatientList(patientList);
    String name = dao.getPatientList(1).getName();
    assertEquals(name, "NewNameList");
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test of savePatientList method, of class PatientListServiceImpl.
   */
  @Test
  public void testSavePatientListShouldUsePrivileges() throws Exception {
    Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer"));
    PatientList pList = new PatientList();
    //NOTE: never set Id, will be generated automatically (when saving)
    pList.setName("TestList3");
    pList.setDescription("Third Test List");
    pList.setCreator(Context.getUserContext().getAuthenticatedUser());
    pList.setDateCreated(new java.util.Date());
    pList.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30");
    pList.setRetired(Boolean.FALSE);
    pList.setSearchQuery("test Query");
    try {
      s.savePatientList(pList);
      //if we don't throw exception fail - no privileges required!
      fail("No privileges required for savePatientList");
    }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  /**
   * Test of savePatientList method, of class PatientListServiceImpl.
   */
  @Test
  public void testSavePatientListShouldSavePatientList() throws Exception {
    PatientList pList = new PatientList();
    //NOTE: never set Id, will be generated automatically (when saving)
    pList.setName("TestList3");
    pList.setDescription("Third Test List");
    pList.setCreator(Context.getUserContext().getAuthenticatedUser());
    pList.setDateCreated(new java.util.Date());
    pList.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30");
    pList.setRetired(Boolean.FALSE);
    pList.setSearchQuery("test Query");
    s.savePatientList(pList);
    List<PatientList> result = s.getPatientListByName("TestList3");
    String name = result.get(0).getName();
    assertEquals(name, "TestList3");
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

  @Test
  public void testGetPatientListShouldUsePrivileges() {
    Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer"));
    Context.getUserContext().removeProxyPrivilege("View Patient Lists");
    Integer patientListId = 1;
    PatientList result = null;
    try {
      result = s.getPatientList(patientListId);
      //if we don't throw exception fail - no privileges required!
      fail("No privileges required for getPatientList");
    }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test of getPatientList method, of class PatientListServiceImpl.
   */
  @Test
  public void testGetPatientListShouldReturnPatientList() {
    Integer patientListId = 1;
    PatientList result = s.getPatientList(patientListId);
    String name = result.getName();
    assertEquals("TestList1", name);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test of getEncountersInPatientList method, of class
   * PatientListServiceImpl.
   */
  @Test
  public void testGetEncountersInPatientListShouldReturnEncounters() {
    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<Encounter> encs = s.getEncountersInPatientList(p);
    //testing encounterType
    assertEquals(encs.size() > 0, Boolean.TRUE);
    //setting start + end dates same time, should return nothing
    p.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1"
            + "&startDate=2012-01-02T00:00:0&endDate=2012-01-01T00:00:00");
    encs = s.getEncountersInPatientList(p);
    assertEquals(encs.size(), 0);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test of getEncountersInPatientList method, of class
   * PatientListServiceImpl.
   */
  @Test
  public void testGetEncountersInPatientListShouldNotReturnEncountersWithInvalidDates() {
    PatientList p = new PatientList();
    p.setCreator(new User());
    p.setName("GetPatientsTestList");
    //setting start + end dates same time, should return nothing
    p.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383cce1"
            + "&startDate=2012-01-02T00:00:0&endDate=2012-01-01T00:00:00");
    List<Encounter> encs = s.getEncountersInPatientList(p);
    assertEquals(encs.size(), 0);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test notInList according to Encounters of getEncountersInPatientList method, of class
   * PatientListServiceImpl.
   */
  @Test
  public void testGetEncountersInPatientListShouldNotReturnEncountersAccordingToNotInList() {
    PatientList mainList = new PatientList();
    PatientList notInList1 = new PatientList();
    PatientList notInList2 = new PatientList();
    mainList.setName("GetPatientsTestList");
    notInList1.setName("TestPatientsNotInList");
    notInList2.setName("TestPatientsNotInList2");
    notInList1.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383ctyy"
            + "&startDate=2000-01-01T00:00:00&endDate=2004-08-16T00:00:00");
    notInList2.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383ctyy"
            + "&startDate=2004-08-16T00:00:00&endDate=2009-01-02T00:00:00");
    s.savePatientList(notInList1);
    s.savePatientList(notInList2);
    mainList.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383ctyr"
            + "&startDate=2000-01-01T00:00:00&endDate=2009-01-02T00:00:00&notInList=" + notInList1.getUuid() + ","
            + notInList2.getUuid());
    List<Encounter> encs = s.getEncountersInPatientList(mainList);
    //now checking that notInList works
    assertEquals(encs.size(), 1);
    //assertEquals(s.getPatientsInPatientList(mainList).get(0).getUuid())
    System.out.println(s.getPatientsInPatientList(mainList).get(0).getUuid());
View Full Code Here

Examples of org.raxa.module.raxacore.PatientList

   * Test notInList according to Patient of getEncountersInPatientList method, of class
   * PatientListServiceImpl.
   */
  @Test
  public void testGetEncountersInPatientListShouldNotReturnPatientsAccordingToNotInList() {
    PatientList mainList = new PatientList();
    PatientList notInList1 = new PatientList();
    mainList.setName("GetPatientsTestList");
    notInList1.setName("TestPatientsNotInList");
    notInList1.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383ctyy"
            + "&startDate=2000-01-01T00:00:00&endDate=2012-01-02T00:00:00");
    s.savePatientList(notInList1);
    mainList.setSearchQuery("?encounterType=61ae96f4-6afe-4351-b6f8-cd4fc383ctyr"
            + "&startDate=2000-01-01T00:00:00&endDate=2012-01-02T00:00:00&notInList=" + notInList1.getUuid());
    List<Encounter> encs = s.getEncountersInPatientList(mainList);
    //now checking that notInList works
    assertEquals(encs.size(), 2);
  }
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.