/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.nursing.vo.PlanOfCareListVo copy( ims.nursing.vo.PlanOfCareListVo valueObjectDest, ims.nursing.vo.PlanOfCareListVo valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_PlanOfCare(valueObjectSrc.getID_PlanOfCare()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // Actions valueObjectDest.setActions(valueObjectSrc.getActions()); // Group valueObjectDest.setGroup(valueObjectSrc.getGroup()); // Title valueObjectDest.setTitle(valueObjectSrc.getTitle()); // StartDateTime valueObjectDest.setStartDateTime(valueObjectSrc.getStartDateTime()); // ResolvedDateTime valueObjectDest.setResolvedDateTime(valueObjectSrc.getResolvedDateTime()); // AssessmentQuestion valueObjectDest.setAssessmentQuestion(valueObjectSrc.getAssessmentQuestion()); // LevelOfIntervention valueObjectDest.setLevelOfIntervention(valueObjectSrc.getLevelOfIntervention()); 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.domain.objects.PlanOfCare */ public static ims.nursing.vo.PlanOfCareListVo insert( DomainObjectMap map, ims.nursing.vo.PlanOfCareListVo valueObject, ims.nursing.domain.objects.PlanOfCare domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_PlanOfCare(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; // Actions valueObject.setActions( ims.nursing.vo.domain.PlanOfCareActionsVoAssembler .createPlanOfCareActionsVoCollectionFromPlanOfCareActions( map, domainObject.getActions())); // Group ims.domain.lookups.LookupInstance instance2 = domainObject.getGroup(); 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.clinical.vo.lookups.PlanOfCareGroupings voLookup2 = new ims.clinical.vo.lookups.PlanOfCareGroupings( instance2.getId(), instance2.getText(), instance2.isActive(), null, img, color); ims.clinical.vo.lookups.PlanOfCareGroupings 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.clinical.vo.lookups.PlanOfCareGroupings( parent2.getId(), parent2.getText(), parent2.isActive(), null, img, color)); parentVoLookup2 = parentVoLookup2.getParent(); parent2 = parent2.getParent(); } valueObject.setGroup(voLookup2); } // Title valueObject.setTitle(domainObject.getTitle()); // StartDateTime java.util.Date StartDateTime = domainObject.getStartDateTime(); if (null != StartDateTime) { valueObject.setStartDateTime(new ims.framework.utils.DateTime(StartDateTime)); } // ResolvedDateTime java.util.Date ResolvedDateTime = domainObject.getResolvedDateTime(); if (null != ResolvedDateTime) { valueObject.setResolvedDateTime(new ims.framework.utils.DateTime(ResolvedDateTime)); } // AssessmentQuestion valueObject.setAssessmentQuestion( ims.core.vo.domain.AssessmentQuestionShortVoAssembler.create( map, domainObject.getAssessmentQuestion())); // LevelOfIntervention valueObject.setLevelOfIntervention(domainObject.getLevelOfIntervention()); return valueObject; }