public DiagLiteVoCollection listDiagnosis(String name) { // Use StringBuilder to build the HQL query (more memory efficient) StringBuilder hqlQuery = new StringBuilder(); hqlQuery.append("from Diagnosis as diag"); 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(diag.diagnosisName) like :NAME"); paramNames.add("NAME"); paramValues.add("%" + name.toUpperCase() + "%"); } // Set order mode hqlQuery.append(" order by UPPER(diag.diagnosisName) asc"); return DiagLiteVoAssembler.createDiagLiteVoCollectionFromDiagnosis(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues)); }
private void populateSelectedDiagnosisGrid(DiagLiteVoCollection diagnosis, HashMap<DiagLiteVo, Integer> diagCollection) { form.dyngrdDiagnosis().getRows().clear(); if(diagnosis == null) return; for(DiagLiteVo diagnose : diagnosis) { if(diagnose == null) continue; Integer numberOfSameDiagnosis = diagCollection.get(diagnose); for(int i=0; i<numberOfSameDiagnosis; i++) { addSelectedDiagnoseRow(diagnose); } } }
private void populateComorbidityQcmb(String value) { form.qmbDiagnosis().clear(); DiagLiteVoCollection listDiag = domain.listDianosis(value, getListOfSelectedDiagnosis()); if (listDiag == null || listDiag.size() == 0) { form.qmbDiagnosis().showOpened(); return; } for (int i = 0 ; i < listDiag.size() ; i++) { form.qmbDiagnosis().newRow(listDiag.get(i),listDiag.get(i).getDiagnosisName()); } form.qmbDiagnosis().showOpened(); }
private void populateComorbidityQcmb(String value) throws DomainInterfaceException { form.qmbComorbidity().clear(); DiagLiteVoCollection listDiag = domain.listDiagnosis(value,getComorbiditiesAddedToIgnore()); if (listDiag == null || listDiag.size() == 0) { form.qmbComorbidity().showOpened(); return; } for (int i = 0 ; i < listDiag.size() ; i++) { form.qmbComorbidity().newRow(listDiag.get(i),listDiag.get(i).getDiagnosisName()); } form.qmbComorbidity().showOpened(); }
@Override protected void onQmbDiagnosisTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { DiagLiteVoCollection lisResults = domain.listDiagnosis(value); form.qmbDiagnosis().clear(); if (lisResults == null || lisResults.size() == 0) return; for (int i = 0; i < lisResults.size(); i++) { form.qmbDiagnosis().newRow(lisResults.get(i), lisResults.get(i).getDiagnosisName()); } if (lisResults.size() == 1) { form.qmbDiagnosis().setValue(lisResults.get(0)); } else { form.qmbDiagnosis().showOpened(); } }
@Override protected void onQmbDiagnosisTextSubmited(String value) throws PresentationLogicException { form.qmbDiagnosis().clear(); DiagLiteVoCollection listDiag = domain.listDianosis(value, null); if (listDiag == null || listDiag.size() == 0) { form.qmbDiagnosis().showOpened(); return; } for (int i = 0 ; i < listDiag.size() ; i++) { form.qmbDiagnosis().newRow(listDiag.get(i),listDiag.get(i).getDiagnosisName()); } form.qmbDiagnosis().showOpened(); }
@Override protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException { form.grdDiagnosis().getRows().clear(); form.btnSave().setEnabled(false); DiagLiteVoCollection coll; try { coll = domain.listDiagnosis(form.txtSearch().getValue()); } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); return; } if(coll == null || coll.size() == 0) { engine.showMessage("No diagnosis found !"); return; } displayDiagnosisCollection(coll); }
private void populateAvailableDiagnosesGrid(DiagLiteVoCollection diagosesToExclude) { form.grdAvailableDiagnosis().getRows().clear(); DiagLiteVoCollection dignosesList = getAvailableDiagnoses(diagosesToExclude, form.txtDiagName().getValue()); //WDEV-19273 if (dignosesList == null || dignosesList.size() == 0) { engine.showMessage("No records matching your search criteria were found!", "No results",MessageButtons.OK, MessageIcon.INFORMATION);//WDEV-19273 return; } for (int i = 0; i < dignosesList.size(); i++) { grdAvailableDiagnosisRow newRow = form.grdAvailableDiagnosis().getRows().newRow(); newRow.setColDiagnosis(dignosesList.get(i).getDiagnosisName()); newRow.setColSelect(Boolean.FALSE); newRow.setValue(dignosesList.get(i)); newRow.setTooltipForColDiagnosis(dignosesList.get(i).getDiagnosisName()); } }
private DiagLiteVoCollection getAvailableDiagnoses(DiagLiteVoCollection diagosesToExclude, String name) { String ids = ""; for (int i = 0; diagosesToExclude != null && i < diagosesToExclude.size(); i++) { if (ids == "") { ids = diagosesToExclude.get(i).getID_Diagnosis().toString(); } else { ids = ids + ", " + diagosesToExclude.get(i).getID_Diagnosis().toString(); } } DiagLiteVoCollection dignosesList = domain.getDiagnoses(ids, name); return dignosesList; }
private void populateSelectedDiagnosesGrid(DiagLiteVoCollection diagoses) { form.grdSelectedDiagnosis().getRows().clear(); if (diagoses == null || diagoses.size() == 0) return; for (int i = 0; i < diagoses.size(); i++) { grdSelectedDiagnosisRow newRow = form.grdSelectedDiagnosis().getRows().newRow(); newRow.setColDiagnosis(diagoses.get(i).getDiagnosisName()); newRow.setColSelect(Boolean.FALSE); newRow.setValue(diagoses.get(i)); if (!Boolean.TRUE.equals(diagoses.get(i).getIsActive())) { newRow.setTextColor(Color.Gray); } newRow.setTooltipForColDiagnosis(diagoses.get(i).getDiagnosisName()); } }
@Override protected void onImbRemoveClick() throws ims.framework.exceptions.PresentationLogicException { DiagLiteVoCollection remainingDiagnoses = new DiagLiteVoCollection(); for (int i = 0; i < form.grdSelectedDiagnosis().getRows().size(); i++) { if (Boolean.FALSE.equals(form.grdSelectedDiagnosis().getRows().get(i).getColSelect())) remainingDiagnoses.add(form.grdSelectedDiagnosis().getRows().get(i).getValue()); } populateSelectedDiagnosesGrid(remainingDiagnoses); if (form.txtDiagName().getValue() != null) populateAvailableDiagnosesGrid(form.grdSelectedDiagnosis().getValues()); //WDEV-19273 updateControlsState(); }
@Override protected void onImbAddClick() throws ims.framework.exceptions.PresentationLogicException { DiagLiteVoCollection diagnosesToBeAdded = new DiagLiteVoCollection(); for (int i = 0; i < form.grdAvailableDiagnosis().getRows().size(); i++) { if (Boolean.TRUE.equals(form.grdAvailableDiagnosis().getRows().get(i).getColSelect())) diagnosesToBeAdded.add(form.grdAvailableDiagnosis().getRows().get(i).getValue()); } addDignosesToSelectedDiagnosesGrid(diagnosesToBeAdded); populateAvailableDiagnosesGrid(form.grdSelectedDiagnosis().getValues()); updateControlsState(); }
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException { if(form.grdSelectedItems().getRows().size() == 0) { engine.showMessage("No items were selected."); return; } ProcedureLiteVoCollection procColl = new ProcedureLiteVoCollection(); DiagLiteVoCollection diagColl = new DiagLiteVoCollection(); ClinicalProblemShortVoCollection probColl = new ClinicalProblemShortVoCollection(); VaccineLiteVoCollection vaccColl = new VaccineLiteVoCollection(); for (int j = 0; j < form.grdSelectedItems().getRows().size(); j++) { grdSelectedItemsRow selRow = form.grdSelectedItems().getRows().get(j); if(selRow.getValue() instanceof ProcedureLiteVo) procColl.add((ProcedureLiteVo)selRow.getValue()); else if(selRow.getValue() instanceof DiagLiteVo) diagColl.add((DiagLiteVo)selRow.getValue()); else if(selRow.getValue() instanceof ClinicalProblemShortVo) probColl.add((ClinicalProblemShortVo)selRow.getValue()); else if(selRow.getValue() instanceof VaccineLiteVo) vaccColl.add((VaccineLiteVo) selRow.getValue()); } if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("P")) form.getGlobalContext().Clinical.setSelectedProcedures(procColl); else if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("D")) form.getGlobalContext().Clinical.setSelectedDiagnosis(diagColl); else if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("PR")) form.getGlobalContext().Clinical.setSelectedProblems(probColl); else if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("VACCINE")) form.getGlobalContext().Clinical.CCISearch.setSelectedVaccines(vaccColl); engine.close(DialogResult.OK); }
private void displayDiagnosisCollection(DiagLiteVoCollection coll) { for(int i = 0; i < coll.size(); i++) { grdItemsRow row = form.grdItems().getRows().newRow(); row.setValue(coll.get(i)); row.setcolItems(coll.get(i).getDiagnosisName()); row.setColumnSelect(false); } }
/** * @param szSearchCriteria */ private void listDiagnoses(String szSearchCriteria) { form.grdDiagnosis().getRows().clear(); clearInstanceControls(); DiagLiteVoCollection rcColl; try { rcColl = domain.listDiagnosisIncludeInactive(szSearchCriteria); } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); return; } if (rcColl.size() == 0) { engine.showMessage("No matching Diagnosis found"); return; } for (int i = 0; i< rcColl.size(); i++) { newInstanceRow(rcColl.get(i)); } if (rcColl.size() == 1) { form.grdDiagnosis().setValue(rcColl.get(0)); onGrdDiagnosisSelectionChanged(); } }
public DiagLiteVoCollection listDiagnosis(String filter) throws DomainInterfaceException { DiagLiteVoCollection coll = new DiagLiteVoCollection(); IGenericItem[] items = listIGenericItems(filter, CciType.DIAGNOSIS, true); if (items != null) { for ( int i = 0; i < items.length; i++) { coll.add((DiagLiteVo)items[i]); } return coll; } return null; }
/** * Function used to populate ICP Diagnosis * * @param diagnosisCollection */ private void populateICPDiagnosis(DiagLiteVoCollection diagnosisCollection) { // Clear diagnosis form.ctnConfiguration().lyrICPTabs().ICP().qmbICPDiagnosis().clear(); // Terminate function if the list is null if (diagnosisCollection == null) return; for (DiagLiteVo diagnose : diagnosisCollection) { // Skip null diagnose if (diagnose == null) continue; form.ctnConfiguration().lyrICPTabs().ICP().qmbICPDiagnosis().newRow(diagnose, diagnose.getDiagnosisName()); } if (diagnosisCollection.size() == 1) { form.ctnConfiguration().lyrICPTabs().ICP().qmbICPDiagnosis().setValue(diagnosisCollection.get(0)); } else { form.ctnConfiguration().lyrICPTabs().ICP().qmbICPDiagnosis().showOpened(); } }
private void sortSelectedDiagnosisGrid() { if(form.dyngrdDiagnosis().getRows().size() == 0) return; DiagLiteVoCollection diagnosis = new DiagLiteVoCollection(); HashMap<DiagLiteVo, Integer> diagCollection = new HashMap<DiagLiteVo, Integer>(); for(int i=0; i<form.dyngrdDiagnosis().getRows().size(); i++) { if(form.dyngrdDiagnosis().getRows().get(i).getValue() instanceof DiagLiteVo) { DiagLiteVo diag = (DiagLiteVo) form.dyngrdDiagnosis().getRows().get(i).getValue(); diagnosis.add(diag); if(diagCollection.containsKey(diag)) { Integer diagValue = diagCollection.get(diag); diagCollection.put(diag, ++diagValue); } else { diagCollection.put(diag, 1); } } } diagnosis.sort(); populateSelectedDiagnosisGrid(diagnosis, diagCollection); }
private void displayDiagnosisCollection(DiagLiteVoCollection coll) { for(int i = 0; i < coll.size(); i++) { grdDiagnosisRow row = form.grdDiagnosis().getRows().newRow(); row.setValue(coll.get(i)); row.setcolItems(coll.get(i).getDiagnosisName()); row.setColumnSelect(false); } }
private void doAddFromLocalSearch() { DiagLiteVoCollection diagList = form.getGlobalContext().Clinical.getSelectedDiagnosis(); for (int i=0; i < diagList.size(); i++) { boolean bFound = false; for (int j=0; j < form.grdChecklist().getRows().size(); j++) { if (form.grdChecklist().getRows().get(j).getColDiagnosis()!=null && form.grdChecklist().getRows().get(j).getColDiagnosis().equals(diagList.get(i).getDiagnosisName())) { bFound = true; engine.showMessage("Diagnosis record called \"" + diagList.get(i).getDiagnosisName() + "\" is already in list."); break; } } if(!bFound) { grdChecklistRow row = form.grdChecklist().getRows().newRow(); row.setColDiagnosis(diagList.get(i).getDiagnosisName()); row.setColSelect(PresentAbsentUnknown.PRESENT); row.setcolDescription(diagList.get(i).getDiagnosisName()); PatientDiagnosisVo voPresentDiagnosis = new PatientDiagnosisVo(); voPresentDiagnosis.setDiagnosis(diagList.get(i)); voPresentDiagnosis.setDiagnosisDescription(diagList.get(i).getDiagnosisName()); row.setValue(voPresentDiagnosis); } } }
public DiagLiteVoCollection listHotListDiagnosis(String diagName, Specialty specialty) throws DomainInterfaceException { if(diagName == null) throw new DomainRuntimeException("Invalid Search criteria. Diagnosis name filter must be supplied."); if(specialty == null) throw new DomainRuntimeException("Invalid Search criteria. Specialty must be supplied."); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select distinct item from DiagnosisHotlistItem item join item.diagnosis as diag join diag.keywords as kw "); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); hql.append(" where diag.isActive = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); hql.append(" and item.hotlist.specialty = :spec"); names.add("spec"); values.add(getDomLookup(specialty)); List hits = Keywords.searchByKeywords(factory, diagName, hql.toString(), names, values); List diags = new ArrayList(); for (int i = 0; i < hits.size(); i++) { diags.add(((DiagnosisHotlistItem)hits.get(i)).getDiagnosis()); } return DiagLiteVoAssembler.createDiagLiteVoCollectionFromDiagnosis(diags); }