/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.clinical.vo.PatientAbsentProcedureVo copy( ims.clinical.vo.PatientAbsentProcedureVo valueObjectDest, ims.clinical.vo.PatientAbsentProcedureVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_PatientAbsentProcedure(valueObjectSrc.getID_PatientAbsentProcedure()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // Procedure valueObjectDest.setProcedure(valueObjectSrc.getProcedure()); // Selected valueObjectDest.setSelected(valueObjectSrc.getSelected()); // SourceofInformation valueObjectDest.setSourceofInformation(valueObjectSrc.getSourceofInformation()); return valueObjectDest; }
public static ims.clinical.domain.objects.PatientAbsentProcedure extractPatientAbsentProcedure( ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PatientAbsentProcedureVo valueObject, HashMap domMap) { if (null == valueObject) { return null; } Integer id = valueObject.getID_PatientAbsentProcedure(); ims.clinical.domain.objects.PatientAbsentProcedure domainObject = null; if (null == id) { if (domMap.get(valueObject) != null) { return (ims.clinical.domain.objects.PatientAbsentProcedure) domMap.get(valueObject); } // ims.clinical.vo.PatientAbsentProcedureVo ID_PatientAbsentProcedure field is unknown domainObject = new ims.clinical.domain.objects.PatientAbsentProcedure(); domMap.put(valueObject, domainObject); } else { String key = (valueObject.getClass().getName() + "__" + valueObject.getID_PatientAbsentProcedure()); if (domMap.get(key) != null) { return (ims.clinical.domain.objects.PatientAbsentProcedure) domMap.get(key); } domainObject = (ims.clinical.domain.objects.PatientAbsentProcedure) domainFactory.getDomainObject( ims.clinical.domain.objects.PatientAbsentProcedure.class, id); // TODO: Not sure how this should be handled. Effectively it must be a staleobject exception, // but maybe should be handled as that further up. if (domainObject == null) return null; domMap.put(key, domainObject); } domainObject.setVersion(valueObject.getVersion_PatientAbsentProcedure()); // SaveAsRefVO - treated as a refVo in extract methods ims.core.clinical.domain.objects.Procedure value1 = null; if (null != valueObject.getProcedure()) { if (valueObject.getProcedure().getBoId() == null) { if (domMap.get(valueObject.getProcedure()) != null) { value1 = (ims.core.clinical.domain.objects.Procedure) domMap.get(valueObject.getProcedure()); } } else { value1 = (ims.core.clinical.domain.objects.Procedure) domainFactory.getDomainObject( ims.core.clinical.domain.objects.Procedure.class, valueObject.getProcedure().getBoId()); } } domainObject.setProcedure(value1); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value2 = null; if (null != valueObject.getSelected()) { value2 = domainFactory.getLookupInstance(valueObject.getSelected().getID()); } domainObject.setSelected(value2); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value3 = null; if (null != valueObject.getSourceofInformation()) { value3 = domainFactory.getLookupInstance(valueObject.getSourceofInformation().getID()); } domainObject.setSourceofInformation(value3); return domainObject; }