public static ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings extractSkinAssessmentFindings( ims.domain.ILightweightDomainFactory domainFactory, ims.nursing.vo.SkinAssessmentFindings valueObject, HashMap domMap) { if (null == valueObject) { return null; } Integer id = valueObject.getID_SkinAssessmentFindings(); ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings domainObject = null; if (null == id) { if (domMap.get(valueObject) != null) { return (ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings) domMap.get(valueObject); } // ims.nursing.vo.SkinAssessmentFindings ID_SkinAssessmentFindings field is unknown domainObject = new ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings(); domMap.put(valueObject, domainObject); } else { String key = (valueObject.getClass().getName() + "__" + valueObject.getID_SkinAssessmentFindings()); if (domMap.get(key) != null) { return (ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings) domMap.get(key); } domainObject = (ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings) domainFactory.getDomainObject( ims.nursing.assessmenttools.domain.objects.SkinAssessmentFindings.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_SkinAssessmentFindings()); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value1 = null; if (null != valueObject.getWoundType()) { value1 = domainFactory.getLookupInstance(valueObject.getWoundType().getID()); } domainObject.setWoundType(value1); // This is to overcome a bug in both Sybase and Oracle which prevents them from storing an empty // string correctly // Sybase stores it as a single space, Oracle stores it as NULL. This fix will make them // consistent at least. if (valueObject.getSiteImage() != null && valueObject.getSiteImage().equals("")) { valueObject.setSiteImage(null); } domainObject.setSiteImage(valueObject.getSiteImage()); // This is to overcome a bug in both Sybase and Oracle which prevents them from storing an empty // string correctly // Sybase stores it as a single space, Oracle stores it as NULL. This fix will make them // consistent at least. if (valueObject.getSiteName() != null && valueObject.getSiteName().equals("")) { valueObject.setSiteName(null); } domainObject.setSiteName(valueObject.getSiteName()); // This is to overcome a bug in both Sybase and Oracle which prevents them from storing an empty // string correctly // Sybase stores it as a single space, Oracle stores it as NULL. This fix will make them // consistent at least. if (valueObject.getSiteDetails() != null && valueObject.getSiteDetails().equals("")) { valueObject.setSiteDetails(null); } domainObject.setSiteDetails(valueObject.getSiteDetails()); // This is to overcome a bug in both Sybase and Oracle which prevents them from storing an empty // string correctly // Sybase stores it as a single space, Oracle stores it as NULL. This fix will make them // consistent at least. if (valueObject.getHowLongIsItPresent() != null && valueObject.getHowLongIsItPresent().equals("")) { valueObject.setHowLongIsItPresent(null); } domainObject.setHowLongIsItPresent(valueObject.getHowLongIsItPresent()); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value6 = null; if (null != valueObject.getPressureSoreGrade()) { value6 = domainFactory.getLookupInstance(valueObject.getPressureSoreGrade().getID()); } domainObject.setPressureSoreGrade(value6); domainObject.setLength(valueObject.getLength()); domainObject.setWidth(valueObject.getWidth()); domainObject.setDepth(valueObject.getDepth()); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value10 = null; if (null != valueObject.getWoundBed()) { value10 = domainFactory.getLookupInstance(valueObject.getWoundBed().getID()); } domainObject.setWoundBed(value10); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value11 = null; if (null != valueObject.getSurroundingSkin()) { value11 = domainFactory.getLookupInstance(valueObject.getSurroundingSkin().getID()); } domainObject.setSurroundingSkin(value11); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value12 = null; if (null != valueObject.getExudateAmount()) { value12 = domainFactory.getLookupInstance(valueObject.getExudateAmount().getID()); } domainObject.setExudateAmount(value12); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value13 = null; if (null != valueObject.getExudateType()) { value13 = domainFactory.getLookupInstance(valueObject.getExudateType().getID()); } domainObject.setExudateType(value13); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value14 = null; if (null != valueObject.getOdour()) { value14 = domainFactory.getLookupInstance(valueObject.getOdour().getID()); } domainObject.setOdour(value14); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value15 = null; if (null != valueObject.getPain()) { value15 = domainFactory.getLookupInstance(valueObject.getPain().getID()); } domainObject.setPain(value15); domainObject.setInfectionSuspected(valueObject.getInfectionSuspected()); domainObject.setSwabTaken(valueObject.getSwabTaken()); domainObject.setWoundTraced(valueObject.getWoundTraced()); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value19 = null; if (null != valueObject.getCleansedWith()) { value19 = domainFactory.getLookupInstance(valueObject.getCleansedWith().getID()); } domainObject.setCleansedWith(value19); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value20 = null; if (null != valueObject.getPrimaryDressing()) { value20 = domainFactory.getLookupInstance(valueObject.getPrimaryDressing().getID()); } domainObject.setPrimaryDressing(value20); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value21 = null; if (null != valueObject.getSecondaryDressing()) { value21 = domainFactory.getLookupInstance(valueObject.getSecondaryDressing().getID()); } domainObject.setSecondaryDressing(value21); // create LookupInstance from vo LookupType ims.domain.lookups.LookupInstance value22 = null; if (null != valueObject.getFrequencyOfChange()) { value22 = domainFactory.getLookupInstance(valueObject.getFrequencyOfChange().getID()); } domainObject.setFrequencyOfChange(value22); // This is to overcome a bug in both Sybase and Oracle which prevents them from storing an empty // string correctly // Sybase stores it as a single space, Oracle stores it as NULL. This fix will make them // consistent at least. if (valueObject.getComment() != null && valueObject.getComment().equals("")) { valueObject.setComment(null); } domainObject.setComment(valueObject.getComment()); domainObject.setIsDiscontinuedAssess(valueObject.getIsDiscontinuedAssess()); domainObject.setIsContinuedAssessment(valueObject.getIsContinuedAssessment()); domainObject.setSkinAssessmentReview( ims.nursing.vo.domain.SkinAssessmentReviewAssembler.extractSkinAssessmentReviewSet( domainFactory, valueObject.getSkinAssessmentReview(), domainObject.getSkinAssessmentReview(), domMap)); return domainObject; }
/** * Copy one ValueObject to another * * @param valueObjectDest to be updated * @param valueObjectSrc to copy values from */ public static ims.nursing.vo.SkinAssessmentFindings copy( ims.nursing.vo.SkinAssessmentFindings valueObjectDest, ims.nursing.vo.SkinAssessmentFindings valueObjectSrc) { if (null == valueObjectSrc) { return valueObjectSrc; } valueObjectDest.setID_SkinAssessmentFindings(valueObjectSrc.getID_SkinAssessmentFindings()); valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE()); // WoundType valueObjectDest.setWoundType(valueObjectSrc.getWoundType()); // SiteImage valueObjectDest.setSiteImage(valueObjectSrc.getSiteImage()); // SiteName valueObjectDest.setSiteName(valueObjectSrc.getSiteName()); // SiteDetails valueObjectDest.setSiteDetails(valueObjectSrc.getSiteDetails()); // HowLongIsItPresent valueObjectDest.setHowLongIsItPresent(valueObjectSrc.getHowLongIsItPresent()); // PressureSoreGrade valueObjectDest.setPressureSoreGrade(valueObjectSrc.getPressureSoreGrade()); // Length valueObjectDest.setLength(valueObjectSrc.getLength()); // Width valueObjectDest.setWidth(valueObjectSrc.getWidth()); // Depth valueObjectDest.setDepth(valueObjectSrc.getDepth()); // WoundBed valueObjectDest.setWoundBed(valueObjectSrc.getWoundBed()); // SurroundingSkin valueObjectDest.setSurroundingSkin(valueObjectSrc.getSurroundingSkin()); // ExudateAmount valueObjectDest.setExudateAmount(valueObjectSrc.getExudateAmount()); // ExudateType valueObjectDest.setExudateType(valueObjectSrc.getExudateType()); // Odour valueObjectDest.setOdour(valueObjectSrc.getOdour()); // Pain valueObjectDest.setPain(valueObjectSrc.getPain()); // InfectionSuspected valueObjectDest.setInfectionSuspected(valueObjectSrc.getInfectionSuspected()); // SwabTaken valueObjectDest.setSwabTaken(valueObjectSrc.getSwabTaken()); // WoundTraced valueObjectDest.setWoundTraced(valueObjectSrc.getWoundTraced()); // CleansedWith valueObjectDest.setCleansedWith(valueObjectSrc.getCleansedWith()); // PrimaryDressing valueObjectDest.setPrimaryDressing(valueObjectSrc.getPrimaryDressing()); // SecondaryDressing valueObjectDest.setSecondaryDressing(valueObjectSrc.getSecondaryDressing()); // FrequencyOfChange valueObjectDest.setFrequencyOfChange(valueObjectSrc.getFrequencyOfChange()); // Comment valueObjectDest.setComment(valueObjectSrc.getComment()); // isDiscontinuedAssess valueObjectDest.setIsDiscontinuedAssess(valueObjectSrc.getIsDiscontinuedAssess()); // isContinuedAssessment valueObjectDest.setIsContinuedAssessment(valueObjectSrc.getIsContinuedAssessment()); // SkinAssessmentReview valueObjectDest.setSkinAssessmentReview(valueObjectSrc.getSkinAssessmentReview()); return valueObjectDest; }