public EmergencyAttendanceInvestigationCodingVo saveInvestigationSequence(EmergencyAttendanceInvestigationCodingVo investigationSequence) throws StaleObjectException { if(investigationSequence == null) throw new CodingRuntimeException("Cannot save a null EmergencyAttendanceInvestigationCodingVo."); if(!investigationSequence.isValidated()) throw new CodingRuntimeException("EmergencyAttendanceInvestigationCodingVo is not validated."); DomainFactory factory = getDomainFactory(); EmergencyAttendanceInvestigationCoding doInv = EmergencyAttendanceInvestigationCodingVoAssembler.extractEmergencyAttendanceInvestigationCoding(factory, investigationSequence); factory.save(doInv); return EmergencyAttendanceInvestigationCodingVoAssembler.create(doInv); }
public EmergencyAttendanceInvestigationCodingVo getInvestigationSequence(CareContextRefVo emergencyAttendance) { if(emergencyAttendance == null || emergencyAttendance.getID_CareContext() == null) return null; DomainFactory factory = getDomainFactory(); String query = "select eaic from EmergencyAttendanceInvestigationCoding as eaic left join eaic.careContext as cc where cc.id = :ccID"; List<?> list = factory.find(query, new String[] {"ccID"}, new Object[] {emergencyAttendance.getID_CareContext()}); if(list != null && list.size() > 0) return EmergencyAttendanceInvestigationCodingVoAssembler.create((EmergencyAttendanceInvestigationCoding)list.get(0)); return null; }