protected void onBtnPrintClick() throws PresentationLogicException { form.getLocalContext().setContextDummyForReportsLabel(null); form.getLocalContext().setContextDummyForReportsScreen(null); if(form.dyngrdCollect().getRows().size() == 0) { engine.showMessage("There is no data to print"); return; } SpecimenWorkListItemListVoCollection voColl = getWorkListItemsToprint(); if(voColl != null && voColl.size() != 0) { SpecimenWorkListItemListVo dummy = new SpecimenWorkListItemListVo(); dummy.setID_SpecimenWorkListItem(new Integer(-1)); form.getLocalContext().setContextDummyForReportsLabel(dummy); } form.getGlobalContext().Core.setPrepareForPrinting(Boolean.TRUE); engine.open(form.getForms().Core.PrintReport); }
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint() { SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection(); for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++) { for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++) { for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++) { DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL)); if(printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING)) { voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue()); } } } } return voColl; }
private void refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl) { for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++) { for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++) { for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++) { DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k); DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL)); if(printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING)) { loadPrintedStatus(printCell, true); printCell.setValue(PrintStatus.PRINTED); //Set the value of the row with a new one (otherwise will get a Stale Object Exception when saving) SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl); if(voNewSavedValue != null) row.setValue(voNewSavedValue); } } } } }
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint() { SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection(); for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++) { for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++) { for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++) { DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL)); if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING)) { voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue()); } } } } return voColl; }
private void refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl) { for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++) { for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++) { for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++) { DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k); DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL)); if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING)) { loadPrintedStatus(printCell, true); printCell.setValue(PrintStatus.PRINTED); // Set the value of the row with a new one (otherwise // will get a Stale Object Exception when saving) SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl); if (voNewSavedValue != null) row.setValue(voNewSavedValue); } } } } }
private SpecimenWorkListItemListVo getNewValueFromSavedList(Object value, SpecimenWorkListItemListVoCollection voColl) { if(value == null) return null; for (int i = 0; i < voColl.size(); i++) { if(voColl.get(i).equals(value)) { return voColl.get(i); } } return null; }
protected void onBtnPrintClick() throws PresentationLogicException { form.getLocalContext().setContextDummyForReportsLabel(null); form.getLocalContext().setContextDummyForReportsScreen(null); if (form.dyngrdCollect().getRows().size() == 0) { engine.showMessage("There is no data to print"); return; } SpecimenWorkListItemListVoCollection voColl = getWorkListItemsToprint(); if (voColl.size() == 0) { form.getLocalContext().setContextDummyForReportsScreen(form.cmbHospital().getValue()); engine.showMessage("Please select at least one Specimen to print"); return; } else { SpecimenWorkListItemListVo dummy = new SpecimenWorkListItemListVo(); dummy.setID_SpecimenWorkListItem(new Integer(-1)); form.getLocalContext().setContextDummyForReportsLabel(dummy); } form.getGlobalContext().Core.setPrepareForPrinting(Boolean.TRUE); form.getGlobalContext().Core.setSpecimenWorkListItemsForPrint(voColl); engine.open(form.getForms().Core.PrintMultipleOrders); //WDEV-17760 // form.getGlobalContext().OCRR.setSpecimenWorkListItemPrintList(voColl); // engine.open(form.getForms().OCRR.WardSpecimenPrint); }
private SpecimenWorkListItemListVo getNewValueFromSavedList(Object value, SpecimenWorkListItemListVoCollection voColl) { if (value == null) return null; for (int i = 0; i < voColl.size(); i++) { if (voColl.get(i).equals(value)) { return voColl.get(i); } } return null; }
public SpecimenWorkListItemListVoCollection markWorkListItemsAsPrinted(SpecimenWorkListItemListVoCollection workListItemCollection) throws StaleObjectException { SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection(); DomainFactory factory = getDomainFactory(); for (int i = 0; i < workListItemCollection.size(); i++) { SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, workListItemCollection.get(i)); factory.save(doSpecimenWorkListItem); voColl.add(SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem)); } return voColl; }
private void populateGrid() { SpecimenWorkListItemListVoCollection worklistItems = form.getGlobalContext().Core.getSpecimenWorkListItemsForPrint(); for (int i = 0; i < worklistItems.size(); i++) { addGridRow(worklistItems.get(i)); } }
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException { if (formName.equals(form.getForms().Core.PrintReport) && result.equals(DialogResult.OK)) { printSelectedItems(); } //WDEV-17760 if (formName.equals(form.getForms().Core.PrintMultipleOrders) && result.equals(DialogResult.OK)) { SpecimenWorkListItemListVoCollection voColl = getWorkListItemsToprint(); for (int i = 0; i < voColl.size(); i++) { //WDEV-16232 after the printing, save the DFT investigation SpecimenWorkListItemListVo item = voColl.get(i); if (item.getDFTOrderInvestigationIsNotNull()) { item.setCollectionStatus(SpecimenCollectionStatus.COLLECTIONCOMPLETE); try { domain.saveWorkListItem(item); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); } } } refreshDataInGrid(voColl); } if (formName.equals(form.getForms().OCRR.WardSpecimenMoveTo)) { if (result.equals(DialogResult.OK)) { //WDEV-16708 SpecimenWorkListItemListVo specimen = form.getGlobalContext().OCRR.getSpecimenWorkListItemList(); if (isRowEditable(specimen.getCollectionStatus())) { form.getGlobalContext().OCRR.setSpecimenWorkListItemList(domain.getSpecimenWorkListItem(specimen.getID_SpecimenWorkListItem())); } refreshRecord(form.getGlobalContext().OCRR.getSpecimenWorkListItemList()); enableContextMenu(); } form.getGlobalContext().OCRR.setSpecimenWorkListItemList(null); } }
@Override protected void onBtnPrintClick() throws PresentationLogicException { if (form.dyngrdCollect().getRows().size() == 0) { engine.showMessage("There is no data to print"); return; } SpecimenWorkListitemCustomVoCollection voColl = getWorkListItemsToprint(); //WDEV-17760 /* if (voColl.size() == 0) { form.getLocalContext().setContextDummyForReportsLabel(null); form.getLocalContext().setSelectedRound(form.cmbRound().getValue()); form.getGlobalContext().Core.setPrepareForPrinting(Boolean.FALSE); } else { OrderSpecimenVo dummy = new OrderSpecimenVo(); dummy.setID_OrderSpecimen(new Integer(-1)); form.getLocalContext().setContextDummyForReportsLabel(dummy); form.getLocalContext().setSelectedRound(null); form.getGlobalContext().Core.setPrepareForPrinting(Boolean.TRUE); } */ if (voColl.size() == 0) { engine.showMessage("Please select at least one record to print"); return; } SpecimenWorkListItemListVoCollection workListItems = new SpecimenWorkListItemListVoCollection(); for (int i = 0; i < voColl.size(); i++) { workListItems.add(domain.getWorkListItemListRecord(voColl.get(i).getWorkListitemId())); } form.getGlobalContext().Core.setSpecimenWorkListItemsForPrint(workListItems); engine.open(form.getForms().Core.PrintMultipleOrders); }
protected void onBtnPrintClick() throws PresentationLogicException { if(form.dyngrdCollect().getRows().size() == 0) { engine.showMessage("There is no data to print !"); return; } form.getLocalContext().setContextDummyForReports(null); for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++) { DynamicGridRow parentRow = form.dyngrdCollect().getRows().get(i); for (int j = 0; j < parentRow.getRows().size(); j++) { DynamicGridRow row = parentRow.getRows().get(j); DynamicGridCell cell = row.getCells().get(getColumn(ACTIONED_COL)); boolean isActioned = false; if(cell != null && cell.getValue() instanceof Boolean) isActioned = ((Boolean)cell.getValue()).booleanValue(); if(isActioned && form.getLocalContext().getContextDummyForReports() == null) { SpecimenWorkListItemVo specimenWorkListItemVo = new SpecimenWorkListItemVo(); specimenWorkListItemVo.setID_SpecimenWorkListItem(new Integer(-1)); form.getLocalContext().setContextDummyForReports(specimenWorkListItemVo); //WDEV-17760 if (form.getGlobalContext().Core.getSpecimenWorkListItemsForPrint() == null) { form.getGlobalContext().Core.setSpecimenWorkListItemsForPrint(new SpecimenWorkListItemListVoCollection()); } else form.getGlobalContext().Core.getSpecimenWorkListItemsForPrint().clear(); form.getGlobalContext().Core.getSpecimenWorkListItemsForPrint().add((SpecimenWorkListItemListVo) row.getValue()); } } } if(form.getLocalContext().getContextDummyForReports() == null) { engine.showMessage("There is no actioned records to print !"); return; } form.getGlobalContext().Core.setPrepareForPrinting(Boolean.TRUE); engine.open(form.getForms().Core.PrintMultipleOrders); }