private GenderInvestigationVoCollection isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, InvestShortVo investShortVo) { GenderInvestigationVoCollection invColl = new GenderInvestigationVoCollection(); if (instGenderSpecific != null) { if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE)) { if (instGenderSpecific.equals(GenderSpecific.FEMALE)) { if (!isFemale) { invColl.add(getGenderInvestigationFromInvestShort(investShortVo)); } } else if (instGenderSpecific.equals(GenderSpecific.MALE)) { if (isFemale) { invColl.add(getGenderInvestigationFromInvestShort(investShortVo)); } } } } return invColl.size() > 0 ? invColl : null; }
private GenderInvestigationVoCollection isInvAppropriateFromComponent(GenderSpecific instGenderSpecific, boolean isFemale, SelectedComponentFromSelectOrderVo component) { GenderInvestigationVoCollection invColl = new GenderInvestigationVoCollection(); if (instGenderSpecific != null) { if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE)) { if (instGenderSpecific.equals(GenderSpecific.FEMALE)) { if (!isFemale) { invColl.add(getGenderInvestigationFromSelectedComponentFromSelectOrder(component)); } } else if (instGenderSpecific.equals(GenderSpecific.MALE)) { if (isFemale) { invColl.add(getGenderInvestigationFromSelectedComponentFromSelectOrder(component)); } } } } return invColl.size() > 0 ? invColl : null; }
public GenderInvestigationVoCollection listOrderSetInvestigationsWithGenderMessages(OrderSetRefVo orderSet, Boolean isFemale) { if(orderSet == null) throw new CodingRuntimeException("orderSet is null in method listOrderSetInvestigationsWithGenderMessages."); boolean female = Boolean.TRUE.equals(isFemale); DomainFactory factory = getDomainFactory(); OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet); if(doOrderSet == null || doOrderSet.getComponent() == null) return null; Iterator it = doOrderSet.getComponent().iterator(); GenderInvestigationVoCollection list = new GenderInvestigationVoCollection();//WDEV-16762 while(it.hasNext()) { Object comp = it.next(); if(!(comp instanceof OrderSetComponent)) continue; Investigation doInv = ((OrderSetComponent) comp).getInvestigation(); GenderInvestigationVoCollection invGenderMessages = listGenderMessages(doInv, female, null);//WDEV-16762 if(invGenderMessages != null) { for(GenderInvestigationVo item : invGenderMessages)//WDEV-16762 list.add(item); } } return list; }
private GenderInvestigationVoCollection listGenderMessages(Investigation doInv, boolean female, GenderInvestigationVo parentInv)//WDEV-16762 { if(doInv == null) return null; GenderInvestigationVoCollection messages = new GenderInvestigationVoCollection();//WDEV-16762 if(Boolean.TRUE.equals(doInv.getInvestigationIndex().isIsProfile())) { GenderInvestigationVo profileInv = isInvAppropriate(assembleGenderSpecific(doInv.getInvestigationIndex().getGenderSpecific()), female, doInv);//WDEV-16762 boolean isProfileAdded = false;//WDEV-16762 //WDEV-16762 if(profileInv != null) { isProfileAdded = true; messages.add(profileInv); } else { profileInv = GenderInvestigationVoAssembler.create(doInv);//WDEV-16762 } if(doInv.getAssocInvestigations() != null) { Iterator it = doInv.getAssocInvestigations().iterator(); while(it.hasNext()) { Object comp = it.next(); if(!(comp instanceof Investigation)) continue; addGenderMessagesCollection(messages, listGenderMessages((Investigation)comp, female, profileInv));//WDEV-16762 } //WDEV-16762 if(profileInv!= null && profileInv.getAssocInvestigation() != null && profileInv.getAssocInvestigation().size() > 0 && !isProfileAdded) { messages.add(profileInv); } return messages; } } GenderInvestigationVo childInv = isInvAppropriate(assembleGenderSpecific(doInv.getInvestigationIndex().getGenderSpecific()), female, doInv);//WDEV-16762 //WDEV-16762 if(parentInv != null) { if(parentInv.getAssocInvestigation() == null) parentInv.setAssocInvestigation(new GenderInvestigationVoCollection()); parentInv.getAssocInvestigation().add(childInv); } else { messages.add(childInv); } return messages; }