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
 /**
  * Updates a lab procedure
  *
  * @param b the procedure to update
  * @throws DBException
  * @throws FormValidationException
  */
 public void updateProcedure(LabProcedureBean b) throws DBException, FormValidationException {
   validator.validate(b);
   // need to check if status is what's being changed - if new status!=old status send email
   if (!b.getStatus().equals(lpDAO.getLabProcedure(b.getProcedureID()).getStatus())) {
     new EmailUtil(factory).sendEmail(makeEmail(b));
   }
   lpDAO.updateLabProcedure(b);
   transDAO.logTransaction(
       TransactionType.ENTER_EDIT_LAB_PROCEDURE,
       loggedInMID,
       b.getPid(),
       "UAP updated procedure id: " + b.getProcedureID());
 }
Esempio n. 3
0
 /**
  * Updates the rights of a user on a given lab procedure.
  *
  * @param b The LabProcedureBean in question.
  * @throws DBException
  */
 public void updateRights(LabProcedureBean b) throws DBException {
   Connection conn = null;
   PreparedStatement ps = null;
   try {
     if (b.getPid() == 0L) throw new SQLException("PatientMID cannot be null");
     conn = factory.getConnection();
     ps =
         conn.prepareStatement(
             "UPDATE LabProcedure SET Rights = ?, UpdatedDate = ? WHERE LaboratoryProcedureID=?");
     ps.setString(1, b.getRights());
     ps.setTimestamp(2, new java.sql.Timestamp(System.currentTimeMillis()));
     ps.setLong(3, b.getProcedureID());
     ps.executeUpdate();
   } catch (SQLException e) {
     e.printStackTrace();
     throw new DBException(e);
   } finally {
     DBUtil.closeConnection(conn, ps);
   }
 }