Esempio n. 1
0
  /**
   * Tests adding a lab procedure with no lab tech selected. Verifies that an error message is
   * displayed.
   *
   * @throws Exception
   */
  public void testAddLabProcedureWithoutLabTech() throws Exception {
    gen.clearAllTables();
    gen.standardData();

    WebConversation wc = login("9000000000", "pw");
    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());
    // click Document Office Visit
    wr = wr.getLinkWith("Document Office Visit").click();

    // select the patient
    WebForm form = wr.getForms()[0];
    form.getScriptableObject().setParameterValue("UID_PATIENTID", "2");
    form.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals(ADDRESS + "auth/hcp-uap/documentOfficeVisit.jsp", wr.getURL().toString());
    // Select the office visit from specific date
    wr.getLinkWith("6/10/2007").click();

    wr = wc.getCurrentPage();
    assertEquals("iTrust - Document Office Visit", wr.getTitle());

    form = wr.getFormWithID("labProcedureForm");
    form.setParameter("loinc", "10666-6");
    form.setParameter("labProcPriority", "1");
    form.getButtonWithID("add_labProcedure").click();

    // check updated page
    wr = wc.getCurrentPage();
    assertTrue(
        wr.getText().contains("A lab tech must be selected before adding a laboratory procedure."));
  }
Esempio n. 2
0
  public void testAddLabProcedureWithLabTech() throws Exception {
    gen.clearAllTables();
    gen.standardData();

    WebConversation wc = login("9000000000", "pw");
    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());
    // click Document Office Visit
    wr = wr.getLinkWith("Document Office Visit").click();

    // select the patient
    WebForm form = wr.getForms()[0];
    form.getScriptableObject().setParameterValue("UID_PATIENTID", "2");
    form.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals(ADDRESS + "auth/hcp-uap/documentOfficeVisit.jsp", wr.getURL().toString());
    // Select the office visit from specific date
    wr.getLinkWith("6/10/2007").click();

    wr = wc.getCurrentPage();
    assertEquals("iTrust - Document Office Visit", wr.getTitle());

    form = wr.getFormWithID("labProcedureForm");
    form.setParameter("loinc", "10666-6");
    form.setParameter("labTech", "5000000001");
    form.setParameter("labProcPriority", "1");
    form.getButtonWithID("add_labProcedure").click();

    // check updated page
    wr = wc.getCurrentPage();
    assertTrue(wr.getText().contains("Lab Procedure information successfully updated."));
    assertLogged(TransactionType.LAB_PROCEDURE_ADD, 9000000000L, 2L, "");

    // Get row containing procedure.
    WebTable tbl = wr.getTableWithID("labProceduresTable");
    TableRow[] rows = tbl.getRows();
    int rowi = 0;
    for (; rowi < rows.length; rowi++) {
      if (rows[rowi].getText().startsWith("| 10666-6")) {
        break;
      }
    }
    assertTrue(rowi < rows.length);
    // Verify data in table
    assertEquals("Lab Dude", tbl.getCellAsText(rowi, 1));
    assertEquals("In Transit", tbl.getCellAsText(rowi, 2)); // status
    assertEquals("", tbl.getCellAsText(rowi, 5)); // commentary
    assertEquals("", tbl.getCellAsText(rowi, 6)); // numerical results
    assertEquals("", tbl.getCellAsText(rowi, 7)); // lower bound
    assertEquals("", tbl.getCellAsText(rowi, 8)); // upper bound
    assertTrue(tbl.getCellAsText(rowi, 10).contains("Remove")); // action
    assertTrue(tbl.getCellAsText(rowi, 10).contains("Reassign")); // action
  }
