private void populatehardcodedrowsgrid() { ims.framework.cn.data.TreeNode[] rootNodes = LookupHelper.getSpecimenCollectionType(domain.getLookupService()).getRootNodes(); for (int i = 0; i < rootNodes.length; i++) { SpecimenCollectionType spectype = (SpecimenCollectionType) rootNodes[i]; grdSiteCollectionTypeRow row = form.grdSiteCollectionType().getRows().newRow(); row.setColumnType(spectype.getText()); row.setColumnSelect(false); row.setValue(spectype); } }
protected void cmbRequestedTypeValueChanged() { SpecimenCollectionType type = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().cmbRequestedType().getValue(); if (type != null) { // default the items in the grid grdTestRow[] rows = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getAllRows(); for (int i = 0; i < rows.length; i++) { GenForm.lyrDetailsLayer.tabPathDetailsContainer.lyrPathologyLayer.tabRequestedTestsContainer.grdTestRow row = rows[i]; if (isRowEditable(row)) row.getColType().setValue(type); } } // WDEV-5344 if (ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("UKSH")) // WDEV-11881 { if (type == null && !validateRequestedTests()) disableOrdering(); else if (validateRequestedTests()) enableOrdering(); } }
private SpecimenCollectionType getRequestedType(DynamicGrid grid) { // WDEV-3730 if (grid == null) throw new CodingRuntimeException("grid param is null in method getRequestedType"); if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabNow().dyngrdNow())) return SpecimenCollectionType.NOW; if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabPatient().dyngrdPatient())) return SpecimenCollectionType.PATIENT; if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther())) return SpecimenCollectionType.OTHER; if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat())) return SpecimenCollectionType.PHLEBOTOMY_INPATIENT; if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat())) return SpecimenCollectionType.PHLEBOTOMY_OUTPATIENT; if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabSpecAlreadyCollected().dyngrdSpecAlreadyCollected())) return SpecimenCollectionType.SPECIMEN_ALREADY_COLLECTED; return null; }
private void populateDFTInvestigations(OrderInvestigationListVoCollection investigations) { if(investigations == null) return; for(OrderInvestigationListVo investigation : investigations) { if(investigation == null) continue; if (investigation.getOrdInvCurrentStatus() != null && (!OrderInvStatus.CANCEL_REQUEST.equals(investigation.getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(investigation.getOrdInvCurrentStatus().getOrdInvStatus()))) { if (isDFT(investigation)) { if (engine.getPreviousNonDialogFormName().equals(form.getForms().OCRR.MyOrder)) { if (!SpecimenCollectionType.OTHER.equals(investigation.getCollectionType()) && !SpecimenCollectionType.PHLEBOTOMY_INPATIENT.equals(investigation.getCollectionType())) { addDFTInvestigationRow(investigation); } } else { addDFTInvestigationRow(investigation); } } } } }
private DateTime getRequiredByDate(OrderSpecimenVo voOrderSpecimen) { if(voOrderSpecimen == null) return new DateTime(); if(SpecimenCollectionType.NOW.equals(voOrderSpecimen.getRequestedType()) || SpecimenCollectionType.PATIENT.equals(voOrderSpecimen.getRequestedType()) || SpecimenCollectionType.SPECIMEN_ALREADY_COLLECTED.equals(voOrderSpecimen.getRequestedType())) return new DateTime(); if(SpecimenCollectionType.PHLEBOTOMY_OUTPATIENT.equals(voOrderSpecimen.getRequestedType()) || SpecimenCollectionType.PHLEBOTOMY_INPATIENT.equals(voOrderSpecimen.getRequestedType()) || SpecimenCollectionType.OTHER.equals(voOrderSpecimen.getRequestedType()) || SpecimenCollectionType.SPECIMEN_COLLECTION_CLINIC.equals(voOrderSpecimen.getRequestedType())) return createDateTimeFromSpecimenWorklistItem(voOrderSpecimen.getSpecimenWorklistItem()); return new DateTime(); }
private boolean btnGenerateSpecimensClick(int iTab) throws PresentationLogicException { if (!validateTab(iTab)) return false; if (form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().isVisible()) { form.lyrDetails().tabPathDetails().lyrPathology().tabNow().dyngrdNow().clear(); form.lyrDetails().tabPathDetails().lyrPathology().tabPatient().dyngrdPatient().clear(); form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat().clear(); form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat().clear(); form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther().clear(); form.lyrDetails().tabPathDetails().lyrPathology().tabSpecAlreadyCollected().dyngrdSpecAlreadyCollected().clear(); for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getAllRows().length; i++) { GenForm.lyrDetailsLayer.tabPathDetailsContainer.lyrPathologyLayer.tabRequestedTestsContainer.grdTestRow tRow; tRow = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getAllRows()[i]; if (tRow.getColType().getValue() != null) { if (tRow.getColType().getValue().equals(SpecimenCollectionType.NOW)) { initialisePathSpecimenGrid(GRID_NOW); modifyDynamicGridNowOrPatient(tRow, form.lyrDetails().tabPathDetails().lyrPathology().tabNow().dyngrdNow()); } else if (tRow.getColType().getValue().equals(SpecimenCollectionType.PATIENT)) { initialisePathSpecimenGrid(GRID_PATIENT); modifyDynamicGridNowOrPatient(tRow, form.lyrDetails().tabPathDetails().lyrPathology().tabPatient().dyngrdPatient()); } // WDEV-5344 else if (tRow.getColType().getValue().equals(SpecimenCollectionType.PHLEBOTOMY_OUTPATIENT) || tRow.getColType().getValue().equals(SpecimenCollectionType.SPECIMEN_COLLECTION_CLINIC)) { initialisePathSpecimenGrid(GRID_PHLEB_OUTPAT); modifyDynamicGridPhlebOrOther(tRow, form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat()); } else if (tRow.getColType().getValue().equals(SpecimenCollectionType.PHLEBOTOMY_INPATIENT)) { initialisePathSpecimenGrid(GRID_PHLEB_INPAT); modifyDynamicGridPhlebOrOther(tRow, form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat()); } else if (tRow.getColType().getValue().equals(SpecimenCollectionType.OTHER)) { initialisePathSpecimenGrid(GRID_OTHER); modifyDynamicGridPhlebOrOther(tRow, form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther()); } else if (tRow.getColType().getValue().equals(SpecimenCollectionType.SPECIMEN_ALREADY_COLLECTED)) { initialisePathSpecimenGrid(GRID_ALREADY); modifyDynamicGridPhlebOrOther(tRow, form.lyrDetails().tabPathDetails().lyrPathology().tabSpecAlreadyCollected().dyngrdSpecAlreadyCollected()); } } } // WDEV-11580 finished adding rows here we need to check the alternative containers rules // check if investigations belonging to each specimen have matching containers in the configured default or alternative containers collections // where there is a match add the specimen with all its investigations and container choices to a global for selection on a dialog // the investigation that have no choice will simply display the container to be used // dialog will also display volume required for specimen and also each investigation // on the closing of this dialog - the grids will be repopulated with the (new) container choices by way of modifying the configured investigations in memory (ie. their containers) // the ordering will then need to take into account the (new) containers (reading from grid) boolean useAlternativeContainers = checkNeedForAlternativeContainersSelection(); if (useAlternativeContainers) { engine.open(form.getForms().OCRR.ChooseAlternativeContainersDialog); return false; } } if (form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther().getRows().size() > 0) onBtnApplyOtherClick(); showInvestigationTooltipsAtSpecimenLevel(); showNextTabAndDisableCurrent(); enableOrdering(); return true; }
private void addSpecimenContainerRequestedTypeRootItems(grdTestRow row) { Boolean phlebMayCollect = Boolean.FALSE; if (row.getValue() == null) { if (row.getRows().size() > 0 && row.getRows().get(0).getValue() != null) phlebMayCollect = row.getRows().get(0).getValue().getInvestigation().getParentPhlebMayCollect(); } else phlebMayCollect = isPhlebMayCollect(row.getValue().getInvestigation().getID_Investigation()); // For DFT Investigation populate with values in DFT collection if (row.getValue() != null && InvEventType.TIME_SERIES.equals(row.getValue().getInvestigation().getEventType())) { if (form.getLocalContext().getDFTCollectionType() != null && form.getLocalContext().getDFTCollectionType().getSiteCollectionType() != null) { for (int i = 0; i < form.getLocalContext().getDFTCollectionType().getSiteCollectionType().size(); i++) { SpecimenCollectionType collectionType = form.getLocalContext().getDFTCollectionType().getSiteCollectionType().get(i); row.getColType().newRow(collectionType, collectionType.getText()); } } } else { ims.framework.cn.data.TreeNode[] rootNodes = LookupHelper.getSpecimenCollectionType(domain.getLookupService()).getRootNodes(); for (int i = 0; i < rootNodes.length; i++) { SpecimenCollectionType lk = (SpecimenCollectionType) rootNodes[i]; if (!lk.isActive()) continue; if (lk.equals(SpecimenCollectionType.PHLEBOTOMY_INPATIENT) || lk.equals(SpecimenCollectionType.PHLEBOTOMY_OUTPATIENT)) if (phlebMayCollect != null && !phlebMayCollect.booleanValue()) continue; row.getColType().newRow(lk, lk.getText()); } } }
private void loadSpecimenRequestedTypes() { form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().cmbRequestedType().clear(); boolean phlebMayCollect = false; for (int i = 0; i < form.treeComponents().getNodes().size(); i++) { SelectedComponentFromSelectOrderVo voComponent = (SelectedComponentFromSelectOrderVo) form.treeComponents().getNodes().get(i).getValue(); if (voComponent.getPhlebMayCollectIsNotNull() && voComponent.getPhlebMayCollect().equals(Boolean.TRUE)) { phlebMayCollect = true; break; } for (int p = 0; p < form.treeComponents().getNodes().get(i).getNodes().size(); p++) { SelectedComponentFromSelectOrderVo voChildComponent = (SelectedComponentFromSelectOrderVo) form.treeComponents().getNodes().get(i).getNodes().get(p).getValue(); if (voChildComponent.getPhlebMayCollectIsNotNull() && voChildComponent.getPhlebMayCollect().equals(Boolean.TRUE)) { phlebMayCollect = true; break; } } } ims.framework.cn.data.TreeNode[] rootNodes = LookupHelper.getSpecimenCollectionType(domain.getLookupService()).getRootNodes(); for (int i = 0; i < rootNodes.length; i++) { SpecimenCollectionType lk = (SpecimenCollectionType) rootNodes[i]; if (!lk.isActive()) continue; if (!phlebMayCollect) { if (lk.equals(SpecimenCollectionType.PHLEBOTOMY_INPATIENT) || lk.equals(SpecimenCollectionType.PHLEBOTOMY_OUTPATIENT)) continue; } form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().cmbRequestedType().newRow(lk, lk.getText()); } }
private boolean validateRequestedTests() { if (form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().size() == 0) return true; SpecimenCollectionTypeCollection collTypes = new SpecimenCollectionTypeCollection(); for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getAllRows().length; i++) { GenForm.lyrDetailsLayer.tabPathDetailsContainer.lyrPathologyLayer.tabRequestedTestsContainer.grdTestRow specimenOrSiteRow = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getAllRows()[i]; if (specimenOrSiteRow.getValue() instanceof OrderInvestigationVo) { if (specimenOrSiteRow.getColSpecimen() instanceof SpecimenVo) { collTypes.add((SpecimenCollectionType) specimenOrSiteRow.getColType().getValue()); if (!specimenOrSiteRow.isReadOnly() && specimenOrSiteRow.getColType().getValue() == null) return false; } else if (specimenOrSiteRow.getColSpecimen() == null && specimenOrSiteRow.getValue() != null && Boolean.TRUE.equals(specimenOrSiteRow.getValue().getInvestigation().getInvestigationIndex().getRequiresSiteSpecifier())) // This could be a site specifier investigation and collection type { collTypes.add((SpecimenCollectionType) specimenOrSiteRow.getColType().getValue()); if (!specimenOrSiteRow.isReadOnly() && specimenOrSiteRow.getColType().getValue() == null) return false; } else if (specimenOrSiteRow.getParentRow() != null) { collTypes.add((SpecimenCollectionType) specimenOrSiteRow.getParentRow().getColType().getValue()); if (specimenOrSiteRow.getParentRow().getColType().getValue() == null) return false; } } else if (specimenOrSiteRow.getValue() == null && specimenOrSiteRow.getParentRow() != null) { collTypes.add((SpecimenCollectionType) specimenOrSiteRow.getParentRow().getColType().getValue()); if (specimenOrSiteRow.getParentRow().getColType().getValue() == null) return false; } } if (collTypes.size() == 0) return false; else return true; }
/** * 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); }