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 void updateControlsState() { form.ctnDetails().setCollapsed(!((form.grdPresentingProb().getValue() != null && form.getMode().equals(FormMode.VIEW)) || form.getMode().equals(FormMode.EDIT))); if (form.getMode() == FormMode.VIEW) { form.btnEdit().setVisible(form.grdPresentingProb().getValue() != null); form.btnEdit().setEnabled(form.grdPresentingProb().getValue() != null); } if (form.getMode() == FormMode.EDIT) { removePreactiveOrActiveLookup(); } form.getContextMenus().Emergency.getTriageNoteTemplateNewItem().setVisible(form.getMode().equals(FormMode.VIEW)); form.getContextMenus().Emergency.getTriageNoteTemplateEditItem().setVisible(form.getMode().equals(FormMode.VIEW) && form.grdPresentingProb().getValue() instanceof TriageNoteDefaultTextConfigVo); }
@Override protected void onGrdPresentingProbSelectionChanged() throws PresentationLogicException { TriageNoteDefaultTextConfigVo selectedTriageNote = null; selectedTriageNote = domain.getTriageNote(form.grdPresentingProb().getValue()); if (form.grdPresentingProb().getSelectedRow().getValue().getID_TriageNoteDefaultTextConfigIsNotNull() && domain.isStale(form.grdPresentingProb().getSelectedRow().getValue())) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); doSearch(); return; } form.getLocalContext().setSelectedTriageNote(selectedTriageNote); populateInstanceControlsFromData(selectedTriageNote); updateControlsState(); }
public Boolean isStale(TriageNoteDefaultTextConfigVo triageNote) { if (triageNote == null || triageNote.getID_TriageNoteDefaultTextConfig() == null) { throw new CodingRuntimeException("Cannot get TriageNoteVo on null Id "); } DomainFactory factory = getDomainFactory(); TriageNoteDefaultTextConfig domainTriageNote = (TriageNoteDefaultTextConfig) factory.getDomainObject(TriageNoteDefaultTextConfig.class, triageNote.getID_TriageNoteDefaultTextConfig()); if (domainTriageNote == null) { return true; } if (domainTriageNote.getVersion() > triageNote.getVersion_TriageNoteDefaultTextConfig()) { return true; } return false; }
private void populateInstanceControlsFromData(TriageNoteDefaultTextConfigVo selectedProblem) { clearContainerValues(); if (selectedProblem == null) return; if (selectedProblem.getDefaultTriageNoteIsNotNull()) { form.ctnDetails().qmbPresentingProblem().newRow(selectedProblem.getProblem(), selectedProblem.getProblem().getPCName()); form.ctnDetails().qmbPresentingProblem().setValue(selectedProblem.getProblem()); form.ctnDetails().richNote().setValue(selectedProblem.getDefaultTriageNote()); form.ctnDetails().cmbStatus().setValue(selectedProblem.getStatus()); } }
public TriageNoteDefaultTextConfigVo getDefaultTriageNote(ClinicalProblemRefVo clinicalProblemRef) { if(clinicalProblemRef == null || clinicalProblemRef.getID_ClinicalProblem() == null) throw new CodingRuntimeException("Cannot get default triage note for a null Presenting Problem Id."); DomainFactory factory = getDomainFactory(); String query = "select tn from TriageNoteDefaultTextConfig as tn left join tn.problem as p where p.id = :ProblemId and tn.status.id = :ActiveStatus "; List<?> defaultTriageNoteList = factory.find(query, new String[] {"ProblemId", "ActiveStatus"}, new Object[] {clinicalProblemRef.getID_ClinicalProblem(), PreActiveActiveInactiveStatus.ACTIVE.getID()}); if(defaultTriageNoteList == null || defaultTriageNoteList.size() == 0) return null; return TriageNoteDefaultTextConfigVoAssembler.create((TriageNoteDefaultTextConfig) defaultTriageNoteList.get(0)); }
public TriageNoteDefaultTextConfigVo getDefaultTriageNote(ClinicalProblemRefVo problem) { if(problem == null || problem.getID_ClinicalProblem() == null) throw new CodingRuntimeException("Cannot get default triage note for a null Presenting Problem Id."); DomainFactory factory = getDomainFactory(); String query = "select tn from TriageNoteDefaultTextConfig as tn left join tn.problem as p where p.id = :ProblemId and tn.status.id = :ActiveStatus "; List<?> defaultTriageNoteList = factory.find(query, new String[] {"ProblemId", "ActiveStatus"}, new Object[] {problem.getID_ClinicalProblem(), PreActiveActiveInactiveStatus.ACTIVE.getID()}); if(defaultTriageNoteList == null || defaultTriageNoteList.size() == 0) return null; return TriageNoteDefaultTextConfigVoAssembler.create((TriageNoteDefaultTextConfig) defaultTriageNoteList.get(0)); }
public TriageNoteDefaultTextConfigVo saveTriageNote(TriageNoteDefaultTextConfigVo triageNoteToSave) throws StaleObjectException { if (triageNoteToSave == null) throw new CodingRuntimeException("Cannot save null TriageNote"); if (!triageNoteToSave.isValidated()) throw new DomainRuntimeException("TriageNoteVo Not Validated."); DomainFactory factory = getDomainFactory(); TriageNoteDefaultTextConfig domainNote = TriageNoteDefaultTextConfigVoAssembler.extractTriageNoteDefaultTextConfig(factory, triageNoteToSave); factory.save(domainNote); return TriageNoteDefaultTextConfigVoAssembler.create(domainNote); }
public TriageNoteDefaultTextConfigVo getTriageNote(TriageNoteDefaultTextConfigRefVo triageNote) { if (triageNote == null || triageNote.getID_TriageNoteDefaultTextConfig() == null) { throw new CodingRuntimeException("Cannot get TriageNoteDefaultTextConfigVo on null Id "); } DomainFactory factory = getDomainFactory(); TriageNoteDefaultTextConfig domainTriageNote = (TriageNoteDefaultTextConfig) factory.getDomainObject(TriageNoteDefaultTextConfig.class, triageNote.getID_TriageNoteDefaultTextConfig()); return TriageNoteDefaultTextConfigVoAssembler.create(domainTriageNote); }
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; }
private boolean isStatusActive() { TriageNoteDefaultTextConfigVo voTriageNote = form.getLocalContext().getSelectedTriageNote(); return voTriageNote != null && voTriageNote.getStatusIsNotNull() && voTriageNote.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE); }
private boolean isStatusInactive() { TriageNoteDefaultTextConfigVo voTriageNote = form.getLocalContext().getSelectedTriageNote(); return voTriageNote != null && voTriageNote.getStatusIsNotNull() && voTriageNote.getStatus().equals(PreActiveActiveInactiveStatus.INACTIVE); }
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; }