/** * Save clinical info */ public ims.core.vo.DischargeClinicalInformationVo saveClinicalInfo(ims.core.vo.DischargeClinicalInformationVo voClinicalInfo) throws ims.domain.exceptions.DomainInterfaceException, 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 = DischargeClinicalInformationVoAssembler.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); return DischargeClinicalInformationVoAssembler.create(doClinInfo); }
/** * get Clinicalinte */ public ims.core.vo.DischargeClinicalInformationVo 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) { DischargeClinicalInformationVoCollection voColl = DischargeClinicalInformationVoAssembler.createDischargeClinicalInformationVoCollectionFromDischargeClinicalInformation(listNotes); if (voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }