@Override protected void onBtnEditClick() throws ims.framework.exceptions.PresentationLogicException { form.setMode(FormMode.EDIT); if(domain.hasDiagnosis(form.getGlobalContext().Core.getEpisodeofCareShort())) form.chkNoDiagnosis().setEnabled(false); else form.chkNoDiagnosis().setEnabled(true); if(domain.hasComplications(form.getGlobalContext().Core.getEpisodeofCareShort())) form.chkNoComplications().setEnabled(false); else form.chkNoComplications().setEnabled(true); if(domain.hasComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort())) form.chkNoCoMorbidity().setEnabled(false); else form.chkNoCoMorbidity().setEnabled(true); setSchoolControls(); DischargeClinicalInformationSTHKVo voClinInfo = form.getLocalContext().getSelectedRecord(); populatePatientAlerts(voClinInfo==null); makeAlertsSelectionsAndAddInactivatedItems(); //listAllResultsForTimePeriod(voClinInfo==null); WDEV-13262 form.getGlobalContext().Clinical.seteDischargeDisableTabs(true); }
/** * WDEV-12689 * Function used to retrieve Discharge Clinical Information */ public DischargeClinicalInformationSTHKVo getDischargeClinicalInformation(CareContextRefVo careContext) { if (careContext == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from DischargeClinicalInformation clininfo where clininfo.careContext.id = :CC_ID and clininfo.isRIE is null"); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); markers.add("CC_ID"); values.add(careContext.getID_CareContext()); return DischargeClinicalInformationSTHKVoAssembler.create((DischargeClinicalInformation) factory.findFirst(hql.toString(), markers, values)); }
public void open() { DischargeDetailsVo voDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext()); populateDD(voDD); DischargeClinicalInformationSTHKVo voClinInfo = domain.getClinicalInfo(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setSelectedRecord(voClinInfo); populatePatientAlerts(voClinInfo==null); populateScreenFromData(voClinInfo); setSchoolControls(); manageReadOnly(); }
/** * get Clinicalinte */ public ims.core.vo.DischargeClinicalInformationSTHKVo getClinicalInfo(ims.core.admin.vo.CareContextRefVo careContextRefVo) { if (careContextRefVo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if (careContextRefVo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from DischargeClinicalInformation clininfo where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " clininfo.careContext.id = :careContextId"); markers.add("careContextId"); values.add(careContextRefVo.getID_CareContext()); andStr = " and "; List listNotes = factory.find(hql.toString(), markers, values); if (listNotes != null && listNotes.size() > 0) { DischargeClinicalInformationSTHKVoCollection voColl = DischargeClinicalInformationSTHKVoAssembler.createDischargeClinicalInformationSTHKVoCollectionFromDischargeClinicalInformation(listNotes); if (voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
/** * Save clinical info */ public ims.core.vo.DischargeClinicalInformationSTHKVo saveClinicalInfo(DischargeClinicalInformationSTHKVo voClinicalInfo, SummaryRefVo summary) throws ims.domain.exceptions.StaleObjectException { if (voClinicalInfo == null) throw new CodingRuntimeException("DischargeClinicalInformationVo is null"); if (!voClinicalInfo.isValidated()) throw new CodingRuntimeException("DischargeClinicalInformationVo Value Object Alert has not been validated"); DomainFactory factory = getDomainFactory(); DischargeClinicalInformation doClinInfo = DischargeClinicalInformationSTHKVoAssembler.extractDischargeClinicalInformation(factory, voClinicalInfo);// // if (!voClinicalInfo.getID_DischargeClinicalInformationIsNotNull()) { List list = factory.find("from DischargeClinicalInformation as dci where dci.careContext.id = :CONTEXTID and dci.isRIE is null", new String[] { "CONTEXTID" }, new Object[] { voClinicalInfo.getCareContext().getID_CareContext() }); if (list != null && list.size() > 0) { throw new StaleObjectException(null); } } factory.save(doClinInfo); IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class); impl.updateSummaryIfRequired(voClinicalInfo, summary, factory); return DischargeClinicalInformationSTHKVoAssembler.create(doClinInfo); }
public boolean save() throws PresentationLogicException { ArrayList<String> screenErrors = new ArrayList<String>(); if (form.txtSummaryofInpatientEpisode().getValue() == null) screenErrors.add("Summary of Inpatient Episode is a mandatory item."); if (form.txtRelevantTreatmentsETC().getValue() == null) screenErrors.add("Relevant Treatments and Changes Made to Treatments is a mandatory item."); DischargeClinicalInformationSTHKVo voClinInfo = populateDataFromScreen(); boolean hasDiagnosis = domain.hasDiagnosis(form.getGlobalContext().Core.getEpisodeofCareShort()); boolean diagnosisCompleted = diagnosisCompleted(hasDiagnosis); if(voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !diagnosisCompleted) screenErrors.add("Diagnosis must be completed before marking Clinical Info as completed."); String[] arrErrors = voClinInfo.validate(); String[] arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrErrors); if (arrScreenAndVoErrors.length == 0) { //WDEV-11817 - Start if (voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.DIAGNOSIS) && !hasComplicationsComorbidityInfo() && !isDiagnosisConfirmed()) { form.getLocalContext().setDiagnosisConfirmMsgBoxId(engine.showMessage("Please confirm that diagnosis is complete", "Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION)); return false; } //WDEV-11817 - End try { voClinInfo = domain.saveClinicalInfo(voClinInfo, form.getLocalContext().getSTHKSummary()); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.setMode(FormMode.VIEW); open(); form.getGlobalContext().Clinical.seteDischargeDisableTabs(false); form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE); form.fireCustomControlValueChanged(); return false; } } else { engine.showErrors("Error", arrScreenAndVoErrors); return false; } saveDiagnosisDetails(); //WDEV-12847 form.setMode(FormMode.VIEW); form.getLocalContext().setSelectedRecord(voClinInfo); form.getGlobalContext().Clinical.seteDischargeDisableTabs(false); form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE); form.fireCustomControlValueChanged(); return true; }