public void testIsSurveyCompleted() throws iTrustException {
    List<OfficeVisitBean> ovbList = action.getAllOfficeVisits();

    OfficeVisitBean ovBean = ovbList.get(0);

    assertFalse(action.isSurveyCompleted(ovBean.getID()));
  }
  /**
   * Test patient office visit
   *
   * @throws iTrustException
   */
  public void testGetOfficeVisit() throws iTrustException {
    OfficeVisitBean ovb = action.getOfficeVisit();
    assertEquals(1l, action.getOvID());
    assertEquals("Generated for Death for Patient: 1", ovb.getNotes());
    assertEquals(9000000000l, ovb.getHcpID());
    assertEquals(1l, ovb.getID());
    assertEquals(1, ovb.getVisitID());
    /*assertEquals(0, ovb.getDiagnoses().size());*/
    assertEquals("1", ovb.getHospitalID());

    assertEquals(0, action.prescriptions().getPrescriptions().size());
  }
  /**
   * Test patient office visit
   *
   * @throws ITrustException
   */
  public void testGetOfficeVisit() throws ITrustException {
    OfficeVisitBean ovb = action.getOfficeVisit();
    assertEquals(1L, action.getOvID());
    assertEquals("Generated for Death for Patient: 1", ovb.getNotes());
    assertEquals(9000000000L, ovb.getHcpID());
    assertEquals(1L, ovb.getID());
    assertEquals(1, ovb.getVisitID());
    assertEquals("1", ovb.getHospitalID());

    assertEquals(0, action.prescriptions().getPrescriptions().size());

    // UC60
    OfficeVisitBean ovb60 = actionUC60.getOfficeVisit();
    assertEquals("Sean needs to lower his sodium intake.", ovb60.getNotes());
  }
Exemplo n.º 4
0
 /**
  * Updates the information in a particular office visit.
  *
  * @param ov The Office Visit bean representing the changes.
  * @throws DBException
  */
 public void update(OfficeVisitBean ov) throws DBException {
   Connection conn = null;
   PreparedStatement ps = null;
   try {
     conn = factory.getConnection();
     ps =
         conn.prepareStatement(
             "UPDATE OfficeVisits SET VisitDate=?, Notes=?, HCPID=?, "
                 + "PatientID=?, HospitalID=? WHERE ID=?");
     setValues(ps, ov);
     ps.setLong(6, ov.getID());
     ps.executeUpdate();
   } catch (SQLException e) {
     e.printStackTrace();
     throw new DBException(e);
   } finally {
     DBUtil.closeConnection(conn, ps);
   }
 }