Esempio n. 1
0
  public void testViewTestingProcedures() throws Exception {
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusTesting();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    LabProcedureBean procedures = lpDAO.getLabProcedure(id);

    List<LabProcedureBean> beans = action.viewTestingProcedures(5000000005L);
    assertEquals(1, beans.size());
    LabProcedureBean lpBean = beans.get(0);

    assertEquals(procedures.getLoinc(), lpBean.getLoinc());
    assertEquals(procedures.getOvID(), lpBean.getOvID());
    assertEquals(procedures.getLoinc(), lpBean.getLoinc());
    assertEquals("Testing", lpBean.getStatus());
    assertEquals(procedures.getProcedureID(), lpBean.getProcedureID());
  }
Esempio n. 2
0
  /**
   * testSubmitResultsEvilFactory
   *
   * @throws Exception
   */
  public void testSubmitResultsEvilFactory() throws Exception {
    action = new LabProcLTAction(new EvilDAOFactory());
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusReceived();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    assertFalse(action.submitResults("" + id, "12", "grams", "13", "14"));
  }
Esempio n. 3
0
  public void testGetHCPName() throws Exception {
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusTesting();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    lpDAO.getLabProcedure(id);

    assertEquals("Kelly Doctor", action.getHCPName(902L));
  }
Esempio n. 4
0
  /**
   * testSetToTesting
   *
   * @throws Exception
   */
  public void testSetToTesting() throws Exception {
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusReceived();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    assertTrue(action.setToTesting(id));

    LabProcedureBean procedures = lpDAO.getLabProcedure(id);

    assertEquals("Testing", procedures.getStatus());
  }
Esempio n. 5
0
  /**
   * testSubmiteResults
   *
   * @throws Exception
   */
  public void testSubmitResults() throws Exception {
    LabProcedureBean lp = new LabProcedureBean();
    lp.setLoinc("10763-1");
    lp.setCommentary("");
    lp.setOvID(902L);
    lp.setPid(2L);
    lp.setResults("");
    lp.allow();
    lp.statusReceived();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    assertTrue(action.submitResults("" + id, "12", "grams", "13", "14"));

    LabProcedureBean procedures = lpDAO.getLabProcedure(id);

    assertEquals("Pending", procedures.getStatus());
    assertEquals("12", procedures.getNumericalResult());
    assertEquals("grams", procedures.getNumericalResultUnit());
    assertEquals("13", procedures.getUpperBound());
    assertEquals("14", procedures.getLowerBound());
  }
Esempio n. 6
0
  /**
   * testGetLabProc
   *
   * @throws Exception
   */
  public void testGetLabProc() throws Exception {
    LabProcedureBean lp = new LabProcedureBean();
    lp.setPid(2L);
    lp.setLoinc("10763-1");
    lp.setCommentary("This is a test");
    lp.setOvID(902L);
    lp.setResults("Test Result");
    lp.allow();
    lp.statusReceived();
    lp.setLTID(5000000005L);
    long id = lpDAO.addLabProcedure(lp);
    lp.setProcedureID(id);

    assertEquals(lp.getCommentary(), action.getLabProcedure(id).getCommentary());
    assertEquals(lp.getPid(), action.getLabProcedure(id).getPid());
    assertEquals(lp.getLoinc(), action.getLabProcedure(id).getLoinc());
    assertEquals(lp.getOvID(), action.getLabProcedure(id).getOvID());
    assertEquals(lp.getResults(), action.getLabProcedure(id).getResults());
    assertEquals(lp.getLTID(), action.getLabProcedure(id).getLTID());
    assertEquals(lp.getStatus(), action.getLabProcedure(id).getStatus());
    assertEquals(lp.getRights(), action.getLabProcedure(id).getRights());
  }
Esempio n. 7
0
  /**
   * testSudmitReceivedWrongIDNubmerFormat
   *
   * @throws DBException
   */
  public void testSubmitReceivedWrongIDNumberFormat() throws DBException {

    boolean successfulSubmit = action.submitReceived("Test");
    assertFalse(successfulSubmit);
  }
Esempio n. 8
0
  /**
   * testSubmiteResultsWronIDNumberFormat
   *
   * @throws FormValidationException
   */
  public void testSubmitResultsWrongIDNumberFormat() throws FormValidationException {

    boolean successfulSubmit = action.submitResults("Test", "99", "99", "100", "0");
    assertFalse(successfulSubmit);
  }