private boolean searchTreeHierarchy(grdAuscultationRow rowParent, AuscultationFinding finding) { boolean bPlanFound = false; if(rowParent.getRows().size()==0) if(rowParent.getcolFinding().equals(finding)){ rowParent.setcolSelect(true); return true; } for (int j = 0; j < rowParent.getRows().size(); j++) { grdAuscultationRow rowChild = rowParent.getRows().get(j); if(rowChild.getcolFinding().equals(finding)){ rowChild.setcolSelect(true); return true; } bPlanFound = searchTreeHierarchy(rowChild, finding); } return bPlanFound; }
private void putItemHierarchyOnGrid(AuscultationFinding finding, grdAuscultationRow row) { row.setcolFinding(finding); if(finding.getChildInstances().size()>0) for (int i = 0; i < finding.getChildInstances().size(); i++) { putItemHierarchyOnGrid((AuscultationFinding)finding.getChildInstances().get(i), row.getRows().newRow()); } }
private boolean hasSelectedItem(AuscultationFinding finding, AuscultationFindingCollection findings) { form.getLocalContext().setHasSelectedItem(false); if(!form.getLocalContext().getHasSelectedItem()) for (int i = 0; i < findings.size(); i++) searchHierarchyForFinding( finding, findings.get(i)); return form.getLocalContext().getHasSelectedItem(); }
private void searchHierarchyForFinding(AuscultationFinding selectedFinding, AuscultationFinding finding) { if(selectedFinding.getChildInstances().size()==0) if(selectedFinding.equals(finding)) form.getLocalContext().setHasSelectedItem(true); for (int j = 0; j < selectedFinding.getChildInstances().size(); j++) { searchHierarchyForFinding( (AuscultationFinding) selectedFinding.getChildInstances().get(j), finding); } }
private void setSelectedAuscultations(AuscultationFindingCollection examFindings) { for (int i = 0; i < form.grdAuscultation().getRows().size(); i++){ grdAuscultationRow row = form.grdAuscultation().getRows().get(i); AuscultationFinding value = row.getcolFinding(); for (int j = 0; j < examFindings.size(); j++){ if(value.equals(examFindings.get(j))) row.setcolSelect(true); else if(value.equals(examFindings.get(j))) row.setcolSelect(true); } setSelectedChildAuscultations(row, examFindings); } }
private void setSelectedChildAuscultations(grdAuscultationRow row, AuscultationFindingCollection examFindings) { for (int i = 0; i < row.getRows().size(); i++){ grdAuscultationRow childRow = row.getRows().get(i); AuscultationFinding value = childRow.getcolFinding(); for (int j = 0; j < examFindings.size(); j++){ if(value.equals(examFindings.get(j))) childRow.setcolSelect(true); else if(value.equals(examFindings.get(j))) childRow.setcolSelect(true); } } }