コード例 #1
0
 /**
  * Copy one ValueObject to another
  *
  * @param valueObjectDest to be updated
  * @param valueObjectSrc to copy values from
  */
 public static ims.therapies.vo.WheelchairAssessmentVo copy(
     ims.therapies.vo.WheelchairAssessmentVo valueObjectDest,
     ims.therapies.vo.WheelchairAssessmentVo valueObjectSrc) {
   if (null == valueObjectSrc) {
     return valueObjectSrc;
   }
   valueObjectDest.setID_WheelchairAssessment(valueObjectSrc.getID_WheelchairAssessment());
   valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
   // AuthoringDateTime
   valueObjectDest.setAuthoringDateTime(valueObjectSrc.getAuthoringDateTime());
   // AuthoringCP
   valueObjectDest.setAuthoringCP(valueObjectSrc.getAuthoringCP());
   // ChairType
   valueObjectDest.setChairType(valueObjectSrc.getChairType());
   // SurfaceDistance
   valueObjectDest.setSurfaceDistance(valueObjectSrc.getSurfaceDistance());
   // PowerchairSkillsAssess
   valueObjectDest.setPowerchairSkillsAssess(valueObjectSrc.getPowerchairSkillsAssess());
   // WheelchairSkillsAssess
   valueObjectDest.setWheelchairSkillsAssess(valueObjectSrc.getWheelchairSkillsAssess());
   // ClinicalContact
   valueObjectDest.setClinicalContact(valueObjectSrc.getClinicalContact());
   return valueObjectDest;
 }
コード例 #2
0
  public static ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment
      extractWheelchairAssessment(
          ims.domain.ILightweightDomainFactory domainFactory,
          ims.therapies.vo.WheelchairAssessmentVo valueObject,
          HashMap domMap) {
    if (null == valueObject) {
      return null;
    }
    Integer id = valueObject.getID_WheelchairAssessment();
    ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment domainObject = null;
    if (null == id) {
      if (domMap.get(valueObject) != null) {
        return (ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment)
            domMap.get(valueObject);
      }
      // ims.therapies.vo.WheelchairAssessmentVo ID_WheelchairAssessment field is unknown
      domainObject = new ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment();
      domMap.put(valueObject, domainObject);
    } else {
      String key =
          (valueObject.getClass().getName() + "__" + valueObject.getID_WheelchairAssessment());
      if (domMap.get(key) != null) {
        return (ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment)
            domMap.get(key);
      }
      domainObject =
          (ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment)
              domainFactory.getDomainObject(
                  ims.therapies.mobilitytransfers.domain.objects.WheelchairAssessment.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_WheelchairAssessment());

    ims.framework.utils.DateTime dateTime1 = valueObject.getAuthoringDateTime();
    java.util.Date value1 = null;
    if (dateTime1 != null) {
      value1 = dateTime1.getJavaDate();
    }
    domainObject.setAuthoringDateTime(value1);
    domainObject.setAuthoringCP(
        ims.core.vo.domain.HcpAssembler.extractHcp(
            domainFactory, valueObject.getAuthoringCP(), domMap));
    // create LookupInstance from vo LookupType
    ims.domain.lookups.LookupInstance value3 = null;
    if (null != valueObject.getChairType()) {
      value3 = domainFactory.getLookupInstance(valueObject.getChairType().getID());
    }
    domainObject.setChairType(value3);
    domainObject.setSurfaceDistance(
        ims.therapies.vo.domain.WheelchairSurfaceDistanceVoAssembler
            .extractWheelchairSurfaceDistanceSet(
                domainFactory,
                valueObject.getSurfaceDistance(),
                domainObject.getSurfaceDistance(),
                domMap));
    domainObject.setPowerchairSkillsAssess(
        ims.therapies.vo.domain.PowerchairSkillsAssessmentVoAssembler
            .extractPowerchairSkillsAssessmentSet(
                domainFactory,
                valueObject.getPowerchairSkillsAssess(),
                domainObject.getPowerchairSkillsAssess(),
                domMap));
    domainObject.setWheelchairSkillsAssess(
        ims.therapies.vo.domain.WheelchairSkillsAssessmentVoAssembler
            .extractWheelchairSkillsAssessmentSet(
                domainFactory,
                valueObject.getWheelchairSkillsAssess(),
                domainObject.getWheelchairSkillsAssess(),
                domMap));
    ims.core.admin.domain.objects.ClinicalContact value7 = null;
    if (null != valueObject.getClinicalContact()) {
      if (valueObject.getClinicalContact().getBoId() == null) {
        if (domMap.get(valueObject.getClinicalContact()) != null) {
          value7 =
              (ims.core.admin.domain.objects.ClinicalContact)
                  domMap.get(valueObject.getClinicalContact());
        }
      } else if (valueObject.getBoVersion()
          == -1) // RefVo was not modified since obtained from the Assembler, no need to update the
                 // BO field
      {
        value7 = domainObject.getClinicalContact();
      } else {
        value7 =
            (ims.core.admin.domain.objects.ClinicalContact)
                domainFactory.getDomainObject(
                    ims.core.admin.domain.objects.ClinicalContact.class,
                    valueObject.getClinicalContact().getBoId());
      }
    }
    domainObject.setClinicalContact(value7);

    return domainObject;
  }