public static ims.clinical.configuration.domain.objects.WorkflowInternalReferrals
      extractWorkflowInternalReferrals(
          ims.domain.ILightweightDomainFactory domainFactory,
          ims.clinicaladmin.vo.WorkflowInternalReferralsVo valueObject,
          HashMap domMap) {
    if (null == valueObject) {
      return null;
    }
    Integer id = valueObject.getID_WorkflowInternalReferrals();
    ims.clinical.configuration.domain.objects.WorkflowInternalReferrals domainObject = null;
    if (null == id) {
      if (domMap.get(valueObject) != null) {
        return (ims.clinical.configuration.domain.objects.WorkflowInternalReferrals)
            domMap.get(valueObject);
      }
      // ims.clinicaladmin.vo.WorkflowInternalReferralsVo ID_WorkflowInternalReferrals field is
      // unknown
      domainObject = new ims.clinical.configuration.domain.objects.WorkflowInternalReferrals();
      domMap.put(valueObject, domainObject);
    } else {
      String key =
          (valueObject.getClass().getName() + "__" + valueObject.getID_WorkflowInternalReferrals());
      if (domMap.get(key) != null) {
        return (ims.clinical.configuration.domain.objects.WorkflowInternalReferrals)
            domMap.get(key);
      }
      domainObject =
          (ims.clinical.configuration.domain.objects.WorkflowInternalReferrals)
              domainFactory.getDomainObject(
                  ims.clinical.configuration.domain.objects.WorkflowInternalReferrals.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_WorkflowInternalReferrals());

    domainObject.setInpatientActions(
        ims.clinicaladmin.vo.domain.WorkflowActionInternalReferalVoAssembler
            .extractWorkflowActionInternalRefList(
                domainFactory,
                valueObject.getInpatientActions(),
                domainObject.getInpatientActions(),
                domMap));
    domainObject.setOutpatientActions(
        ims.clinicaladmin.vo.domain.WorkflowActionInternalReferalVoAssembler
            .extractWorkflowActionInternalRefList(
                domainFactory,
                valueObject.getOutpatientActions(),
                domainObject.getOutpatientActions(),
                domMap));

    return domainObject;
  }
 /**
  * Copy one ValueObject to another
  *
  * @param valueObjectDest to be updated
  * @param valueObjectSrc to copy values from
  */
 public static ims.clinicaladmin.vo.WorkflowInternalReferralsVo copy(
     ims.clinicaladmin.vo.WorkflowInternalReferralsVo valueObjectDest,
     ims.clinicaladmin.vo.WorkflowInternalReferralsVo valueObjectSrc) {
   if (null == valueObjectSrc) {
     return valueObjectSrc;
   }
   valueObjectDest.setID_WorkflowInternalReferrals(
       valueObjectSrc.getID_WorkflowInternalReferrals());
   valueObjectDest.setIsRIE(valueObjectSrc.getIsRIE());
   // InpatientActions
   valueObjectDest.setInpatientActions(valueObjectSrc.getInpatientActions());
   // OutpatientActions
   valueObjectDest.setOutpatientActions(valueObjectSrc.getOutpatientActions());
   return valueObjectDest;
 }