/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.nursing.vo.CarePlanTemplateTitle copy( ims.nursing.vo.CarePlanTemplateTitle valueObjectDest, ims.nursing.vo.CarePlanTemplateTitle valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_CarePlanTemplate(valueObjectSrc.getID_CarePlanTemplate()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // CreationDate valueObjectDest.setCreationDate(valueObjectSrc.getCreationDate()); // AssessmentComponent valueObjectDest.setAssessmentComponent(valueObjectSrc.getAssessmentComponent()); // Title valueObjectDest.setTitle(valueObjectSrc.getTitle()); // Active valueObjectDest.setActive(valueObjectSrc.getActive()); 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.nursing.careplans.domain.objects.CarePlanTemplate */ public static ims.nursing.vo.CarePlanTemplateTitle insert( DomainObjectMap map, ims.nursing.vo.CarePlanTemplateTitle valueObject, ims.nursing.careplans.domain.objects.CarePlanTemplate domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_CarePlanTemplate(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; // CreationDate java.util.Date CreationDate = domainObject.getCreationDate(); if (null != CreationDate) { valueObject.setCreationDate(new ims.framework.utils.Date(CreationDate)); } // AssessmentComponent ims.domain.lookups.LookupInstance instance2 = domainObject.getAssessmentComponent(); if (null != instance2) { ims.framework.utils.ImagePath img = null; ims.framework.utils.Color color = null; img = null; if (instance2.getImage() != null) { img = new ims.framework.utils.ImagePath( instance2.getImage().getImageId(), instance2.getImage().getImagePath()); } color = instance2.getColor(); if (color != null) color.getValue(); ims.nursing.vo.lookups.AssessmentComponentType voLookup2 = new ims.nursing.vo.lookups.AssessmentComponentType( instance2.getId(), instance2.getText(), instance2.isActive(), null, img, color); ims.nursing.vo.lookups.AssessmentComponentType parentVoLookup2 = voLookup2; ims.domain.lookups.LookupInstance parent2 = instance2.getParent(); while (parent2 != null) { if (parent2.getImage() != null) { img = new ims.framework.utils.ImagePath( parent2.getImage().getImageId(), parent2.getImage().getImagePath()); } else { img = null; } color = parent2.getColor(); if (color != null) color.getValue(); parentVoLookup2.setParent( new ims.nursing.vo.lookups.AssessmentComponentType( parent2.getId(), parent2.getText(), parent2.isActive(), null, img, color)); parentVoLookup2 = parentVoLookup2.getParent(); parent2 = parent2.getParent(); } valueObject.setAssessmentComponent(voLookup2); } // Title valueObject.setTitle(domainObject.getTitle()); // Active valueObject.setActive(domainObject.isActive()); return valueObject; }