private String calculateScore(WaterlowAssessmentDetailsVoCollection assessmentDetails, RiskAssessmentCollection risks) { int score = 0; for (int i = 0 ; i < risks.size() ; i++) { if (!risks.get(i).getRiskFactorsIsNotNull()) continue; for (int x = 0 ; x < risks.get(i).getRiskFactors().size() ; x++) { for (int j = 0 ; j < assessmentDetails.size() ; j++) { if (assessmentDetails.get(j).getSelectIsNotNull() && assessmentDetails.get(j).getSelect() && risks.get(i).getRiskFactors().get(x).getId().equals(String.valueOf(assessmentDetails.get(j).getAssessment()))) { score+=Integer.valueOf(risks.get(i).getRiskFactors().get(x).getScore()); } } } } return String.valueOf(score); }
private int getAssessmentScore(WaterlowAssessmentDetailsVoCollection coll) { int nScore = 0; RiskAssessment risk = null; RiskDescription descr = null; int partScore; for (int i = 0; i < coll.size(); i++) { WaterlowAssessmentDetailsVo child = coll.get(i); risk = null; partScore = 0; for(int k = 0; k < form.getGlobalContext().Nursing.getWaterlowAssessments().size(); k++) { risk = form.getGlobalContext().Nursing.getWaterlowAssessments().get(k); for(int m = 0; m < risk.getRiskFactors().size(); m++) { descr = risk.getRiskFactors().get(m); if(child.getAssessment().toString().equals(descr.getId()) && Boolean.TRUE.equals(child.getSelect())) { partScore += Integer.valueOf(descr.getScore()).intValue(); } } } nScore += partScore; } return nScore; }
private String getScoreByAssessmentName(String colWater, WaterlowAssessmentDetailsVoCollection assessmentDetails) { String nScore = ""; RiskAssessment risk; RiskDescription descr; for(int i = 0; i < form.getGlobalContext().Nursing.getWaterlowAssessments().size(); i++) { risk = form.getGlobalContext().Nursing.getWaterlowAssessments().get(i); if(risk.getName().equalsIgnoreCase(colWater)) { for(int j = 0; j < risk.getRiskFactors().size(); j++) { descr = risk.getRiskFactors().get(j); for(int k = 0; k < assessmentDetails.size(); k++) { if(assessmentDetails.get(k).getAssessment().toString().equals(descr.getId()) && assessmentDetails.get(k).getSelect().equals(Boolean.TRUE)) { if (nScore.equals(""))//WDEV-15129 { nScore = descr.getScore(); } else { Integer intScore = Integer.valueOf(nScore).intValue(); intScore += Integer.valueOf(descr.getScore()).intValue(); nScore = intScore.toString(); } } } } break; } } return nScore; }