Esempio n. 3
0
  /**
   * testReassignLabProcedure
   *
   * @throws Exception
   */
  public void testReassignLabProcedure() throws Exception {
    gen.clearAllTables();
    gen.standardData();

    WebConversation wc = login("9000000000", "pw");
    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());
    // click Document Office Visit
    wr = wr.getLinkWith("Document Office Visit").click();

    // select the patient
    WebForm form = wr.getForms()[0];
    form.getScriptableObject().setParameterValue("UID_PATIENTID", "2");
    form.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals(ADDRESS + "auth/hcp-uap/documentOfficeVisit.jsp", wr.getURL().toString());
    // Select the office visit from specific date
    wr.getLinkWith("6/10/2007").click();

    wr = wc.getCurrentPage();
    assertEquals("iTrust - Document Office Visit", wr.getTitle());

    // Click the Reassign link.
    WebTable tbl = wr.getTableWithID("labProceduresTable");
    assertEquals("Nice Guy", tbl.getCellAsText(2, 1));
    assertTrue(tbl.getCellAsText(2, 10).contains("Reassign"));
    wr = tbl.getTableCell(2, 10).getLinkWith("Reassign").click();

    wr = wc.getCurrentPage();
    assertEquals("iTrust - Reassign Lab Procedure", wr.getTitle());

    // Change the currently-assigned lab tech
    form = wr.getFormWithID("reassignLabProcedureForm");
    form.setParameter("newLabTech", "5000000001");
    form.setParameter("labProcPriority", "1");
    form.getButtonWithID("setLabTech").click();

    assertLogged(TransactionType.LAB_RESULTS_REASSIGN, 9000000000L, 2L, "");
    wr = wc.getCurrentPage();
    assertEquals("iTrust - Document Office Visit", wr.getTitle());

    // Ensure the lab tech has been changed
    tbl = wr.getTableWithID("labProceduresTable");
    assertEquals("Lab Dude", tbl.getCellAsText(2, 1));
  }
Esempio n. 4
0
  /**
   * testHcpLabProc
   *
   * @throws Exception
   */
  public void testHcpLabProc() throws Exception {
    // login hcp
    WebConversation wc = login("9000000000", "pw");
    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());
    assertLogged(TransactionType.HOME_VIEW, 9000000000L, 0L, "");

    // click on Edit ND Codes
    wr = wr.getLinkWith("Laboratory Procedures").click();
    // choose patient 1
    WebForm patientForm = wr.getForms()[0];
    patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "2");
    patientForm.getButtons()[1].click();
    wr = wc.getCurrentPage();
    // add the codes and description
    assertEquals("iTrust - View Laboratory Procedures", wr.getTitle());
    wr = wr.getLinkWith("Allow/Disallow Viewing").click();
    assertLogged(TransactionType.LAB_RESULTS_VIEW, 9000000000L, 2L, "");
  }
Esempio n. 5
0
  /*
   * HCP 9000000000 has viewed PHR of patient 2.
   * Authenticate Patient
   * MID: 2
   * Password: pw
   * Choose option View Access Log
   */
  public void testViewAccessLog1() throws Exception {
    // clear operational profile
    gen.transactionLog();
    // hcp views phr of patient 2
    // login hcp
    WebConversation wc = login("9000000000", "pw");
    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());
    assertLogged(TransactionType.HOME_VIEW, 9000000000L, 0L, "");

    // click Edit PHR
    wr = wr.getLinkWith("PHR Information").click();
    assertEquals(
        ADDRESS + "auth/getPatientID.jsp?forward=hcp-uap/editPHR.jsp", wr.getURL().toString());
    // choose patient 2
    WebForm patientForm = wr.getForms()[0];
    patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "2");
    patientForm.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals(ADDRESS + "auth/hcp-uap/editPHR.jsp", wr.getURL().toString());
    assertLogged(TransactionType.PATIENT_HEALTH_INFORMATION_VIEW, 9000000000L, 2L, "");

    // login patient 2
    wc = login("2", "pw");
    wr = wc.getCurrentPage();
    assertEquals("iTrust - Patient Home", wr.getTitle());
    assertLogged(TransactionType.HOME_VIEW, 2L, 0L, "");

    // click on View Access Log
    wr = wr.getLinkWith("Access Log").click();
    // check the table that displays the access log

    WebTable table = wr.getTableStartingWithPrefix("Date");

    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    java.util.Date date = new java.util.Date();

    assertTrue(table.getCellAsText(1, 0).contains(dateFormat.format(date)));
    assertEquals("Kelly Doctor", table.getCellAsText(1, 1));
    assertTrue(table.getCellAsText(1, 3).contains("View personal health information"));
    assertLogged(TransactionType.ACCESS_LOG_VIEW, 2L, 0L, "");
  }
