private PatientAssessmentAnswerVoCollection getPatientAnswers(GeneralQuestionAnswerVoCollection categoryQA, QuestionInformationShortVo question) { if (categoryQA == null || categoryQA.size() == 0) return null; if (question == null) return null; for (GeneralQuestionAnswerVo answer : categoryQA) { if (question.equals(answer.getQuestion())) return answer.getPatientAnswers(); } return null; }
private PatientAssessmentAnswerVoCollection getPatientAnswers(InvestigationQuestionAnswerVoCollection questions, QuestionInformationShortVo question) { if (questions == null || questions.size() == 0) return null; if (question == null) return null; for (InvestigationQuestionAnswerVo investigationQuestion : questions) { if (investigationQuestion.getInvestigationQuestionAnswersIsNotNull()) { for (GeneralQuestionAnswerVo answer : investigationQuestion.getInvestigationQuestionAnswers()) { if (question.equals(answer.getQuestion())) return answer.getPatientAnswers(); } } } return null; }
private boolean itemIdIsInRefusedList(GeneralQuestionAnswerVo generalQuestionAnswerVo) { if(generalQuestionAnswerVo == null || generalQuestionAnswerVo.getItemId() == null) return false; InvestigationRefVoCollection refusedInv = form.getGlobalContext().OCRR.getRefusedInvestigation(); if(refusedInv == null || refusedInv.size() == 0) return false; for(InvestigationRefVo inv : refusedInv) { if(inv == null) continue; if(inv.getID_Investigation().equals(generalQuestionAnswerVo.getItemId()) || inv.getID_Investigation().equals(generalQuestionAnswerVo.getParentid())) return true; } return false; }
private DynamicGridRow createOrFindInvestigationRow(GeneralQuestionAnswerVo generalQuestionAnswerVo) { if(generalQuestionAnswerVo == null) return null; DynamicGridRow row = null; for(int i=0; i<gridQuestions.getRows().size(); i++) { row = gridQuestions.getRows().get(i); if(row != null && row.getValue() != null && row.getValue().equals(generalQuestionAnswerVo.getItemId())) return row; } row = gridQuestions.getRows().newRow(); row.setSelectable(false); DynamicGridCell cell = row.getCells().newCell(columnName, DynamicCellType.LABEL); row.setBackColor(Color.Beige); cell.setValue("Investigation " + this.questionOrInformation + " : " + generalQuestionAnswerVo.getItemName()); row.setExpanded(true); row.setValue(generalQuestionAnswerVo.getItemId()); return row; }
private boolean isClinicalQuestionAlreadyAdded(GeneralQuestionAnswerVo generalQuestionAnswerVo, CategoryQuestionAnswerVoCollection categoryQuestionAnswerVoCollection) { if(categoryQuestionAnswerVoCollection != null) { for(CategoryQuestionAnswerVo voCatQuestionAnswer : categoryQuestionAnswerVoCollection) { if(voCatQuestionAnswer.getCategoryQuestionAnswersIsNotNull()) { for(GeneralQuestionAnswerVo voGenQuestAns : voCatQuestionAnswer.getCategoryQuestionAnswers()) { if(voGenQuestAns.getQuestion().equals(generalQuestionAnswerVo.getQuestion())) return true; } } } } return false; }
private ServiceQuestionAnswerVo createDummyServiceQuaetionAnswerVo(InvestigationOcsQuestionsVo voInvOcs) { ServiceQuestionAnswerVo voServiceQuestionAnswer = new ServiceQuestionAnswerVo(); voServiceQuestionAnswer.setService(new ServiceLiteVo()); voServiceQuestionAnswer.getService().setServiceName("No Service"); voServiceQuestionAnswer.getService().setServiceCategory(ServiceCategory.CLINICAL); voServiceQuestionAnswer.setInvestigationQuestionAnswers(new InvestigationQuestionAnswerVoCollection()); voServiceQuestionAnswer.getInvestigationQuestionAnswers().add(new InvestigationQuestionAnswerVo()); voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigationQuestionAnswers(new GeneralQuestionAnswerVoCollection()); voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigation(voInvOcs); GeneralQuestionAnswerVoCollection voGQAColl = getInvestigationQuestions(voInvOcs); for( GeneralQuestionAnswerVo voItem : voGQAColl) voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).getInvestigationQuestionAnswers().add(voItem); return voServiceQuestionAnswer; }
private GeneralQuestionAnswerVoCollection getServiceQuestions(ServiceQuestionShortVoCollection serviceConfigQuestions, ServiceLiteVo voServiceLite) { GeneralQuestionAnswerVoCollection serviceQuestions = new GeneralQuestionAnswerVoCollection(); for (int i = 0; serviceConfigQuestions != null && i < serviceConfigQuestions.size(); i++) { ServiceQuestionShortVo serviceQuestionShortVo = serviceConfigQuestions.get(i); boolean askedForEveryInvestigation = serviceQuestionShortVo.getAskForInvestigationsIsNotNull() && serviceQuestionShortVo.getAskForInvestigations().booleanValue(); if(askedForEveryInvestigation == false && serviceQuestionShortVo.getService().equals(voServiceLite)) { GeneralQuestionAnswerVo voGQA = createNewServiceQuestion(serviceQuestionShortVo); if(voGQA != null) serviceQuestions.add(voGQA); } } return serviceQuestions; }
private GeneralQuestionAnswerVoCollection getInvestigationQuestions(InvestigationOcsQuestionsVo voInvOcs) { if(voInvOcs == null) return null; GeneralQuestionAnswerVoCollection invQuestions = new GeneralQuestionAnswerVoCollection(); for (int i = 0; i < voInvOcs.getAssocQuestions().size(); i++) { InvestigationQuestionShortVo voInvestigationQuestion = voInvOcs.getAssocQuestions().get(i); if(isQuestionRelevant(voInvestigationQuestion.getQuestion(), getAge(), getSex())) { GeneralQuestionAnswerVo voGeneralQuestionAnswer = new GeneralQuestionAnswerVo(); voGeneralQuestionAnswer.setQuestion(voInvestigationQuestion.getQuestion()); voGeneralQuestionAnswer.setWasMandatory(voInvestigationQuestion.getIsMandatory()); invQuestions.add(voGeneralQuestionAnswer); } } return invQuestions; }
private GeneralQuestionAnswerVo getQuestionAnswer(DynamicGridRow gridRow) { if(gridRow == null) return null; if(gridRow.getIdentifier() instanceof GeneralQuestionAnswerVo) { GeneralQuestionAnswerVo vo = new GeneralQuestionAnswerVo(); vo.setQuestion(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getQuestion()); vo.setWasMandatory(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getWasMandatory()); vo.setPatientAnswers(getPatientAnswers(gridRow)); return vo; } return null; }
private void addAnswers(DynamicGridRow row, GeneralQuestionAnswerVo vo) throws PresentationLogicException { if(vo == null || vo.getQuestion() == null) return; if(vo.getQuestion().getAnswerTypesIsNotNull()) { for(int x = 0; x < vo.getQuestion().getAnswerTypes().size(); x++) { if(vo.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() && vo.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue()) { boolean readOnlyCell = false; addAnswerCell(row, getAnswerColumn(x), vo.getQuestion().getAnswerTypes().get(x), getInstAnswerType(vo.getPatientAnswers(), vo.getQuestion().getAnswerTypes().get(x)), readOnlyCell); } } } }
private void addAnswerData(DynamicGridRow row, GeneralQuestionAnswerVo voQuestionAnswer) { if(voQuestionAnswer.getPatientAnswers() == null) return; for(int x = 0; x < voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().size(); x++) { AnswerDetailsVo answer = voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().get(x); DynamicGridCell cell = findCell(row, answer.getAnswerType()); if(cell != null) { setCellAnswer(cell, answer); } } }
private boolean hasMandatoryAnswers(GeneralQuestionAnswerVo voGQA) { if(voGQA == null) return false; for (int j = 0; j < voGQA.getPatientAnswers().size(); j++) { PatientAssessmentAnswerVo voPAA = voGQA.getPatientAnswers().get(j); for (int k = 0; k < voPAA.getAnswerDetails().size(); k++) { if (voPAA.getAnswerDetails().get(k).getAnswerType().getIsMandatoryIsNotNull() && voPAA.getAnswerDetails().get(k).getAnswerType().getIsMandatory().booleanValue()) { return true; } } } return false; }