Esempio n. 1
0
  private OfficeVisitBean loadFullOfficeVist(ResultSet rs, long visitID)
      throws SQLException, DBException {
    OfficeVisitBean ov = new OfficeVisitBean(visitID);
    ov.setVisitDateStr(
        new SimpleDateFormat("MM/dd/yyyy").format(new Date(rs.getDate("VisitDate").getTime())));
    ov.setHcpID(rs.getLong("HCPID"));
    ov.setNotes(rs.getString("notes"));
    ov.setPatientID(rs.getLong("PatientID"));
    ov.setHospitalID(rs.getString("HospitalID"));
    ov.setDiagnoses(getDiagnoses(visitID));
    ov.setPrescriptions(getPrescriptions(visitID));
    ov.setProcedures(getProcedures(visitID));

    return ov;
  }
Esempio n. 2
0
 public void testUpdateNewOfficeVisit() {
   try {
     OfficeVisitBean ov = new OfficeVisitBean();
     long newOVID = ovDAO.add(ov);
     ov = new OfficeVisitBean(newOVID);
     ov.setNotes("some notes");
     ov.setVisitDateStr("07/07/2007");
     ov.setPatientID(65);
     ov.setHcpID(5);
     ov.setHospitalID("9191919191");
     ovDAO.update(ov);
     ov = ovDAO.getOfficeVisit(newOVID);
     assertEquals("some notes", ov.getNotes());
     assertEquals("07/07/2007", new SimpleDateFormat("MM/dd/yyyy").format(ov.getVisitDate()));
     assertEquals(65, ov.getPatientID());
     assertEquals(5, ov.getHcpID());
     assertEquals("9191919191", ov.getHospitalID());
   } catch (Exception e) {
     e.printStackTrace();
   }
 }