Esempio n. 6
0
  /**
   * testLabProcedureInTransitToReceived
   *
   * @throws Exception
   */
  public void testLabProcedureInTransitToReceived() throws Exception {
    gen.clearAllTables();
    gen.standardData();
    WebConversation wc = login("5000000001", "pw");

    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - Lab Tech Home", wr.getTitle());

    wr = wr.getLinkWith("All Lab Procedures").click();
    assertEquals("iTrust - View Laboratory Procedures", wr.getTitle());

    // Ensure the table of received lab procedures has only one entry
    WebTable tbl = wr.getTableWithID("receivedTable");
    assertEquals(3, tbl.getRowCount());
    assertEquals("Beaker Beaker", tbl.getCellAsText(2, 4));

    // Check table of in-transit lab procedures
    tbl = wr.getTableWithID("inTransitTable");
    assertEquals(20, tbl.getRowCount());
    String labProcID = tbl.getCellAsText(2, 0); // lab proc id is auto-assigned
    // Click "Set to Received" on Lab Procedure
    WebForm form = wr.getFormWithID("inTransitForm");
    Button receivedButton = form.getButtons()[0];
    assertEquals("Set to Received", receivedButton.getText());
    receivedButton.click();

    wr = wc.getCurrentPage();
    assertEquals("iTrust - View Laboratory Procedures", wr.getTitle());

    // Ensure the table of received lab procedures contains the modified lab procedure.
    tbl = wr.getTableWithID("receivedTable");
    assertEquals(4, tbl.getRowCount());
    // assertFalse(tbl.getCellAsText(2, 0).contains("There are no received lab procedures"));
    assertEquals(labProcID, tbl.getCellAsText(2, 0)); // check that the lab proc is now here

    // Check that table of in-transit lab procedures has no lab procedures
    tbl = wr.getTableWithID("inTransitTable");
    assertEquals(19, tbl.getRowCount());
    // assertTrue(tbl.getCellAsText(2, 0).contains("There are no lab procedures in transit"));  //
    // lab procedure ID
  }
Esempio n. 7
0
  /**
   * Verifies that DLHCP information is correctly hidden in the Access Log for a non-representative.
   *
   * @throws Exception
   */
  public void testViewAccessLogNonRepresentativeView2() throws Exception {
    gen.clearAllTables();
    gen.standardData();

    WebConversation wc = login("9000000007", "pw");
    WebResponse wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());

    wr = wr.getLinkWith("Patient Information").click();
    assertEquals("iTrust - Please Select a Patient", wr.getTitle());

    WebForm patientForm = wr.getForms()[0];
    patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "5");
    patientForm.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals("iTrust - Edit Patient", wr.getTitle());

    wr = wr.getLinkWith("Basic Health Information").click();
    assertEquals("iTrust - Edit Basic Health Record", wr.getTitle());

    wr = wr.getLinkWith("Logout").click();
    assertEquals("iTrust - Login", wr.getTitle());

    wc = login("9000000000", "pw");
    wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());

    wr = wr.getLinkWith("Patient Information").click();
    assertEquals("iTrust - Please Select a Patient", wr.getTitle());

    patientForm = wr.getForms()[0];
    patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "5");
    patientForm.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals("iTrust - Edit Patient", wr.getTitle());

    wr = wr.getLinkWith("PHR Information").click();
    assertEquals("iTrust - Edit Personal Health Record", wr.getTitle());

    wr = wr.getLinkWith("Logout").click();
    assertEquals("iTrust - Login", wr.getTitle());

    wc = login("9000000000", "pw");
    wr = wc.getCurrentPage();
    assertEquals("iTrust - HCP Home", wr.getTitle());

    wr = wr.getLinkWith("Patient Information").click();
    assertEquals("iTrust - Please Select a Patient", wr.getTitle());

    patientForm = wr.getForms()[0];
    patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "5");
    patientForm.getButtons()[1].click();
    wr = wc.getCurrentPage();
    assertEquals("iTrust - Edit Patient", wr.getTitle());

    wr = wr.getLinkWith("Basic Health Information").click();
    assertEquals("iTrust - Edit Basic Health Record", wr.getTitle());

    wr = wr.getLinkWith("Patient Information").click();
    assertEquals("iTrust - Edit Patient", wr.getTitle());

    wr = wr.getLinkWith("PHR Information").click();
    assertEquals("iTrust - Edit Personal Health Record", wr.getTitle());

    wr = wr.getLinkWith("Logout").click();
    assertEquals("iTrust - Login", wr.getTitle());

    wc = login("5", "pw");
    wr = wc.getCurrentPage();
    assertEquals("iTrust - Patient Home", wr.getTitle());

    wr = wr.getLinkWith("Access Log").click();
    assertEquals("iTrust - View My Access Log", wr.getTitle());

    assertFalse(wr.getText().contains("Kelly Doctor"));
    assertTrue(wr.getText().contains("Beaker Beaker"));
  }