private void listRound() { form.dyngrdCollect().getRows().clear(); form.getGlobalContext().Core.setPatientShort(null); //WDEV-16767 if(form.cmbRound().getValue() == null) return; SpecimenCollectionStatus status = null; if(form.GroupFilter().getValue().equals(GroupFilterEnumeration.rdoCollected)) status = SpecimenCollectionStatus.COLLECTIONCOMPLETE; else if(form.GroupFilter().getValue().equals(GroupFilterEnumeration.rdoCouldNotCollect)) status = SpecimenCollectionStatus.COULDNOTCOLLECT; else if(form.GroupFilter().getValue().equals(GroupFilterEnumeration.rdoForCollection)) status = SpecimenCollectionStatus.FORCOLLECTION; SpecimenWorkListitemCustomVoCollection list = domain.listWorkListItems(form.cmbRound().getValue(), status); displayRound(list); }
private SpecimenWorkListitemCustomVoCollection getWorkListItemsToprint() { SpecimenWorkListitemCustomVoCollection voColl = new SpecimenWorkListitemCustomVoCollection(); 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(form.dyngrdCollect().getColumns().get(PRINT_COL.intValue())); if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING)) { voColl.add((SpecimenWorkListitemCustomVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue()); } } } } return voColl; }
public PhlebotomyRoundVo savePhlebotomyRound(PhlebotomyRoundVo phlebotomyRoundItem, SpecimenWorkListitemCustomVoCollection collectionItems) throws StaleObjectException { //long t1 = System.currentTimeMillis(); DomainFactory factory = getDomainFactory(); PhlebotomyRound phlebotomyRoundItemBo = PhlebotomyRoundVoAssembler.extractPhlebotomyRound(factory, phlebotomyRoundItem); for (int i = 0; collectionItems!=null && i < collectionItems.size(); i++)//WDEV-12893 { SpecimenWorkListItem workListItemBo = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, collectionItems.get(i).getWorkListitemId()); if(workListItemBo.getSpecimen() != null && workListItemBo.getSpecimen().getOrder() != null && workListItemBo.getSpecimen().getOrder().getPatient() != null) { //workListItemBo.setWard(workListItemBo.getSpecimen().getOrder().getPatient().getWard()); workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId())); factory.save(workListItemBo); } else if (workListItemBo.getDFTOrderInvestigation() != null) { workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId())); workListItemBo.setCollectionStatus(factory.getLookupInstance(SpecimenCollectionStatus.COLLECTIONCOMPLETE.getId())); } phlebotomyRoundItemBo.getCollectionItems().add(workListItemBo); } factory.save(phlebotomyRoundItemBo); //long t2 = System.currentTimeMillis(); //System.out.println((t2-t1) + " ms"); return PhlebotomyRoundVoAssembler.create(phlebotomyRoundItemBo); }
private void listRound() { form.dyngrdCollect().getRows().clear(); form.getGlobalContext().Core.setPatientShort(null); //WDEV-16767 form.chkSelectAll().setValue(false); if(form.cmbRound().getValue() == null) { form.getGlobalContext().OCRR.setPhlebotomyCollectSearchCriteria(null); //WDEV-19389 return; } form.getGlobalContext().OCRR.setPhlebotomyCollectSearchCriteria(getSearchCriteria());//WDEV-19389 SpecimenCollectionStatus status = null; if(form.GroupFilter().getValue().equals(GroupFilterEnumeration.rdoCollected)) status = SpecimenCollectionStatus.COLLECTIONCOMPLETE; else if(form.GroupFilter().getValue().equals(GroupFilterEnumeration.rdoCouldNotCollect)) status = SpecimenCollectionStatus.COULDNOTCOLLECT; else if(form.GroupFilter().getValue().equals(GroupFilterEnumeration.rdoForCollection)) status = SpecimenCollectionStatus.FORCOLLECTION; SpecimenWorkListitemCustomVoCollection list = domain.listWorkListItems(form.cmbRound().getValue(), status); displayRound(list); }
protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException { if (checkSearchCriteria() == false) return; SelectItemVoCollection voCollSelectedWards = form.getGlobalContext().Core.getItems(); Integer[] wards = null; if (voCollSelectedWards != null) { int num = 0; for (int i = 0; i < voCollSelectedWards.size(); i++) { if (voCollSelectedWards.get(i).getSelectedIsNotNull() && voCollSelectedWards.get(i).getSelected().equals(Boolean.TRUE)) { num++; } } wards = new Integer[num]; int idx = 0; for (int i = 0; i < voCollSelectedWards.size(); i++) { if (voCollSelectedWards.get(i).getSelectedIsNotNull() && voCollSelectedWards.get(i).getSelected().equals(Boolean.TRUE)) { wards[idx++] = new Integer(voCollSelectedWards.get(i).getItem().getIGenericItemInfoID().intValue()); } } } SpecimenWorkListitemCustomVoCollection items = domain.listWorkListItems(wards, form.dteRequired().getValue(), (form.cmbRound().getValue() != null ? form.cmbRound().getValue().getTime() : null)); displayListItems(items); if(items == null || items.size() == 0) { engine.showMessage("There are currently no patients requiring phlebotomy on the selected wards"); } form.btnPrintClose().setEnabled(true); updateControlsState(); }
private void processPrintLabelsReport(String urlReportServer, QueryBuilderClient client) throws QueryBuilderClientException { SpecimenWorkListitemCustomVoCollection worklistItems = form.getGlobalContext().OCRR.getWorkListItems(); boolean useModalityReportsConfig = ConfigFlag.UI.USE_MODALITY_REPORTS_CONFIGURATION.getValue(); ServiceLiteVo modality = null; String[] report = null; String[] DFTReport = null; String[] pathologyReport = null; ArrayList<String> orderInvestigationAdded = new ArrayList<String>(); ArrayList<Integer> specimenAdded = new ArrayList<Integer>(); for(int i=0;i < worklistItems.size();i++) { int labelSetsNo = 1; boolean isDFT = worklistItems.get(i).getContainerQuantity() == null; client.getSeeds().clear(); if (isDFT) { if (worklistItems.get(i).getDftNoOfLabelSets() != null && worklistItems.get(i).getDftNoOfLabelSets() > 0) { labelSetsNo = worklistItems.get(i).getDftNoOfLabelSets(); } modality = domain.getModality(worklistItems.get(i).getOrderInvestigationId()); client.addSeed(new SeedValue("OrderInvestigation_id", worklistItems.get(i).getOrderInvestigationId(), Integer.class)); if(useModalityReportsConfig) { report = domain.getSystemReportAndTemplateByReportMapping(null, modality, isDFT); if(!validateModalityReports(report, report, !isDFT, isDFT, modality)) return; client.printReport(report[0], report[1], urlReportServer, form.qmbPrinterLabels().getValue(), labelSetsNo); } else { DFTReport = domain.getSystemReportAndTemplateByReportMapping(InvEventType.TIME_SERIES.getID(),null,null); if(!validateReports(null, null, DFTReport, null, false, false, true, false)) return; client.printReport(DFTReport[0], DFTReport[1], urlReportServer, form.qmbPrinterLabels().getValue(), labelSetsNo); } } //check if the report was already printed for this patient and specimen else if (!orderInvestigationAdded.contains(worklistItems.get(i).getPlacerOrdNum()) || !specimenAdded.contains(worklistItems.get(i).getOrderSpecimenId())) { orderInvestigationAdded.add(worklistItems.get(i).getPlacerOrdNum()); specimenAdded.add(worklistItems.get(i).getOrderSpecimenId()); modality = domain.getModalityBySpecimenId(worklistItems.get(i).getOrderSpecimenId()); client.addSeed(new SeedValue("OrderSpecimen_id", worklistItems.get(i).getOrderSpecimenId(), Integer.class)); if(useModalityReportsConfig) { report = domain.getSystemReportAndTemplateByReportMapping(null, modality, isDFT); if(!validateModalityReports(report, report, !isDFT, isDFT, modality)) return; client.printReport(report[0], report[1], urlReportServer, form.qmbPrinterLabels().getValue(), labelSetsNo); } else { pathologyReport = domain.getSystemReportAndTemplateByReportMapping(Category.PATHOLOGY.getID(),null,null); if(!validateReports(pathologyReport, null, null, null, true, false, false, false)) return; client.printReport(pathologyReport[0], pathologyReport[1], urlReportServer, form.qmbPrinterLabels().getValue(), labelSetsNo); } } } }
@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); }
private boolean search() { if (checkSearchCriteria() == false) return false; SelectItemVoCollection voCollSelectedWards = form.getGlobalContext().Core.getItems(); Integer[] wards = null; if (voCollSelectedWards != null) { int num = 0; for (int i = 0; i < voCollSelectedWards.size(); i++) { if (voCollSelectedWards.get(i).getSelectedIsNotNull() && voCollSelectedWards.get(i).getSelected().equals(Boolean.TRUE)) { num++; } } wards = new Integer[num]; int idx = 0; for (int i = 0; i < voCollSelectedWards.size(); i++) { if (voCollSelectedWards.get(i).getSelectedIsNotNull() && voCollSelectedWards.get(i).getSelected().equals(Boolean.TRUE)) { wards[idx++] = new Integer(voCollSelectedWards.get(i).getItem().getIGenericItemInfoID().intValue()); } } } SpecimenWorkListitemCustomVoCollection items = domain.listWorkListItems(wards, form.dteRequired().getValue(), (form.cmbRound().getValue() != null ? form.cmbRound().getValue().getTime() : null)); displayListItems(items); if(items == null || items.size() == 0) { engine.showMessage("There are currently no patients requiring phlebotomy on the selected wards"); } form.btnPrintClose().setEnabled(true); updateControlsState(); return true; }