Пример #1
0
 /**
  * Checks to see if the family member is dead and returns their cause of death if so
  *
  * @param member the family member to check
  * @return the cause of death if there is one; otherwise null
  * @throws ITrustException
  */
 public String getFamilyMemberCOD(FamilyMemberBean member) throws ITrustException {
   PatientBean patient = patientDAO.getPatient(member.getMid());
   if (patient.getCauseOfDeath() == null) return "";
   DiagnosisBean diag = icdDAO.getICDCode(patient.getCauseOfDeath());
   if (diag == null) return "";
   return diag.getDescription();
 }
Пример #2
0
 /**
  * Checks to see if a particular family member has heart disease
  *
  * @param member the family member to check
  * @return true if the family member has heart disease. False if there are no records or the
  *     family member does not
  * @throws ITrustException
  */
 public boolean doesFamilyMemberHaveHeartDisease(FamilyMemberBean member) throws ITrustException {
   List<DiagnosisBean> diagnoses = patientDAO.getDiagnoses(member.getMid());
   if (diagnoses.size() == 0) return false;
   for (DiagnosisBean diag : diagnoses) {
     if (diag.getICDCode().startsWith("402")) return true;
   }
   return false;
 }
Пример #3
0
  /**
   * Gets all office visits corresponding to a particular ICD diagnosis.
   *
   * @param icdcode A string represnting the ICD diagnosis to look up.
   * @return A java.util.List of Office visits.
   * @throws DBException
   */
  public List<OfficeVisitBean> getAllOfficeVisitsForDiagnosis(String icdcode) throws DBException {

    List<DiagnosisBean> diags = null;
    List<OfficeVisitBean> ovs = new ArrayList<OfficeVisitBean>();
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
      if (icdcode == null) throw new SQLException("icdcode cannot be null");

      conn = factory.getConnection();

      ps =
          conn.prepareStatement(
              "SELECT * FROM ovdiagnosis ovd, icdcodes icd WHERE ovd.ICDCode=? and icd.Code=?");
      ps.setString(1, icdcode);
      ps.setString(2, icdcode);
      rs = ps.executeQuery();
      diags = diagnosisLoader.loadList(rs);
      rs.close();
      ps.close();
      ps = null;
      rs = null;

      for (DiagnosisBean bean : diags) {
        ps = conn.prepareStatement("SELECT * FROM officevisits ov WHERE ov.ID=?");
        ps.setInt(1, (int) bean.getVisitID());
        rs = ps.executeQuery();

        if (rs.next()) {
          ovs.add(loadFullOfficeVist(rs, bean.getVisitID()));
        }
        rs.close();
        ps.close();
      }

      return ovs;

    } catch (SQLException e) {
      e.printStackTrace();
      throw new DBException(e);
    } finally {
      DBUtil.closeConnection(conn, ps);
    }
  }