private GenderInvestigationVo getGenderInvestigationFromSelectedComponentFromSelectOrder(SelectedComponentFromSelectOrderVo component) { if(component == null) return null; GenderInvestigationVo inv = new GenderInvestigationVo(); inv.setID_Investigation(component.getID()); InvestigationIndexForGenderInvestigationVo invIndex = new InvestigationIndexForGenderInvestigationVo(); invIndex.setName(component.getText()); invIndex.setIsProfile(SelectAndOrderComponentType.PROFILE.equals(component.getComponentType())); inv.setInvestigationIndex(invIndex); return inv; }
private GenderInvestigationVo isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, Investigation doInv) { if (instGenderSpecific != null) { if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE)) { if (instGenderSpecific.equals(GenderSpecific.FEMALE)) { if (!isFemale) return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762 } else if (instGenderSpecific.equals(GenderSpecific.MALE)) { if (isFemale) return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762 } } } return null; }
private GenderInvestigationVo getGenderInvestigationFromInvestShort(InvestShortVo investShortVo) { if(investShortVo == null) return null; GenderInvestigationVo inv = new GenderInvestigationVo(investShortVo.getID_Investigation(), investShortVo.getVersion_Investigation()); InvestigationIndexForGenderInvestigationVo invIndex = new InvestigationIndexForGenderInvestigationVo(investShortVo.getInvestigationIndex().getID_InvestigationIndex(), investShortVo.getInvestigationIndex().getVersion_InvestigationIndex()); invIndex.setName(investShortVo.getInvestigationIndex().getName()); invIndex.setIsProfile(investShortVo.getInvestigationIndex().getIsProfile()); inv.setInvestigationIndex(invIndex); return inv; }
private void populateInvestigationGrid() { if(form.getGlobalContext().OCRR.getGenderInvestigations() == null || form.getGlobalContext().OCRR.getGenderInvestigations().size() ==0) return; for(GenderInvestigationVo inv : form.getGlobalContext().OCRR.getGenderInvestigations()) { addInvestigationRow(inv); } }
private void addInvestigationRow(GenderInvestigationVo inv) { if(inv == null) return; grdInvestigationsRow row = form.grdInvestigations().getRows().newRow(); row.setColInvestigation(inv.getInvestigationIndex().getName()); row.setColSelect(true); row.setValue(inv); if(inv.getAssocInvestigation() == null || inv.getAssocInvestigation().size() == 0) return; row.setExpanded(true); for(GenderInvestigationVo childInv : inv.getAssocInvestigation()) { if(childInv == null) continue; grdInvestigationsRow childRow = row.getRows().newRow(); childRow.setColInvestigation(childInv.getInvestigationIndex().getName()); childRow.setColSelect(true); childRow.setValue(childInv); } }
private void checkUncheckOtherInvWithSameValue(grdInvestigationsRow row, boolean isChecked) { if(row == null || row.getValue() == null) return; GenderInvestigationVo invValue = row.getValue(); for(int i=0; i<form.grdInvestigations().getRows().size(); i++) { grdInvestigationsRow invRow = form.grdInvestigations().getRows().get(i); if(invValue.equals(invRow.getValue())) { invRow.setColSelect(isChecked); } if(invRow.getColSelect()) { for(int j=0; j<invRow.getRows().size(); j++) { grdInvestigationsRow childRow = invRow.getRows().get(j); if(invValue.equals(childRow.getValue())) childRow.setColSelect(isChecked); } } } }
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; }