private ClinicalProblemShortVoCollection filterExistingProblems(ClinicalProblemShortVoCollection coll) { ClinicalProblemShortVoCollection existingColl = form.getGlobalContext().Clinical.getSelectedProblems(); if(existingColl == null || (existingColl != null && existingColl.size() == 0)) return coll; ClinicalProblemShortVoCollection newProblemColl = new ClinicalProblemShortVoCollection(); existingColl.sort(SortOrder.ASCENDING); coll.sort(SortOrder.ASCENDING); for (int i = 0; i < coll.size() ; i++) { if(existingColl.contains(coll.get(i))== false) { newProblemColl.add(coll.get(i)); } } //form.getGlobalContext().Clinical.setSelectedProblems(null); return newProblemColl; }
private void doSearch() { if (form.txtProblemSearch().getValue() == null || form.txtProblemSearch().getValue() != null && form.txtProblemSearch().getValue().length() < 3) //WDEV-15859 { engine.showMessage("Please enter a search string of at least 3 characters !"); return; } ClinicalProblemShortVoCollection collProblems = domain.listProblems(form.txtProblemSearch().getValue()); // form.getLocalContext().setselectedClinicianNote(null);// ----------- if (collProblems == null || collProblems.size() == 0) { engine.showMessage("No Problems found !"); return; } ClinicalProblemShortVoCollection filteredCollProblems = filterExistingProblems(collProblems); populateGridProblems(filteredCollProblems); }
private ClinicalProblemShortVoCollection filterExistingProblems(ClinicalProblemShortVoCollection collProblems) { ClinicalProblemShortVoCollection existingColl = form.getGlobalContext().Emergency.getSelectedProblems(); if (existingColl == null || (existingColl != null && existingColl.size() == 0)) return collProblems; ClinicalProblemShortVoCollection newProblemColl = new ClinicalProblemShortVoCollection(); existingColl.sort(SortOrder.ASCENDING); collProblems.sort(SortOrder.ASCENDING); for (int i = 0; i < collProblems.size(); i++) { if (existingColl.contains(collProblems.get(i)) == false) { newProblemColl.add(collProblems.get(i)); } } return newProblemColl; }
private void populateGridProblems(ClinicalProblemShortVoCollection collProblems) { if (collProblems == null) return; for (int i = 0; i < collProblems.size(); i++) { ClinicalProblemShortVo problem = collProblems.get(i); grdProblemsRow row = form.grdProblems().getRows().newRow(); row.setcolProblem(problem.getPCName()); row.setcolSelect(false); row.setValue(problem); } }
@Override protected void onBtnOkClick() throws PresentationLogicException { if (form.grdSelectedProblems().getRows().size() == 0) //WDEV-15859 { engine.showMessage("No items were selected."); return; } ClinicalProblemShortVoCollection collSelectedProblems = form.getGlobalContext().Emergency.getSelectedProblems(); for (int i = 0; i < form.grdSelectedProblems().getRows().size(); i++) { grdSelectedProblemsRow selRow = form.grdSelectedProblems().getRows().get(i); if (selRow.getcolSelect()) { collSelectedProblems.add(form.grdSelectedProblems().getRows().get(i).getValue()); } } form.getGlobalContext().Emergency.setSelectedProblems(collSelectedProblems); engine.close(DialogResult.OK); }
private void listPresentingProblems(String problemText) //WDEV-17647 { form.qmbPresentingProblem().clear(); ClinicalProblemShortVoCollection problems = domain.listClinicalProblems(problemText); if(problems == null || problems.size() == 0) return; for(ClinicalProblemShortVo problem : problems) { if(problem == null) continue; form.qmbPresentingProblem().newRow(problem, problem.getPCName()); } }
protected void populateProblems(ClinicalProblemShortVoCollection problems) //WDEV-17640 { // Clear problem query combo-box form.qmbProblem().clear(); // Check problem collection if (problems == null) { form.qmbProblem().showOpened(); return; } for (ClinicalProblemShortVo problem : problems) { form.qmbProblem().newRow(problem, problem.getPCName()); } }
private void listPresentingProblems(String problemText) { form.qmbPresentingProblem().clear(); ClinicalProblemShortVoCollection problems = domain.listClinicalProblems(problemText); if(problems == null || problems.size() == 0) return; for(ClinicalProblemShortVo problem : problems) { if(problem == null) continue; form.qmbPresentingProblem().newRow(problem, problem.getPCName()); } form.qmbPresentingProblem().showOpened(); }
private void populateProblemsGrid(ClinicalProblemShortVoCollection collProblems) { form.grdProblems().getRows().clear(); if (collProblems == null) return; collProblems.sort(new ProblemsNameComparator(SortOrder.ASCENDING)); for (int i = 0; i < collProblems.size(); i++) { ClinicalProblemShortVo clinicalProblem = collProblems.get(i); grdProblemsRow row = form.grdProblems().getRows().newRow(); row.setcolProblem(clinicalProblem.getPCName()); row.setValue(clinicalProblem); } }
public ClinicalProblemShortVoCollection listClinicalProblems(String searchText) { if(searchText == null) return null; searchText = searchText.trim().toUpperCase(); if(searchText == null || searchText.length() == 0) return null; DomainFactory factory = getDomainFactory(); String query = "select cp from ClinicalProblem as cp left join cp.keywords as k where (upper(cp.pCName) like :ClinicalProblemSearchText or upper(k.keyword) like :ClinicalProblemSearchText) and cp.isActive = 1 order by upper(cp.pCName) asc"; List<?> clinicalProblemsList = factory.find(query, new String[] {"ClinicalProblemSearchText"}, new Object[] {searchText + "%"}); return ClinicalProblemShortVoAssembler.createClinicalProblemShortVoCollectionFromClinicalProblem(clinicalProblemsList); }
public ClinicalProblemShortVoCollection listProblems(String name) { // Use StringBuilder to build the HQL query StringBuilder hqlQuery = new StringBuilder(); hqlQuery.append("SELECT problem "); hqlQuery.append(" FROM ClinicalProblem AS problem LEFT JOIN problem.keywords AS keyw "); 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(problem.pCName) LIKE :NAME"); hqlQuery.append(" OR UPPER(keyw.keyword) LIKE :NAME) AND problem.isActive = 1 "); paramNames.add("NAME"); paramValues.add("%" + name.toUpperCase() + "%"); } // Set order mode hqlQuery.append(" ORDER BY UPPER(problem.pCName) ASC"); return ClinicalProblemShortVoAssembler.createClinicalProblemShortVoCollectionFromClinicalProblem(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues)); }
private void addProblemsNotInstantiated() { Specialty lkpSpecialty = form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()?form.getGlobalContext().Core.getCurrentClinicalContact().getSpecialty():null; if (lkpSpecialty == null) lkpSpecialty = form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull()?form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialty():null; ClinicalProblemShortVoCollection voCollPresentingProblems = domain.listPresentingProblems(lkpSpecialty); if (voCollPresentingProblems != null) { for (int i = 0; i < voCollPresentingProblems.size(); i++) { GenForm.grdProblemsRow row = findPatientProblemRow(voCollPresentingProblems.get(i)); if (row == null) { row = form.grdProblems().getRows().newRow(); row.setcolProblems(voCollPresentingProblems.get(i)); // row.setcolProblemName(voCollPresentingProblems.get(i).getPCName()); row.setValue(voCollPresentingProblems.get(i)); setGridUIForAbsent(row); } } } }
@Override public ClinicalProblemShortVoCollection listProblems(String problemName) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (problemName == null || (problemName != null && problemName.trim().length() == 0)) throw new DomainRuntimeException("String for search is null."); String probNameLite = problemName != null ? problemName.toUpperCase() + "%" : "%%"; StringBuffer hql = new StringBuffer(); hql.append(" select probl from ClinicalProblem as probl left join probl.keywords as k where (probl.pCName like :ClinicalProblemSearchText or k.keyword like :ClinicalProblemSearchText) and probl.isActive = 1"); hql.append(" order by UPPER(probl.pCName) asc"); markers.add("ClinicalProblemSearchText"); values.add(probNameLite); return ClinicalProblemShortVoAssembler.createClinicalProblemShortVoCollectionFromClinicalProblem(factory.find(hql.toString(), markers, values)); }