/** * getNeonatalByCareContext */ public ims.clinical.vo.NeonatalVo getNeonatalByCareContext(ims.core.admin.vo.CareContextRefVo careContext) { if (careContext == null || careContext.getID_CareContext() == null) throw new CodingRuntimeException("careContext is null or id not provided in method getNeonatalByCareContext"); DomainFactory factory = getDomainFactory(); List nnItems = factory.find("from NeoNatal nn where nn.careContext.id = " + careContext.getID_CareContext()); if(nnItems != null && nnItems.size() > 0) return NeonatalVoAssembler.create((NeoNatal) nnItems.get(0)); return null; }
/** * saveNeonatal */ public void saveNeonatal(ims.clinical.vo.NeonatalVo neonatal, SummaryRefVo summary) throws ims.domain.exceptions.StaleObjectException { if (neonatal == null) throw new CodingRuntimeException("neonatal is null in method saveNeonatal"); if (!neonatal.isValidated()) throw new CodingRuntimeException("neonatal has not been validated in method saveNeonatal"); DomainFactory factory = getDomainFactory(); factory.save(NeonatalVoAssembler.extractNeoNatal(factory, neonatal)); //updating summary WDEV-11348 IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class); impl.updateSummaryIfRequired(neonatal, summary, factory); }