private void doSearch() { clearInstanceControls(); form.grdPresentingProb().getRows().clear(); if (form.getMode().equals(FormMode.EDIT)) { form.setMode(FormMode.VIEW); } TriageNoteDefaultTextConfigVoCollection coll = null; coll = domain.listTriageNotes(form.qmbSearchPresentingProblem().getValue(), form.cmbSearchStatus().getValue()); if (coll == null || coll.size() == 0) { engine.showMessage("There are no Records for the Search Criteria Provided"); return; } populateScreenFromData(coll); }
private void populateScreenFromData(TriageNoteDefaultTextConfigVoCollection coll) { if (coll == null) return; if (form.getLocalContext().getSelectedTriageNote() != null) { form.grdPresentingProb().setValue(form.getLocalContext().getSelectedTriageNote()); } for (int i = 0; i < coll.size(); i++) { TriageNoteDefaultTextConfigVo triageNote = coll.get(i); grdPresentingProbRow row = form.grdPresentingProb().getRows().newRow(); row.setcolPresProbl(triageNote.getProblem().getPCName()); row.setcolDefaultTriageNote(triageNote.getDefaultTriageNote()); row.setTooltipForcolDefaultTriageNote(triageNote.getDefaultTriageNote()); row.setcolStatus(triageNote.getStatus().toString()); row.setValue(triageNote); } if (form.getLocalContext().getSelectedTriageNote() != null) { form.grdPresentingProb().setValue(form.getLocalContext().getSelectedTriageNote()); } }
public TriageNoteDefaultTextConfigVoCollection listTriageNotes(ClinicalProblemVo presentingProblem, LookupInstVo status) { DomainFactory factory = getDomainFactory(); String hql = " select tn from TriageNoteDefaultTextConfig as tn "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (presentingProblem != null) { condStr.append(andStr + " where tn.problem.id = :tName"); markers.add("tName"); values.add(presentingProblem.getID_ClinicalProblem()); andStr = " and "; } else andStr = " where "; if (status != null) { condStr.append(andStr + " tn.status.id = :tStatus"); markers.add("tStatus"); values.add(status.getID()); } condStr.append(" order by UPPER(tn.problem.pCName) asc"); hql += condStr.toString(); return TriageNoteDefaultTextConfigVoAssembler.createTriageNoteDefaultTextConfigVoCollectionFromTriageNoteDefaultTextConfig(factory.find(hql, markers, values)); }
public boolean save() throws ims.framework.exceptions.PresentationLogicException { TriageNoteDefaultTextConfigVo TriageNoteToSave = populateDataFromScreen(form.getLocalContext().getSelectedTriageNote()); String[] errors = TriageNoteToSave.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } // Check SOE if (TriageNoteToSave.getID_TriageNoteDefaultTextConfigIsNotNull() && domain.isStale(TriageNoteToSave)) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); doSearch(); return false; } // check if an active triage note already exists for the selected problem if (TriageNoteToSave.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)) { TriageNoteDefaultTextConfigVoCollection TriageNote = domain.listTriageNotes(TriageNoteToSave.getProblem(), TriageNoteToSave.getStatus()); if (TriageNote != null && TriageNote.getActiveCount() != 0 && !TriageNote.contains(TriageNoteToSave)) { engine.showMessage("An active note already exists for the selected problem.", "", MessageButtons.OK, MessageIcon.WARNING); return false; } } try { TriageNoteToSave = domain.saveTriageNote(TriageNoteToSave); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); doSearch(); return false; } form.getLocalContext().setSelectedTriageNote(TriageNoteToSave); return true; }
public boolean save() throws ims.framework.exceptions.PresentationLogicException { TriageNoteDefaultTextConfigVo TriageNoteToSave = populateDataFromScreen(form.getLocalContext().getSelectedTriageNote()); String[] errors = TriageNoteToSave.validate(validateUIErrorsMode()); //wdev-15998 if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } // Check SOE if (TriageNoteToSave.getID_TriageNoteDefaultTextConfigIsNotNull() && domain.isStale(TriageNoteToSave)) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); doSearch(); return false; } // check if an active triage note already exists for the selected problem if (TriageNoteToSave.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)) { TriageNoteDefaultTextConfigVoCollection TriageNote = domain.listTriageNotes(TriageNoteToSave.getProblem(), TriageNoteToSave.getStatus()); if (TriageNote != null && TriageNote.getActiveCount() != 0 && !TriageNote.contains(TriageNoteToSave)) { engine.showMessage("An active note already exists for the selected problem.", "", MessageButtons.OK, MessageIcon.WARNING); return false; } } try { TriageNoteToSave = domain.saveTriageNote(TriageNoteToSave); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); doSearch(); return false; } form.getLocalContext().setSelectedTriageNote(TriageNoteToSave); return true; }