/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.emergency.vo.TrackingForSeenByHCPVo copy( ims.emergency.vo.TrackingForSeenByHCPVo valueObjectDest, ims.emergency.vo.TrackingForSeenByHCPVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_Tracking(valueObjectSrc.getID_Tracking()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // Patient valueObjectDest.setPatient(valueObjectSrc.getPatient()); // CurrentArea valueObjectDest.setCurrentArea(valueObjectSrc.getCurrentArea()); // CurrentStatus valueObjectDest.setCurrentStatus(valueObjectSrc.getCurrentStatus()); // isDischarged valueObjectDest.setIsDischarged(valueObjectSrc.getIsDischarged()); // SeenBy valueObjectDest.setSeenBy(valueObjectSrc.getSeenBy()); // TriageDetails valueObjectDest.setTriageDetails(valueObjectSrc.getTriageDetails()); // SeenByNurse valueObjectDest.setSeenByNurse(valueObjectSrc.getSeenByNurse()); // Attendance valueObjectDest.setAttendance(valueObjectSrc.getAttendance()); return valueObjectDest; }
/** * Update the ValueObject with the Domain Object. * * @param map DomainObjectMap of DomainObjects to already created ValueObjects. * @param valueObject to be updated * @param domainObject ims.emergency.domain.objects.Tracking */ public static ims.emergency.vo.TrackingForSeenByHCPVo insert( DomainObjectMap map, ims.emergency.vo.TrackingForSeenByHCPVo valueObject, ims.emergency.domain.objects.Tracking domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_Tracking(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); // If this is a recordedInError record, and the domainObject // value isIncludeRecord has not been set, then we return null and // not the value object if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; // If this is not a recordedInError record, and the domainObject // value isIncludeRecord has been set, then we return null and // not the value object if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; // Patient if (domainObject.getPatient() != null) { if (domainObject.getPatient() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the // id already. { HibernateProxy p = (HibernateProxy) domainObject.getPatient(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setPatient(new ims.core.patient.vo.PatientRefVo(id, -1)); } else { valueObject.setPatient( new ims.core.patient.vo.PatientRefVo( domainObject.getPatient().getId(), domainObject.getPatient().getVersion())); } } // CurrentArea valueObject.setCurrentArea( ims.emergency.vo.domain.TrackingAreaLiteVoAssembler.create( map, domainObject.getCurrentArea())); // CurrentStatus valueObject.setCurrentStatus( ims.emergency.vo.domain.TrackingAttendanceStatusVoAssembler.create( map, domainObject.getCurrentStatus())); // isDischarged valueObject.setIsDischarged(domainObject.isIsDischarged()); // SeenBy valueObject.setSeenBy( ims.emergency.vo.domain.SeenByHCPVoAssembler.create(map, domainObject.getSeenBy())); // TriageDetails valueObject.setTriageDetails( ims.emergency.vo.domain.TriageForSeenByHcpVoAssembler.create( map, domainObject.getTriageDetails())); // SeenByNurse valueObject.setSeenByNurse( ims.emergency.vo.domain.SeenByHCPVoAssembler.create(map, domainObject.getSeenByNurse())); // Attendance valueObject.setAttendance( ims.emergency.vo.domain.AttendanceForSeenByHCPVoAssembler.create( map, domainObject.getAttendance())); return valueObject; }