public ims.emergency.vo.TrackingForEDPartialAdmissionVo getTrackingForEdPartialAdmission(ims.emergency.vo.TrackingRefVo trackingRef) { if (trackingRef == null || trackingRef.getID_Tracking() == null) { throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID "); List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() }); if (list!=null && list.size()>0) { return TrackingForEDPartialAdmissionVoAssembler.create((Tracking) list.get(0)); } return null; }
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException { if (edPartialAdmissionToSave == null && trackingToSave == null) throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo "); DomainFactory factory = getDomainFactory(); if (edPartialAdmissionToSave != null && trackingToSave == null) { if (!edPartialAdmissionToSave.isValidated()) throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated."); EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave); factory.save(domainEDPartialAdmissionToSave); return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave); } else if (edPartialAdmissionToSave == null && trackingToSave != null) { if (!trackingToSave.isValidated()) throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated."); Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave); factory.save(domainTrackingforReferral); TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral); if (track != null) return track.getCurrentPartialAdmission(); } return null; }