private PatientAssessmentAnswerVoCollection getPatientAnswers(DynamicGridRow gridRow) { PatientAssessmentAnswerVoCollection patientAssAnswerColl = new PatientAssessmentAnswerVoCollection(); AnswerDetailsVoCollection answerDetails = new AnswerDetailsVoCollection(); PatientAssessmentAnswerVo voPatientAssessmentAnswer = new PatientAssessmentAnswerVo(); for (int x = 0; x < form.lyrDetails().tabClinicalDetails().dyngrdQuestions().getColumns().size(); x++) { DynamicGridCell cell = gridRow.getCells().get(form.lyrDetails().tabClinicalDetails().dyngrdQuestions().getColumns().get(x)); if (cell != null && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof QuestionAnswerTypeVo || cell.getIdentifier() instanceof AnswerCellData)) { answerDetails.add(getCellAnswer(cell)); } } voPatientAssessmentAnswer.setAnswerDetails(answerDetails); patientAssAnswerColl.add(voPatientAssessmentAnswer); return patientAssAnswerColl; }
private PatientAssessmentAnswerVoCollection getPatientAnswers(DynamicGridRow gridRow) { PatientAssessmentAnswerVoCollection patientAssAnswerColl = new PatientAssessmentAnswerVoCollection(); AnswerDetailsVoCollection answerDetails = new AnswerDetailsVoCollection(); PatientAssessmentAnswerVo voPatientAssessmentAnswer = new PatientAssessmentAnswerVo(); for (int x = 0; x < this.gridQuestions.getColumns().size(); x++) { DynamicGridCell cell = gridRow.getCells().get(this.gridQuestions.getColumns().get(x)); // we save the separators as well // if(cell != null && // !cell.getType().equals(DynamicCellType.DYNAMICLABEL) && // !cell.getType().equals(DynamicCellType.EMPTY) && // cell.getIdentifier() != null && cell.getIdentifier() instanceof // QuestionAnswerTypeVo) if (cell != null && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof QuestionAnswerTypeVo || cell.getIdentifier() instanceof AnswerCellData)) { answerDetails.add(getCellAnswer(cell)); } } voPatientAssessmentAnswer.setAnswerDetails(answerDetails); patientAssAnswerColl.add(voPatientAssessmentAnswer); return patientAssAnswerColl; }
public String getDPPQuestionAndAnswers(PatientAssessmentQuestionVo question, int index) { if (question == null) return null; StringBuffer sb = new StringBuffer(); if (index != -1) { sb.append(index); sb.append(". "); } if (question.getAssessmentQuestion().getQuestionIsNotNull()) { sb.append(question.getAssessmentQuestion().getQuestion().getShortText()); } for (int i = 0; i < question.getPatientAnswers().size(); i++) { PatientAssessmentAnswerVo vo = question.getPatientAnswers().get(i); AnswerDetailsVoCollection answerColl = vo.getAnswerDetails(); if (answerColl != null) { for (int j = 0; j < answerColl.size(); j++) { AnswerDetailsVo ans = answerColl.get(j); QuestionAnswerTypeVo ansType = ans.getAnswerType(); if (ansType == null || ansType.getAnswerType() == null) continue; if (ansType.getAnswerType().equals(QuestionAnswerType.DATE)) sb.append(ans.getDateAnswer()); else if (ansType.getAnswerType().equals(QuestionAnswerType.DECIMAL)) sb.append(ans.getDecimalAnswer()); else if (ansType.getAnswerType().equals(QuestionAnswerType.INTEGER)) sb.append(ans.getIntegerAnswer()); else if (ansType.getAnswerType().equals(QuestionAnswerType.MULTISELECT)) { for (int k = 0; k < ans.getMultiSelectAnswers().size(); k++) { if (i == 0 && j == 0 && k == 0) sb.append(" - "); AnswerOptionVo multi = ans.getMultiSelectAnswers().get(k); sb.append(multi.getOptionText()); if (j < (answerColl.size() - 1)) sb.append(", "); } } else if (ansType.getAnswerType().equals(QuestionAnswerType.PARTIALDATE)) sb.append(ans.getPartialDate()); else if (ansType.getAnswerType().equals(QuestionAnswerType.PICKLIST)) { if (ans.getPicklistIsNotNull()) sb.append(ans.getPicklist().getOptionText()); } else if (ansType.getAnswerType().equals(QuestionAnswerType.TEXT)) sb.append(ans.getStringAnswer()); else if (ansType.getAnswerType().equals(QuestionAnswerType.TIME)) sb.append(ans.getTimeAnswer()); else if (ansType.getAnswerType().equals(QuestionAnswerType.YESNO)) if (!ans.getBoolValueAnswerIsNotNull()) sb.append("Not Specified"); else if (ans.getBoolValueAnswer().booleanValue() == true) sb.append("Yes"); else sb.append("No"); } sb.append("\r"); } } return sb.toString(); }