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; }
public InvestigationQuestionShortVoCollection listInformatonMessagesForOrderSet(OrderSetRefVo orderSet) { if(orderSet == null) throw new CodingRuntimeException("orderSet is null in method listInformatonMessagesForOrderSet."); DomainFactory factory = getDomainFactory(); OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet); if(doOrderSet == null || doOrderSet.getComponent() == null) return null; Iterator it = doOrderSet.getComponent().iterator(); InvestigationQuestionShortVoCollection list = new InvestigationQuestionShortVoCollection(); while(it.hasNext()) { Object comp = it.next(); if(!(comp instanceof OrderSetComponent)) continue; Investigation doInv = ((OrderSetComponent) comp).getInvestigation(); InvestigationQuestionShortVoCollection infoMessages = listInfoMessages(doInv, null);//WDEV-16762 if(infoMessages != null) { for(InvestigationQuestionShortVo item : infoMessages) list.add(item); } } return list; }