private void refreshRounds() { form.cmbRound().clear(); if (form.dteRequired().getValue() != null) { SpecimenCollectionListConfigDetailsVoCollection rounds = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, form.dteRequired().getValue()); if (rounds != null) { for (int i = 0; i < rounds.size(); i++) { form.cmbRound().newRow(rounds.get(i), rounds.get(i).getTime().getText()); } } } }
private void prePopulateListTypeTree() { SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService()); ims.framework.cn.data.TreeNode[] parentNodes = collMethods.getRootNodes(); for(int i=0;i<parentNodes.length;i++) { ims.framework.cn.data.TreeNode parentNode = parentNodes[i]; TreeNode ctrlNode = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().add(parentNode, ((SpecimenCollectionMethod)parentNode).getText()); for(int p=0;p<parentNode.getChildren().length;p++) { ims.framework.cn.data.TreeNode childNode = parentNode.getChildren()[p]; ctrlNode.getNodes().add(childNode, ((SpecimenCollectionMethod)childNode).getText()); } ctrlNode.setExpanded(true); } }
private SpecimenCollectionMethod getTreeTypesCheckBoxSelectedValue() { for (int i = 0; i < form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().size(); i++) { TreeNode node = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().get(i); if (node.isChecked()) return (SpecimenCollectionMethod) node.getValue(); for (int p = 0; p < node.getNodes().size(); p++) { if (node.getNodes().get(p).isChecked()) return (SpecimenCollectionMethod) node.getNodes().get(p).getValue(); } } return null; }
private void dteCollectValueChanged() { Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().getValue(); form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().clear(); if (date == null) return; if (date.isLessThan(new Date())) { engine.showMessage("Date cannot be in the past"); form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().setValue(null); return; } SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date); if (voCollCfg != null) { for (int i = 0; i < voCollCfg.size(); i++) form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText()); } }
private void prePopulateOtherControls() { SpecimenCollectionMethodCollection collTypes = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService()); for (int i = 0; i < collTypes.size(); i++) { if (collTypes.get(i).equals(SpecimenCollectionMethod.OTHER)) { for (int p = 0; p < collTypes.get(i).getChildren().length; p++) form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().newRow((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p], ((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p]).getText()); break; } } form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().setValue(new Date()); form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().setValue(SpecimenCollectionMethod.WARDCOLLECTION); form.lyrDetails().tabPathDetails().lyrPathology().tabOther().btnApplyOther().setEnabled(true); }
private void enableControls(SpecimenCollectionMethod value) { boolean enableInpatient = value != null && value.equals(SpecimenCollectionMethod.INPATIENT)?true:false; boolean enableOutpatient= value != null && value.equals(SpecimenCollectionMethod.OUTPATIENT)?true:false; form.lblDate().setVisible(enableInpatient); form.dteDate().setVisible(enableInpatient); form.lblRound().setVisible(enableInpatient); form.cmbRound().setVisible(enableInpatient); form.cmbRound().setRequired(enableInpatient); form.lblQuantity().setVisible(enableOutpatient); form.intQuantity().setVisible(enableOutpatient); form.intQuantity().setRequired(enableOutpatient); form.lblValue().setVisible(enableOutpatient); form.cmbValues().setVisible(enableOutpatient); form.cmbValues().setRequired(enableOutpatient); }
private void populateControls(SpecimenCollectionMethod value) { if(value != null) { if (value.equals(SpecimenCollectionMethod.OUTPATIENT)) { OutPatientDurationCollection collDuration = LookupHelper.getOutPatientDuration(domain.getLookupService()); if (form.cmbValues().getValues().size() == 0) { for (int i = 0; i < collDuration.size(); i++) { form.cmbValues().newRow(collDuration.get(i), collDuration.get(i).toString()); } } } else if (value.equals(SpecimenCollectionMethod.INPATIENT))//WDEV-16964 { form.dteDate().setValue(new Date()); dateChanged(); } } }
private void dateChanged() { Date date = form.dteDate().getValue(); form.cmbRound().clear(); if (date == null) return; if (date.isLessThan(new Date())) { engine.showMessage("Date cannot be in the past"); form.dteDate().setValue(null); return; } SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date); if (voCollCfg != null) { for (int i = 0; i < voCollCfg.size(); i++) form.cmbRound().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText()); } }
public SpecimenCollectionListConfigVo getSpecimenCollectionConfig(SpecimenCollectionMethod lookUpId) { if(lookUpId == null) throw new DomainRuntimeException("Id has not been provided for get call. "); DomainFactory factory = getDomainFactory(); List listSpecCollectionList = factory.find("from SpecimenCollectionListConfig sclc where sclc.listType = :ltype",new String[]{"ltype"},new Object[]{getDomLookup(lookUpId)}); if(listSpecCollectionList != null && listSpecCollectionList.size() > 0) { SpecimenCollectionListConfigVoCollection voCollSpecimen = SpecimenCollectionListConfigVoAssembler.createSpecimenCollectionListConfigVoCollectionFromSpecimenCollectionListConfig(listSpecCollectionList); if(voCollSpecimen != null && voCollSpecimen.size() > 0) return voCollSpecimen.get(0); } return null; }
protected void onBtnApplyOtherClick() throws PresentationLogicException { SpecimenCollectionMethod type = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().getValue(); Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().getValue(); Time time = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().timCollectOther().getValue(); applyDefaultsToOtherGrid(type, date, time); }
protected void onDyngrdPhlebCellValueChanged(DynamicGridCell cell) { DynamicGrid grid = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat(); if (cell.getType().equals(DynamicCellType.DATE)) { Date date = (Date) cell.getValue(); DynamicGridCell cellTimes = cell.getRow().getCells().get(grid.getColumns().getByIdentifier(DYN_COLTIME)); cellTimes.getItems().clear(); if (date != null) { if (date.isLessThan(new Date())) { engine.showMessage("Date cannot be in the past"); cell.setValue(null); return; } SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date); if (voCollCfg != null) { for (int i = 0; i < voCollCfg.size(); i++) cellTimes.getItems().newItem(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().toString()); } } } }
private void bindCellToLookup(DynamicGridCell cell, DynamicGrid grid) { if (cell == null || grid == null) throw new CodingRuntimeException("Coding Error - cell or grid is null (bindCellToLookup)"); if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat())) { cell.getItems().newItem(SpecimenCollectionMethod.INPATIENT, SpecimenCollectionMethod.INPATIENT.getText()); cell.getItems().newItem(SpecimenCollectionMethod.OUTPATIENT, SpecimenCollectionMethod.OUTPATIENT.getText()); } else if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther())) { SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService()); for (int i = 0; i < collMethods.size(); i++) { if (collMethods.get(i).equals(SpecimenCollectionMethod.OTHER)) { for (int p = 0; p < collMethods.get(i).getChildren().length; p++) cell.getItems().newItem(collMethods.get(i).getChildren()[p], (collMethods.get(i).getChildren()[p]).toString()); break; } } } cell.setIdentifier(SpecimenCollectionMethod.class); }
private void applyDefaultsToPhlebGrid(SpecimenCollectionSettings settings) { if (settings == null) throw new CodingRuntimeException("settings parameter in applyToPhlebGrid method is null"); // go through phleb grid setting defaults according to settings DynamicGrid dynGridPhleb = settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.INPATIENT) ? form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat() : form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat(); for (int i = 0; i < dynGridPhleb.getRows().size(); i++) { if (settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.INPATIENT)) { DynamicGridColumn colDate = dynGridPhleb.getColumns().getByIdentifier(DYN_COLDATE); DynamicGridColumn colTime = dynGridPhleb.getColumns().getByIdentifier(DYN_COLTIME); for (int p = 0; p < dynGridPhleb.getRows().get(i).getRows().size(); p++) { refreshGridDataForCollectionInfoInpatient(dynGridPhleb.getRows().get(i).getRows().get(p), colDate, colTime, settings); dynGridPhleb.getRows().get(i).getRows().get(p).getCells().get(dynGridPhleb.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(80); } } else if (settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.OUTPATIENT)) { DynamicGridColumn colAt = dynGridPhleb.getColumns().getByIdentifier(DYN_COLAT); DynamicGridColumn colDuration = dynGridPhleb.getColumns().getByIdentifier(DYN_COLDURATION); for (int p = 0; p < dynGridPhleb.getRows().get(i).getRows().size(); p++) { refreshGridDataForCollectionInfoOutpatient(dynGridPhleb.getRows().get(i).getRows().get(p), colAt, colDuration, settings); dynGridPhleb.getRows().get(i).getRows().get(p).getCells().get(dynGridPhleb.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(80); } } } }