Exemplo 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());
  }
 public void testUpdateRights() throws Exception {
   long id = lpDAO.addLabProcedure(l);
   LabProcedureBean procedures = lpDAO.getLabProcedure(id);
   assertEquals(1L, procedures.getPid());
   l.allow();
   l.setProcedureID(id);
   lpDAO.updateRights(l);
   LabProcedureBean updprocedures = lpDAO.getLabProcedure(id);
   assertEquals(LabProcedureBean.Allow, updprocedures.getRights());
 }
Exemplo n.º 3
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"));
  }
Exemplo n.º 4
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));
  }
Exemplo n.º 5
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());
  }
Exemplo 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());
  }
Exemplo n.º 7
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());
  }