public ProcedureLiteVoCollection getAvailableProcedures(String procedures, String filter) { DomainFactory factory=getDomainFactory(); String query = "from Procedure as p where p.isActive = 1 "; if(filter != null && filter.length() > 0) { query += " and p.procedureName like :Proc"; } if(procedures != null && procedures.length() > 0) { query += " and p.id not in (" + procedures + ") "; } List<?> procs=factory.find(query, new String[]{"Proc"}, new Object[]{filter + "%"}); return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procs); }
/** * Function used to populate the Procedures collection from procedures grid * on ICP tab * * @return */ private ProcedureLiteVoCollection getProcedures() { // Create a new procedures collection ProcedureLiteVoCollection procedures = new ProcedureLiteVoCollection(); // Add each procedure to collection for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().ICP().grdICPProcedures().getRows().size(); i++) { ProcedureLiteVo procedure = form.ctnConfiguration().lyrICPTabs().ICP().grdICPProcedures().getRows().get(i).getValue(); if (procedure == null) continue; procedures.add(procedure); } return procedures; }
public ProcedureLiteVoCollection listProcedures(String name) { // Use StringBuilder to build the HQL query (more memory efficient) StringBuilder hqlQuery = new StringBuilder(); hqlQuery.append("from Procedure as proc"); // Declare the ArrayList for parameters names and parameters values ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); // Create parameters string if (name != null && name.length() > 0) { hqlQuery.append(" where UPPER(proc.procedureName) like :NAME"); paramNames.add("NAME"); paramValues.add("%" + name.toUpperCase() + "%"); } // Set order mode hqlQuery.append(" order by UPPER(proc.procedureName) asc"); return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues)); }
@Override protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException { if(form.lyrDetails().tabListOwners().grdListOwner().getRows().size() == 0) return; row.getcolProcedure().clear(); HcpRefVoCollection voCollHcp = new HcpRefVoCollection(); for(int i=0;i<form.lyrDetails().tabListOwners().grdListOwner().getRows().size();i++) voCollHcp.add ((HcpRefVo) form.lyrDetails().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue()); ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text); if(voCollProcedure != null) { for(ProcedureLiteVo voProc : voCollProcedure) row.getcolProcedure().newRow(voProc, voProc.getProcedureName()); if(voCollProcedure.size() > 1) row.getcolProcedure().showOpened(); else if(voCollProcedure.size() == 1) row.getcolProcedure().setValue(voCollProcedure.get(0)); else engine.showMessage("No matching records found"); } }
@Override protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException { if(form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size() == 0) return; row.getcolProcedure().clear(); HcpRefVoCollection voCollHcp = new HcpRefVoCollection(); for(int i=0;i<form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size();i++) voCollHcp.add ((HcpRefVo) form.lyrSessEdit().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue()); ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text); if(voCollProcedure != null) { for(ProcedureLiteVo voProc : voCollProcedure) row.getcolProcedure().newRow(voProc, voProc.getProcedureName()); if(voCollProcedure.size() > 1) row.getcolProcedure().showOpened(); else if(voCollProcedure.size() == 1) row.getcolProcedure().setValue(voCollProcedure.get(0)); else engine.showMessage("No matching records found"); } }
private void addProcedures() throws PresentationLogicException { ProcedureLiteVoCollection selectedProcedures = form.getGlobalContext().Clinical.getSelectedProcedures(); if (selectedProcedures == null || selectedProcedures.size() == 0) return; DynamicGridRow selectedRow = form.dyngrdMain().getSelectedRow(); if (selectedRow == null) throw new PresentationLogicException("A selected row was expected"); if (selectedRow.getValue() instanceof ProcedureLiteVo) selectedRow = selectedRow.getParent(); DynamicGridRow newRow = null; for (int i = 0 ; i < selectedProcedures.size() ; i++) newRow = addProcedureToGrid(selectedRow, selectedProcedures.get(i)); form.getLocalContext().setCurrentEditedConsultant(getConsultantParent(selectedRow)); form.getLocalContext().getCurrentEditedConsultant().setExpanded(true,true); selectedRow.setExpanded(true, true); form.dyngrdMain().setSelectedRow(newRow); updateControlState(); if (FormMode.VIEW.equals(form.getMode())) form.setMode(FormMode.EDIT); }
private void doSearchAndShowInGrid() throws PresentationLogicException { form.grdProcedures().getRows().clear(); ProcedureLiteVoCollection procs = null; try { procs = domain.listProcedures(form.cmbSpeciality().getValue(), form.txtProcName().getValue()); } catch (DomainInterfaceException e) { throw new PresentationLogicException(e); } if (procs == null || procs.size() == 0) { engine.showMessage( "No Procedures were found. Please modify your search criteria","No results", MessageButtons.OK, MessageIcon.INFORMATION); return; } populateGridProceduresFromData(procs); }
private ProcedureLiteVoCollection getSelectedProceduresFromGridProcedure() { grdProceduresRowCollection rows = form.grdProcedures().getRows(); if (rows == null || rows.size() == 0) return null; ProcedureLiteVoCollection value = new ProcedureLiteVoCollection(); for (int i = 0; i < rows.size(); i++) { grdProceduresRow proceduresRow = rows.get(i); if (proceduresRow.getColumnSelect() == true) { value.add(proceduresRow.getValue()); } } return value; }
private ProcedureLiteVoCollection getSelectedProceduresFromGridSelectedProcedure() { grdSelectedProceduresRowCollection rows = form.grdSelectedProcedures().getRows(); if (rows == null || rows.size() == 0) return null; ProcedureLiteVoCollection value = new ProcedureLiteVoCollection(); for (int i = 0; i < rows.size(); i++) { grdSelectedProceduresRow proceduresRow = rows.get(i); if (proceduresRow.getColumnSelect() == true) { value.add(proceduresRow.getValue()); } } return value; }
private void populateSelectedProcedureGrid(ProcedureLiteVoCollection procedures, HashMap<ProcedureLiteVo, Integer> procCollection) { form.dyngrdProcedures().getRows().clear(); if(procedures == null) return; for(ProcedureLiteVo procedure : procedures) { if(procedure == null) continue; Integer numberOfSameProcedure = procCollection.get(procedure); for(int i=0; i<numberOfSameProcedure; i++) { addSelectedProcedureRow(procedure); } } }
private void populateProceduresQcmb(String value) { form.qmbProcedure().clear(); ProcedureLiteVoCollection listProc = domain.listProcedures(value, getListOfSelectedProcedures()); if (listProc == null || listProc.size() == 0) { form.qmbProcedure().showOpened(); return; } for (int i = 0 ; i < listProc.size() ; i++) { form.qmbProcedure().newRow(listProc.get(i),listProc.get(i).getProcedureName()); } form.qmbProcedure().showOpened(); }
private void addProcedure() { ProcedureLiteVoCollection unavailableProcedures=new ProcedureLiteVoCollection(); ProcedureLiteVoCollection associatedProcedures=new ProcedureLiteVoCollection(); for (int z=0;z<form.tre().getSelectedNode().getNodes().size();z++) { associatedProcedures.add((ProcedureLiteVo) form.tre().getSelectedNode().getNodes().get(z).getValue()); } form.getGlobalContext().RefMan.setAssociatedProcedures(associatedProcedures); for (int i=0;i<form.tre().getNodes().size();i++) { for (int j=0;j<form.tre().getNodes().get(i).getNodes().size();j++) { unavailableProcedures.add((ProcedureLiteVo) form.tre().getNodes().get(i).getNodes().get(j).getValue()); } } form.getGlobalContext().RefMan.setunavailableProcedures(unavailableProcedures); engine.open(form.getForms().RefMan.SelectProcedure); }
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { ProcedureLiteVoCollection showProcedures=new ProcedureLiteVoCollection(); ProcedureLiteVoCollection procedures = domain.listProcedures(); ProcedureLiteVoCollection existingProcedures = form.getGlobalContext().RefMan.getunavailableProcedures(); if (existingProcedures==null) { showProcedures=procedures; } else { for (ProcedureLiteVo item: procedures) { if (!existingProcedures.contains(item)) showProcedures.add(item); } } populateSelectProceduresGrid(showProcedures); populateSelectedProceduresGrid(form.getGlobalContext().RefMan.getAssociatedProcedures()); }
private void searchandList() { String[] errors = validateUIRules(); if (errors != null && errors.length>0) { engine.showErrors(errors); return; } ProcedureLiteVoCollection results = domain.listProcedures(form.cmbCategory().getValue(), form.txtProcedureName().getValue(),form.getLocalContext().getHcpFilter()); //WDEV-14740 //TODO up if (results == null) { form.grdItems().getRows().clear(); engine.showMessage("No results", "No Procedures were found", MessageButtons.OK, MessageIcon.INFORMATION); return; } populateGrid(results); }
private void populateGrid(ProcedureLiteVoCollection procs) { form.grdItems().getRows().clear(); if (procs == null) return; for (int i=0 ; i < procs.size(); i++) { ProcedureLiteVo proc = procs.get(i); if (proc != null ) { grdItemsRow nRow = form.grdItems().getRows().newRow(); nRow.setcolProcedureName(proc.getProcedureName()); nRow.setValue(proc); } } }
@Override protected void onQmbProcedureTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { ProcedureLiteVoCollection lisResults = domain.listProcedures(value); form.qmbProcedure().clear(); if (lisResults == null || lisResults.size() == 0) return; for (int i = 0; i < lisResults.size(); i++) { form.qmbProcedure().newRow(lisResults.get(i), lisResults.get(i).getProcedureName()); } if (lisResults.size() == 1) { form.qmbProcedure().setValue(lisResults.get(0)); } else { form.qmbProcedure().showOpened(); } }
private void populateProcedurecombo(ProcedureLiteVoCollection listProcedure) { form.cmbProcedure().clear(); if (listProcedure != null) { for (ProcedureLiteVo item : listProcedure) { form.cmbProcedure().newRow(item, item.getProcedureName()); } if (listProcedure.size() == 1) { form.cmbProcedure().setValue(listProcedure.get(0)); procedureSelected(); } else if (listProcedure.size() > 1) form.cmbProcedure().showOpened(); } else { clearTextControls(); } }
private void populateProcedureQcombo(ProcedureLiteVoCollection listProcedure) { form.qmbProcedure().clear(); if (listProcedure != null) { for (ProcedureLiteVo item : listProcedure) { form.qmbProcedure().newRow(item, item.getProcedureName()); } if (listProcedure.size() == 1) { form.qmbProcedure().setValue(listProcedure.get(0)); procedureSelected(); } else if (listProcedure.size() > 1) form.qmbProcedure().showOpened(); } else { clearTextControls(); } }
/** * will call procedure List Impl to list procedures * @throws DomainInterfaceException */ public ProcedureLiteVoCollection listProcedures(String filter) throws DomainInterfaceException { CCIAdmin impl = (CCIAdmin)getDomainImpl(CCIAdminImpl.class); ProcedureLiteVoCollection coll = new ProcedureLiteVoCollection(); IGenericItem[] items = impl.listIGenericItems(filter, CciType.PROCEDURE, true); if (items != null) { for ( int i = 0; i < items.length; i++) { coll.add((ProcedureLiteVo)items[i]); } return coll; } return null; }
public ProcedureLiteVoCollection listProcedures(HcpLiteVo hcp,String text) { if (hcp == null || !hcp.getID_HcpIsNotNull()) throw new CodingRuntimeException("Provided hcp is null or doesn't have an id"); String hql = "select distinct proc from ConsultantProcedureCategory as cpc left join cpc.categoryProcedures " + "as cp left join cp.procedures as proc where (proc.isActive = 1 and proc.id is not null and cpc.performingHCP.id = :Hcp_Id "; ArrayList<String> pN =new ArrayList<String>(); ArrayList<Object> pV = new ArrayList<Object>(); pN.add("Hcp_Id"); pV.add(hcp.getID_Hcp()); if (text != null) { hql+=" and UPPER(proc.procedureName) like :name"; pN.add("name"); pV.add("%"+text.toUpperCase()+"%"); } hql+=")"; List<?> procedures=getDomainFactory().find(hql,pN,pV); if (procedures != null && procedures.size()>0) return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procedures); return null; }
private void doSearchAndShowInGrid() throws PresentationLogicException { form.grdProcedures().getRows().clear(); ProcedureLiteVoCollection procs = null; try { procs = domain.listProcedures(form.cmbSpeciality().getValue(), form.txtProcName().getValue(),form.getLocalContext().getProceduresWithoutOutpatientOnly()); //wdev-20233 } catch (DomainInterfaceException e) { throw new PresentationLogicException(e); } if (procs == null || procs.size() == 0) { engine.showMessage( "No Procedures were found. Please modify your search criteria","No results", MessageButtons.OK, MessageIcon.INFORMATION); return; } populateGridProceduresFromData(procs); }
private void selectAllProceduresFromCheckbox() throws PresentationLogicException { ProcedureLiteVoCollection procs = null; try { procs = domain.listProcedures(form.cmbSpeciality().getValue(), null, form.getLocalContext().getProceduresWithoutOutpatientOnly()); //wdev-20233 } catch (DomainInterfaceException e) { throw new PresentationLogicException(e); } if (procs == null || procs.size() == 0) { form.chkAllProcedures().setValue(false); engine.showMessage("No Procedures were found.","No results", MessageButtons.OK, MessageIcon.INFORMATION); return; } form.getGlobalContext().Clinical.setSelectedProcedures(procs); engine.close(DialogResult.OK); }
private void populateSecondaryProcedure(ProcedureLiteVoCollection procedures) { form.qmbIntendedProcedure2().clear(); form.cmbLaterality2().setValue(null); if (procedures == null) return; for (ProcedureLiteVo procedure : procedures) { form.qmbIntendedProcedure2().newRow(procedure, procedure.getProcedureName()); } if (procedures.size() == 1) { form.qmbIntendedProcedure2().setValue(procedures.get(0)); form.intSurgeryTime().setValue(null); } else { form.qmbIntendedProcedure2().showOpened(); } }