private void populateTree(TreeNode[] collAvailable, ims.framework.controls.TreeNode parentNode, LookupInstanceCollection collSelected) { if (collAvailable == null) return; for (int i = 0; i < collAvailable.length; i++) { SpecimenSite site = (SpecimenSite) collAvailable[i]; ims.framework.controls.TreeNode itemNode = null; if (parentNode == null) itemNode = form.treInstances().getNodes().add(site, site.getText()); else itemNode = parentNode.getNodes().add(site, site.getText()); if(collSelected.indexOf(site) > -1) { itemNode.setChecked(true); if(itemNode.getParent() != null) itemNode.getParent().setChecked(true); } populateTree(collAvailable[i].getChildren(), itemNode, collSelected); } }
private void loadTree(LookupInstanceCollection collSelected) { ims.framework.cn.data.TreeNode[] nodes = null; if(form.getGlobalContext().Core.getSelectLookupType().getId() == SpecimenSite.TYPE_ID) { SpecimenSiteCollection collSites = LookupHelper.getSpecimenSite(domain.getLookupService()); nodes = collSites.getRootNodes(); } populateTree(nodes, null, collSelected); }
private SpecimenSiteCollection retrieveSelection(TreeNodeCollection collection, SpecimenSiteCollection collSelected) { for(int i=0;i<collection.size();i++) { ims.framework.controls.TreeNode node = collection.get(i); if(node.isChecked() && (node.getNodes() == null || node.getNodes().size() == 0)) collSelected.add((SpecimenSite) node.getValue()); retrieveSelection(node.getNodes(), collSelected); } return collSelected; }
private void populateSitesGrid() { // get the collection of lookup instances and add a site row for each // one LookupInstanceCollection collSelected = form.getGlobalContext().Core.getSelectedLookupInstances(); if (collSelected.size() == 0) { form.getContextMenus().getOCRRSpecimenSiteMOVE_UPItem().setVisible(false); form.getContextMenus().getOCRRSpecimenSiteMOVE_DOWNItem().setVisible(false); } form.lyrSelection().tabSites().grdSites().getRows().clear(); for (int i = 0; i < collSelected.size(); i++) { grdSitesRow row = form.lyrSelection().tabSites().grdSites().getRows().newRow(); row.setColSite((SpecimenSite) collSelected.getIndex(i)); row.setValue((SpecimenSite) collSelected.getIndex(i)); } form.getContextMenus().getOCRRSpecimenSiteSORTItem().setVisible(form.lyrSelection().tabSites().grdSites().getRows().size() > 0); if (form.lyrSelection().tabSites().grdSites().getSelectedRow() == null) { form.getContextMenus().getOCRRSpecimenSiteMOVE_UPItem().setVisible(false); form.getContextMenus().getOCRRSpecimenSiteMOVE_DOWNItem().setVisible(false); } }
/** * Launch SelectLookupInstances passing already selected sites * */ private void selectSites() { form.getGlobalContext().Core.setSelectLookupType(new LookupTypeVo(SpecimenSite.TYPE_ID)); SpecimenSiteCollection collSites = new SpecimenSiteCollection(); for (int i = 0; i < form.lyrSelection().tabSites().grdSites().getRows().size(); i++) { grdSitesRow row = form.lyrSelection().tabSites().grdSites().getRows().get(i); collSites.add(row.getColSite()); } form.getGlobalContext().Core.setSelectedLookupInstances(collSites); engine.open(form.getForms().Core.SelectLookupInstances); }
private void loadTree(LookupInstanceCollection collSelected) { ims.framework.cn.data.TreeNode[] nodes = null; LookupService lookupService = domain.getLookupService(); if(form.getGlobalContext().Core.getSelectLookupType().getId() == SpecimenSite.TYPE_ID) { SpecimenSiteCollection collSites = LookupHelper.getSpecimenSite(lookupService); nodes = collSites.getRootNodes(); } else if (form.getGlobalContext().Core.getSelectLookupType().getId() == StructuredCodingComment.TYPE_ID) { engine.setCaption("Select Comments"); StructuredCodingCommentCollection collComments = ims.clinical.vo.lookups.LookupHelper.getStructuredCodingComment(lookupService); nodes = collComments.getRootNodes(); } else if (form.getGlobalContext().Core.getSelectLookupType().getId() == ReferralUrgency.TYPE_ID) { engine.setCaption("Select Referral Urgencies"); ReferralUrgencyCollection collUrgencies = ims.RefMan.vo.lookups.LookupHelper.getReferralUrgency(lookupService); nodes = collUrgencies.getRootNodes(); } else if (form.getGlobalContext().Core.getSelectLookupType().getId() == ProfileListType.TYPE_ID) { engine.setCaption("Select List Type(s)"); ProfileListTypeCollection collListTypes = ims.scheduling.vo.lookups.LookupHelper.getProfileListType(lookupService); nodes = collListTypes.getRootNodes(); } populateTree(nodes, null, collSelected); form.chkSelectAll().setValue(allNodesChecked()); }
protected void onTreInstancesTreeViewCheck(ims.framework.controls.TreeNode node) throws PresentationLogicException { if (form.getGlobalContext().Core.getSelectLookupType().getId() == SpecimenSite.TYPE_ID) { if (node.getNodes() != null) { for(int i=0;i<node.getNodes().size();i++) { node.getNodes().get(i).setChecked(node.isChecked()); } } } form.chkSelectAll().setValue(form.chkSelectAll().getValue() && !node.isChecked() ? false : node.isChecked() && allNodesChecked()); }
public IfOrderInvestigationVo getOrderInvestigation(OcsOrderSessionRefVo order, IfInvestigationLiteVo investigation, SpecimenSite siteLookup, OrderSpecimenRefVo orderSpecimen,String placerNum, String fillerNum) { DomainFactory factory = getDomainFactory(); if((orderSpecimen==null||ConfigFlag.HL7.UNSOLICTED_NEW_SPECIMEN_PER_INVESTIGATION.getValue()) &&investigation.getInvestigationIndexIsNotNull() &&investigation.getInvestigationIndex().getCategoryIsNotNull() &&investigation.getInvestigationIndex().getCategory().equals(Category.PATHOLOGY) &&investigation.getEventTypeIsNotNull() &&(!investigation.getEventType().equals(InvEventType.TIME_SERIES))) { orderSpecimen = getSpecimenByPlacerOrFiller(order, placerNum, fillerNum, investigation); if(orderSpecimen==null) { return null; //No OrderSpecimen => No OrderInvestigation for pathology } } ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); StringBuffer hql = new StringBuffer(); hql.append("from OrderInvestigation c where "); hql.append(" c.investigation.id = :investigation "); names.add("investigation"); values.add(investigation.getID_Investigation()); hql.append(" and "); hql.append(" c.orderDetails.id = :orderDetails "); names.add("orderDetails"); values.add(order.getID_OcsOrderSession()); // wdev-3597 If the orderSpecimen is supplied, we want to include this in the query if (orderSpecimen != null) { hql.append(" and c.specimen.id = :specimenId"); names.add("specimenId"); values.add(orderSpecimen.getID_OrderSpecimen()); } // wdev-2618 If siteLookup is not null, then we need to link back to the specimen // object to select where they equal if (siteLookup != null) { hql.append(" and c.specimen.siteCd = :siteCd "); names.add("siteCd"); values.add(getDomLookup(siteLookup)); } java.util.List l = factory.find(hql.toString(), names, values); if (l == null || l.size() == 0) return null; if (l.size() > 1) throw new ims.domain.exceptions.DomainRuntimeException("Non-unique get call. " + hql + " returned " + l.size() + " records. " ); return IfOrderInvestigationVoAssembler.create((OrderInvestigation)l.get(0)); }