Пример #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());
  }
 @Override
 protected void setUp() throws Exception {
   gen = new TestDataGenerator();
   gen.labProcedures();
   l = new LabProcedureBean();
   l.setPid(1L);
   l.setOvID(905L);
   l.setLoinc("10763-8");
   l.statusPending();
   l.setCommentary("Awaiting results");
   l.setResults("");
   l.restrict();
 }
Пример #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"));
  }
Пример #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));
  }
Пример #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());
  }
Пример #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());
  }
Пример #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());
  }