public ims.emergency.vo.EDAssessmentWoundImagesVo saveRecord(ims.emergency.vo.EDAssessmentWoundImagesVo record) throws ims.domain.exceptions.StaleObjectException { if (record == null) throw new CodingRuntimeException("Cannot save null EDAssessmentWoundImagesVo "); DomainFactory factory = getDomainFactory(); PatientWoundImages domainEDAssessmentWoundImages = EDAssessmentWoundImagesVoAssembler.extractPatientWoundImages(factory, record); factory.save(domainEDAssessmentWoundImages); return EDAssessmentWoundImagesVoAssembler.create(domainEDAssessmentWoundImages); }
public ims.emergency.vo.EDAssessmentWoundImagesVo getEDAssessmentWoundImageByPatient(ims.core.patient.vo.PatientRefVo patRef) { DomainFactory factory = getDomainFactory(); if (patRef == null ) { throw new CodingRuntimeException("Cannot get EDAssessmentWoundImagesVo on null Patient "); } StringBuffer hql = new StringBuffer(); hql.append("select e1_1 from PatientWoundImages as e1_1 left join e1_1.patient as p1_1 where (p1_1.id = :patid)"); List<?> list = factory.find(hql.toString(), new String[] {"patid"}, new Object[] {patRef.getID_Patient() }); if (list!=null && list.size()>0) return EDAssessmentWoundImagesVoAssembler.createEDAssessmentWoundImagesVoCollectionFromPatientWoundImages(list).get(0); return null; }