/** * 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)); }
/** * 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); }