public InvestigationQuestionShortVoCollection listInformatonMessagesForInvestigation(Integer investigationId, Integer parentId)//WDEV-16762 { if(investigationId == null) throw new CodingRuntimeException("investigationId is null in method listInformatonMessagesForInvestigation"); DomainFactory factory = getDomainFactory(); Investigation domInvest = (Investigation)factory.getDomainObject(Investigation.class, investigationId); if (domInvest == null) throw new DomainRuntimeException("No investigation found for id = " + investigationId); List infoQuestions = new ArrayList(); Iterator it = domInvest.getAssocQuestions().iterator(); while(it.hasNext()) { InvestigationQuestion invQuest = (InvestigationQuestion)it.next(); if(!invQuest.getQuestion().isIsQuestion().booleanValue()) infoQuestions.add(invQuest); } InvestigationQuestionShortVoCollection voCollInvQuestions = InvestigationQuestionShortVoAssembler.createInvestigationQuestionShortVoCollectionFromInvestigationQuestion(infoQuestions); for(int i=0;i<voCollInvQuestions.size();i++) { if(domInvest.getInvestigationIndex() != null) { voCollInvQuestions.get(i).setInvestigationName(domInvest.getInvestigationIndex().getName()); voCollInvQuestions.get(i).setInvestigaionId(investigationId);//WDEV-16762 voCollInvQuestions.get(i).setParentId(parentId);// WDEV-16762 } } return voCollInvQuestions; }
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; }
private InvestigationQuestionShortVoCollection listInfoMessages(Investigation doInv, Integer parentId) //WDEV-16762 { if(doInv == null) return null; if(Boolean.TRUE.equals(doInv.getInvestigationIndex().isIsProfile())) { InvestigationQuestionShortVoCollection infoQuestions = new InvestigationQuestionShortVoCollection(); if(doInv.getAssocInvestigations() != null) { Iterator it = doInv.getAssocInvestigations().iterator(); while(it.hasNext()) { Object comp = it.next(); if(!(comp instanceof Investigation)) continue; addInfoQuestionsCollection(infoQuestions, listInfoMessages((Investigation)comp, doInv.getId()));//WDEV-16762 } return infoQuestions; } } return listInformatonMessagesForInvestigation(doInv.getId(), parentId);//WDEV-16762 }