Exemple #1
0
  protected final void oncmbStatusValueSet(Object value) {
    java.util.ArrayList listOfValues = this.form.cmbStatus().getValues();

    if (value == null) {
      if (listOfValues != null && listOfValues.size() > 0) {
        for (int x = 0; x < listOfValues.size(); x++) {
          ims.core.vo.lookups.PreActiveActiveInactiveStatus existingInstance =
              (ims.core.vo.lookups.PreActiveActiveInactiveStatus) listOfValues.get(x);
          if (!existingInstance.isActive()) {
            bindcmbStatusLookup();
            return;
          }
        }
      }
    } else if (value instanceof ims.core.vo.lookups.PreActiveActiveInactiveStatus) {
      ims.core.vo.lookups.PreActiveActiveInactiveStatus instance =
          (ims.core.vo.lookups.PreActiveActiveInactiveStatus) value;

      if (listOfValues != null) {
        if (listOfValues.size() == 0) bindcmbStatusLookup();

        for (int x = 0; x < listOfValues.size(); x++) {
          ims.core.vo.lookups.PreActiveActiveInactiveStatus existingInstance =
              (ims.core.vo.lookups.PreActiveActiveInactiveStatus) listOfValues.get(x);
          if (existingInstance.equals(instance)) return;
        }
      }

      this.form
          .cmbStatus()
          .newRow(instance, instance.getText(), instance.getImage(), instance.getTextColor());
    }
  }
 public void populate(ims.vo.ValueObjectBeanMap map, ims.icp.vo.beans.ICPLiteVoBean bean) {
   this.id = bean.getId();
   this.version = bean.getVersion();
   this.name = bean.getName();
   this.description = bean.getDescription();
   this.status =
       bean.getStatus() == null
           ? null
           : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getStatus());
 }
 public AssessmentQuestionShortVo(ims.core.vo.beans.AssessmentQuestionShortVoBean bean) {
   this.id = bean.getId();
   this.version = bean.getVersion();
   this.ismandatory = bean.getIsMandatory();
   this.activestatus =
       bean.getActiveStatus() == null
           ? null
           : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getActiveStatus());
   this.sequence = bean.getSequence();
   this.allowsmultipleanswers = bean.getAllowsMultipleAnswers();
   this.isnonstandard = bean.getIsNonStandard();
   this.url = bean.getURL();
   this.protocol = bean.getProtocol();
   this.legendtext = bean.getLegendText();
 }
 public ScheduleConfigurationVo(ims.pci.vo.beans.ScheduleConfigurationVoBean bean) {
   this.id = bean.getId();
   this.version = bean.getVersion();
   this.schedulename = bean.getScheduleName();
   this.status =
       bean.getStatus() == null
           ? null
           : ims.core.vo.lookups.PreActiveActiveInactiveStatus.buildLookup(bean.getStatus());
   this.startdob = bean.getStartDob() == null ? null : bean.getStartDob().buildDate();
   this.enddob = bean.getEndDob() == null ? null : bean.getEndDob().buildDate();
   this.isdefaultschedule = bean.getIsDefaultSchedule();
   this.scheduletype =
       bean.getScheduleType() == null
           ? null
           : ims.pci.vo.lookups.ScheduleType.buildLookup(bean.getScheduleType());
   this.campaignstartdate =
       bean.getCampaignStartDate() == null ? null : bean.getCampaignStartDate().buildDate();
   this.stages =
       ims.pci.vo.StageConfigurationVoCollection.buildFromBeanCollection(bean.getStages());
 }
  public ContractConfigShortVoCollection listContracts(
      String name,
      OrganisationRefVo organisation,
      ReferralManagementContractType contractType,
      String contractId,
      PreActiveActiveInactiveStatus status,
      Boolean diagnostic,
      Boolean nonDiagnostic) {
    if ((name == null || name.length() == 0)
        && (organisation == null || !organisation.getID_OrganisationIsNotNull())
        && (contractId == null || contractId.length() == 0)
        && status == null
        && Boolean.FALSE.equals(diagnostic)
        && Boolean.FALSE.equals(nonDiagnostic)
        && contractType == null) // wdev-12676
    {
      throw new DomainRuntimeException("No search criteria specified");
    }

    StringBuilder hqlBuilder = new StringBuilder("from ContractConfig as cc where ( ");
    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();
    Boolean flagOpenParenthesiz = Boolean.FALSE;
    String and = "";
    if (contractId != null && contractId.length() > 0) {
      hqlBuilder.append("cc.contractId like :cID ");
      and = "and ";
      paramNames.add("cID");
      paramValues.add("%" + contractId + "%");
    }

    if (organisation != null && organisation.getID_OrganisationIsNotNull()) {
      hqlBuilder.append(and);
      hqlBuilder.append(" cc.contractOrganisation.id = :cOrg ");
      and = "and ";
      paramNames.add("cOrg");
      paramValues.add(organisation.getID_Organisation());
    }

    if (contractType != null) {
      hqlBuilder.append(and);
      hqlBuilder.append(" cc.contractType.id = :cType ");
      and = "and ";
      paramNames.add("cType");
      paramValues.add(contractType.getID());
    }

    if (name != null && name.length() > 0) {
      hqlBuilder.append(and);
      hqlBuilder.append(" cc.contractName like :cName ");
      and = "and ";
      paramNames.add("cName");
      paramValues.add("%" + name + "%");
    }
    if (status != null) {
      hqlBuilder.append(and);
      hqlBuilder.append(" cc.status.id = :status ");
      and = "and ";
      paramNames.add("status");
      paramValues.add(status.getID());
    }
    // wdev-12676

    if (diagnostic != null && diagnostic.equals(Boolean.TRUE)) {
      hqlBuilder.append(and);
      hqlBuilder.append("(");
      flagOpenParenthesiz = Boolean.TRUE;
      hqlBuilder.append(" cc.contractType.id = :diagnostic ");
      and = "or ";
      paramNames.add("diagnostic");
      paramValues.add(ReferralManagementContractType.DIAGNOSTIC.getID());
    }
    // wdev-12676
    if (nonDiagnostic != null && nonDiagnostic.equals(Boolean.TRUE)) {
      hqlBuilder.append(and);
      if (flagOpenParenthesiz.equals(Boolean.FALSE)) {
        hqlBuilder.append("(");
        flagOpenParenthesiz = Boolean.TRUE;
      }

      hqlBuilder.append(" cc.contractType.id = :nondiagnostic ");

      paramNames.add("nondiagnostic");
      paramValues.add(ReferralManagementContractType.NONDIAGNOSTIC.getID());
    }
    if (flagOpenParenthesiz.equals(Boolean.TRUE)) // wdev-12676
    hqlBuilder.append(" )");

    hqlBuilder.append(") order by upper(cc.contractId)");

    List<?> dos = getDomainFactory().find(hqlBuilder.toString(), paramNames, paramValues);

    if (dos == null || dos.size() == 0) return null;

    return ContractConfigShortVoAssembler.createContractConfigShortVoCollectionFromContractConfig(
        dos);
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.assessment.configuration.domain.objects.UserDefinedObject
   */
  public static ims.assessment.vo.UserDefinedObjectListVo insert(
      DomainObjectMap map,
      ims.assessment.vo.UserDefinedObjectListVo valueObject,
      ims.assessment.configuration.domain.objects.UserDefinedObject domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_UserDefinedObject(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;

    // Components
    valueObject.setComponents(
        ims.assessment.vo.domain.UserDefinedObjectComponentListVoAssembler
            .createUserDefinedObjectComponentListVoCollectionFromUserDefinedObjectComponent(
                map, domainObject.getComponents()));
    // Name
    valueObject.setName(domainObject.getName());
    // ObjectType
    ims.domain.lookups.LookupInstance instance3 = domainObject.getObjectType();
    if (null != instance3) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance3.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance3.getImage().getImageId(), instance3.getImage().getImagePath());
      }
      color = instance3.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.UserDefinedObjectType voLookup3 =
          new ims.core.vo.lookups.UserDefinedObjectType(
              instance3.getId(), instance3.getText(), instance3.isActive(), null, img, color);
      ims.core.vo.lookups.UserDefinedObjectType parentVoLookup3 = voLookup3;
      ims.domain.lookups.LookupInstance parent3 = instance3.getParent();
      while (parent3 != null) {
        if (parent3.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent3.getImage().getImageId(), parent3.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent3.getColor();
        if (color != null) color.getValue();
        parentVoLookup3.setParent(
            new ims.core.vo.lookups.UserDefinedObjectType(
                parent3.getId(), parent3.getText(), parent3.isActive(), null, img, color));
        parentVoLookup3 = parentVoLookup3.getParent();
        parent3 = parent3.getParent();
      }
      valueObject.setObjectType(voLookup3);
    }
    // ActiveStatus
    ims.domain.lookups.LookupInstance instance4 = domainObject.getActiveStatus();
    if (null != instance4) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance4.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance4.getImage().getImageId(), instance4.getImage().getImagePath());
      }
      color = instance4.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.PreActiveActiveInactiveStatus voLookup4 =
          new ims.core.vo.lookups.PreActiveActiveInactiveStatus(
              instance4.getId(), instance4.getText(), instance4.isActive(), null, img, color);
      ims.core.vo.lookups.PreActiveActiveInactiveStatus parentVoLookup4 = voLookup4;
      ims.domain.lookups.LookupInstance parent4 = instance4.getParent();
      while (parent4 != null) {
        if (parent4.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent4.getImage().getImageId(), parent4.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent4.getColor();
        if (color != null) color.getValue();
        parentVoLookup4.setParent(
            new ims.core.vo.lookups.PreActiveActiveInactiveStatus(
                parent4.getId(), parent4.getText(), parent4.isActive(), null, img, color));
        parentVoLookup4 = parentVoLookup4.getParent();
        parent4 = parent4.getParent();
      }
      valueObject.setActiveStatus(voLookup4);
    }
    return valueObject;
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.icps.configuration.domain.objects.ICPPhase
   */
  public static ims.icp.vo.ICPPhaseListVo insert(
      DomainObjectMap map,
      ims.icp.vo.ICPPhaseListVo valueObject,
      ims.icps.configuration.domain.objects.ICPPhase domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_ICPPhase(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;

    // Name
    valueObject.setName(domainObject.getName());
    // Description
    valueObject.setDescription(domainObject.getDescription());
    // Status
    ims.domain.lookups.LookupInstance instance3 = domainObject.getStatus();
    if (null != instance3) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance3.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance3.getImage().getImageId(), instance3.getImage().getImagePath());
      }
      color = instance3.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.PreActiveActiveInactiveStatus voLookup3 =
          new ims.core.vo.lookups.PreActiveActiveInactiveStatus(
              instance3.getId(), instance3.getText(), instance3.isActive(), null, img, color);
      ims.core.vo.lookups.PreActiveActiveInactiveStatus parentVoLookup3 = voLookup3;
      ims.domain.lookups.LookupInstance parent3 = instance3.getParent();
      while (parent3 != null) {
        if (parent3.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent3.getImage().getImageId(), parent3.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent3.getColor();
        if (color != null) color.getValue();
        parentVoLookup3.setParent(
            new ims.core.vo.lookups.PreActiveActiveInactiveStatus(
                parent3.getId(), parent3.getText(), parent3.isActive(), null, img, color));
        parentVoLookup3 = parentVoLookup3.getParent();
        parent3 = parent3.getParent();
      }
      valueObject.setStatus(voLookup3);
    }
    return valueObject;
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.icps.configuration.domain.objects.ICPPhase
   */
  public static ims.icp.vo.ICPPhaseVo insert(
      DomainObjectMap map,
      ims.icp.vo.ICPPhaseVo valueObject,
      ims.icps.configuration.domain.objects.ICPPhase domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

    valueObject.setID_ICPPhase(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;

    // Rules
    valueObject.setRules(
        ims.admin.vo.domain.BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(
            map, domainObject.getRules()));
    // Description
    valueObject.setDescription(domainObject.getDescription());
    // isActivatedOnInitiation
    valueObject.setIsActivatedOnInitiation(domainObject.isIsActivatedOnInitiation());
    // Actions
    valueObject.setActions(
        ims.icp.vo.domain.ICPActionLiteVoAssembler.createICPActionLiteVoCollectionFromICPAction(
            map, domainObject.getActions()));
    // Name
    valueObject.setName(domainObject.getName());
    // Goals
    valueObject.setGoals(
        ims.icp.vo.domain.IcpPhaseGoalVoAssembler.createIcpPhaseGoalVoCollectionFromICPPhaseGoal(
            map, domainObject.getGoals()));
    // HelpURL
    valueObject.setHelpURL(domainObject.getHelpURL());
    // Sequence
    valueObject.setSequence(domainObject.getSequence());
    // Status
    ims.domain.lookups.LookupInstance instance9 = domainObject.getStatus();
    if (null != instance9) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;
      img = null;
      if (instance9.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance9.getImage().getImageId(), instance9.getImage().getImagePath());
      }
      color = instance9.getColor();
      if (color != null) color.getValue();

      ims.core.vo.lookups.PreActiveActiveInactiveStatus voLookup9 =
          new ims.core.vo.lookups.PreActiveActiveInactiveStatus(
              instance9.getId(), instance9.getText(), instance9.isActive(), null, img, color);
      ims.core.vo.lookups.PreActiveActiveInactiveStatus parentVoLookup9 = voLookup9;
      ims.domain.lookups.LookupInstance parent9 = instance9.getParent();
      while (parent9 != null) {
        if (parent9.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent9.getImage().getImageId(), parent9.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent9.getColor();
        if (color != null) color.getValue();
        parentVoLookup9.setParent(
            new ims.core.vo.lookups.PreActiveActiveInactiveStatus(
                parent9.getId(), parent9.getText(), parent9.isActive(), null, img, color));
        parentVoLookup9 = parentVoLookup9.getParent();
        parent9 = parent9.getParent();
      }
      valueObject.setStatus(voLookup9);
    }
    return valueObject;
  }