/** * go through OrderSpecimen grid comparing discipline && specimenSource if found add row to the found row else instantiate new parent row and add to this * * @param tRow * @param grid */ private void modifyDynamicGridNowOrPatient(grdTestRow tRow, DynamicGrid grid) { OrderInvestigationVo voOrderInvestigation = tRow.getValue(); SpecimenVo specimen = tRow.getColSpecimen(); if (tRow.getColHiddenOrderInvestigationSite() != null) { voOrderInvestigation = tRow.getColHiddenOrderInvestigationSite(); } if (voOrderInvestigation == null) // profile collection { grdTestRowCollection collRows = tRow.getRows(); for (int i = 0; i < collRows.size(); i++) { voOrderInvestigation = collRows.get(i).getValue(); voOrderInvestigation.setCollectionType((SpecimenCollectionType) tRow.getColType().getValue()); // Clear OderSpecimen for OrderInvestigation voOrderInvestigation.setSpecimen(null); boolean bProfileProcessed = i > 0; modifyNowOrPatientRows(grid, voOrderInvestigation, null, collRows.get(i).getColSiteHidden(), null, false, bProfileProcessed); } } else { // Clear OderSpecimen for OrderInvestigation voOrderInvestigation.setSpecimen(null); voOrderInvestigation.setCollectionType((SpecimenCollectionType) tRow.getColType().getValue()); modifyNowOrPatientRows(grid, voOrderInvestigation, specimen, tRow.getColSiteHidden(), null, false, false); InvestigationUnderSpecimenVoCollection voCollInvUnderSpecimen = null; if (tRow.getParentRow() != null && tRow.getParentRow().getColAddOnsHidden() != null && tRow.getParentRow().getColAddOnsHidden().getItems() != null) voCollInvUnderSpecimen = tRow.getParentRow().getColAddOnsHidden(); else if (tRow.getColAddOnsHidden() != null && tRow.getColAddOnsHidden().getItems() != null) voCollInvUnderSpecimen = tRow.getColAddOnsHidden(); if (voCollInvUnderSpecimen != null) { for (int i = 0; i < voCollInvUnderSpecimen.size(); i++) { voOrderInvestigation = createOrderInvestigation(voOrderInvestigation, voCollInvUnderSpecimen.get(i)); voOrderInvestigation.setCollectionType((SpecimenCollectionType) tRow.getColType().getValue()); GenericInfoAdapter site = tRow.getColSiteHidden(); PathInvDetailsVo addOnPathInvDetails = tRow.getParentRow() != null ? tRow.getParentRow().getValue().getInvestigation().getPathInvDetails() : tRow.getValue().getInvestigation().getPathInvDetails(); modifyNowOrPatientRows(grid, voOrderInvestigation, null, site, addOnPathInvDetails, true, false); } } } grid.setSelectable(false); grid.setReadOnly(false); }
/** * @param tRow * @param grid * go through orderspecimen grid comparing discipline && specimenSource if found add row to the found row else instantiate new parent row and add to this */ private void modifyDynamicGridPhlebOrOther(grdTestRow tRow, DynamicGrid grid) { OrderInvestigationVo voOrderInvestigation = tRow.getValue(); if (tRow.getColHiddenOrderInvestigationSite() != null) { voOrderInvestigation = tRow.getColHiddenOrderInvestigationSite(); } if (voOrderInvestigation == null) // profile collection { grdTestRowCollection collRows = tRow.getRows(); for (int i = 0; i < collRows.size(); i++) { voOrderInvestigation = collRows.get(i).getValue(); voOrderInvestigation.setCollectionType((SpecimenCollectionType) tRow.getColType().getValue()); // Clear OderSpecimen for OrderInvestigation voOrderInvestigation.setSpecimen(null); boolean bProfileProcessed = i > 0; modifyPhlebOrOtherRows(grid, voOrderInvestigation, tRow.getColSpecimen(), collRows.get(i).getColSiteHidden(), null, false, bProfileProcessed); } } else { // Clear OderSpecimen for OrderInvestigation voOrderInvestigation.setSpecimen(null); voOrderInvestigation.setCollectionType((SpecimenCollectionType) tRow.getColType().getValue()); modifyPhlebOrOtherRows(grid, voOrderInvestigation, tRow.getColSpecimen(), tRow.getColSiteHidden(), null, false, false); InvestigationUnderSpecimenVoCollection voCollInvUnderSpecimen = null; if (tRow.getParentRow() != null && tRow.getParentRow().getColAddOnsHidden() != null && tRow.getParentRow().getColAddOnsHidden().getItems() != null) voCollInvUnderSpecimen = tRow.getParentRow().getColAddOnsHidden(); else if (tRow.getColAddOnsHidden() != null && tRow.getColAddOnsHidden().getItems() != null) voCollInvUnderSpecimen = tRow.getColAddOnsHidden(); if (voCollInvUnderSpecimen != null) { for (int i = 0; i < voCollInvUnderSpecimen.size(); i++) { voOrderInvestigation = createOrderInvestigation(voOrderInvestigation, voCollInvUnderSpecimen.get(i)); voOrderInvestigation.setCollectionType((SpecimenCollectionType) tRow.getColType().getValue()); GenericInfoAdapter site = tRow.getColSiteHidden(); PathInvDetailsVo addOnPathInvDetails = tRow.getParentRow() != null ? tRow.getParentRow().getValue().getInvestigation().getPathInvDetails() : tRow.getValue().getInvestigation().getPathInvDetails(); modifyPhlebOrOtherRows(grid, voOrderInvestigation, tRow.getColSpecimen(), site, addOnPathInvDetails, true, false); } } } grid.setSelectable(false); grid.setReadOnly(false); }