예제 #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 smokes
  *
  * @param member the family member to check
  * @return true if the family member smokes. False if there are no records or the family member
  *     does not
  * @throws ITrustException
  */
 public boolean isFamilyMemberSmoker(FamilyMemberBean member) throws ITrustException {
   List<HealthRecord> records = hrDAO.getAllHealthRecords(member.getMid());
   if (records.size() == 0) return false;
   for (HealthRecord record : records) {
     if (record.isSmoker()) return true;
   }
   return false;
 }
예제 #3
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;
 }
예제 #4
0
 /**
  * Checks to see if a particular family member has high cholesterol
  *
  * @param member the family member to check
  * @return true if the family member has high cholesterol. False if there are no records or the
  *     family member does not
  * @throws ITrustException
  */
 public boolean doesFamilyMemberHaveHighCholesterol(FamilyMemberBean member)
     throws ITrustException {
   List<HealthRecord> records = hrDAO.getAllHealthRecords(member.getMid());
   if (records.size() == 0) return false;
   for (HealthRecord record : records) {
     if (record.getCholesterolHDL() < 35 || record.getCholesterolLDL() > 250) return true;
   }
   return false;
 }
예제 #5
0
 /**
  * Checks to see if a particular family member has high blood pressure
  *
  * @param member the family member to check
  * @return true if the family member has high blood pressure. False if there are no records or the
  *     family member does not have high blood pressure
  * @throws ITrustException
  */
 public boolean doesFamilyMemberHaveHighBP(FamilyMemberBean member) throws ITrustException {
   List<HealthRecord> records = hrDAO.getAllHealthRecords(member.getMid());
   if (records.size() == 0) return false;
   for (HealthRecord record : records) {
     if (record.getBloodPressureSystolic() > 240 || record.getBloodPressureDiastolic() > 120)
       return true;
   }
   return false;
 }
예제 #6
0
  /**
   * Returns a list of FamilyMemberBeans for the patient
   *
   * @return list of FamilyMemberBeans
   * @throws ITrustException
   */
  public List<FamilyMemberBean> getFamily() throws ITrustException {
    List<FamilyMemberBean> fam = new ArrayList<FamilyMemberBean>();
    List<FamilyMemberBean> parents = null;
    parents = familyDAO.getParents(pid);
    fam.addAll(parents);
    fam.addAll(familyDAO.getSiblings(pid));
    fam.addAll(familyDAO.getChildren(pid));

    if (parents != null) {
      List<FamilyMemberBean> grandparents = new ArrayList<FamilyMemberBean>();
      for (FamilyMemberBean parent : parents) {
        grandparents.addAll(familyDAO.getParents(parent.getMid()));
      }

      fam.addAll(grandparents);

      for (FamilyMemberBean gp : grandparents) {
        gp.setRelation("Grandparent");
      }
    }
    return fam;
  }