Beispiel #1
0
  public CareContextShortVo getCareContextShortVo(CareContextRefVo careContextRef) {
    if (careContextRef == null)
      throw new RuntimeException("Cannot get CareContextShortVo for null CareContextRefVo");

    CareContext doCareContext =
        (CareContext)
            getDomainFactory()
                .getDomainObject(CareContext.class, careContextRef.getID_CareContext());
    return CareContextShortVoAssembler.create(doCareContext);
  }
  public CareContextShortVo getCareContextForPasEvent(PASEventRefVo pasEvent) {
    if (pasEvent == null || pasEvent.getID_PASEvent() == null)
      throw new CodingRuntimeException(
          "pasEvent is null or id not provided in method getCareContextForPasEvent");

    List ccList =
        getDomainFactory()
            .find(" from CareContext cc where cc.pasEvent.id = " + pasEvent.getID_PASEvent());
    if (ccList != null && ccList.size() == 1)
      return CareContextShortVoAssembler.create((CareContext) ccList.get(0));

    return null;
  }
  /**
   * Update the ValueObject with the Domain Object.
   *
   * @param map DomainObjectMap of DomainObjects to already created ValueObjects.
   * @param valueObject to be updated
   * @param domainObject ims.medical.domain.objects.OPDSpasticityAssessTreat
   */
  public static ims.generalmedical.vo.OPDSpasticityAssessTreatVo insert(
      DomainObjectMap map,
      ims.generalmedical.vo.OPDSpasticityAssessTreatVo valueObject,
      ims.medical.domain.objects.OPDSpasticityAssessTreat domainObject) {
    if (null == domainObject) {
      return valueObject;
    }
    if (null == map) {
      map = new DomainObjectMap();
    }

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

    // TreatGoals
    valueObject.setTreatGoals(
        ims.generalmedical.vo.domain.OPDSpasticityAssessTreatGoalVoAssembler
            .createOPDSpasticityAssessTreatGoalVoCollectionFromOPDSpasAssessTreatGoal(
                map, domainObject.getTreatGoals()));
    // TreatmentPlan
    java.util.List listTreatmentPlan = domainObject.getTreatmentPlan();
    ims.spinalinjuries.vo.lookups.SATreatmentPlanCollection TreatmentPlan =
        new ims.spinalinjuries.vo.lookups.SATreatmentPlanCollection();
    for (java.util.Iterator iterator = listTreatmentPlan.iterator(); iterator.hasNext(); ) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;

      ims.domain.lookups.LookupInstance instance =
          (ims.domain.lookups.LookupInstance) iterator.next();
      if (instance.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance.getImage().getImageId(), instance.getImage().getImagePath());
      } else {
        img = null;
      }
      color = instance.getColor();
      if (color != null) color.getValue();
      ims.spinalinjuries.vo.lookups.SATreatmentPlan voInstance =
          new ims.spinalinjuries.vo.lookups.SATreatmentPlan(
              instance.getId(), instance.getText(), instance.isActive(), null, img, color);
      ims.spinalinjuries.vo.lookups.SATreatmentPlan parentVoInstance = voInstance;
      ims.domain.lookups.LookupInstance parent = instance.getParent();
      while (parent != null) {
        if (parent.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent.getImage().getImageId(), parent.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent.getColor();
        if (color != null) color.getValue();
        parentVoInstance.setParent(
            new ims.spinalinjuries.vo.lookups.SATreatmentPlan(
                parent.getId(), parent.getText(), parent.isActive(), null, img, color));
        parentVoInstance = parentVoInstance.getParent();
        parent = parent.getParent();
      }
      TreatmentPlan.add(voInstance);
    }
    valueObject.setTreatmentPlan(TreatmentPlan);
    // BotulismTreatment
    java.util.List listBotulismTreatment = domainObject.getBotulismTreatment();
    ims.spinalinjuries.vo.lookups.SABotulinmCollection BotulismTreatment =
        new ims.spinalinjuries.vo.lookups.SABotulinmCollection();
    for (java.util.Iterator iterator = listBotulismTreatment.iterator(); iterator.hasNext(); ) {
      ims.framework.utils.ImagePath img = null;
      ims.framework.utils.Color color = null;

      ims.domain.lookups.LookupInstance instance =
          (ims.domain.lookups.LookupInstance) iterator.next();
      if (instance.getImage() != null) {
        img =
            new ims.framework.utils.ImagePath(
                instance.getImage().getImageId(), instance.getImage().getImagePath());
      } else {
        img = null;
      }
      color = instance.getColor();
      if (color != null) color.getValue();
      ims.spinalinjuries.vo.lookups.SABotulinm voInstance =
          new ims.spinalinjuries.vo.lookups.SABotulinm(
              instance.getId(), instance.getText(), instance.isActive(), null, img, color);
      ims.spinalinjuries.vo.lookups.SABotulinm parentVoInstance = voInstance;
      ims.domain.lookups.LookupInstance parent = instance.getParent();
      while (parent != null) {
        if (parent.getImage() != null) {
          img =
              new ims.framework.utils.ImagePath(
                  parent.getImage().getImageId(), parent.getImage().getImagePath());
        } else {
          img = null;
        }
        color = parent.getColor();
        if (color != null) color.getValue();
        parentVoInstance.setParent(
            new ims.spinalinjuries.vo.lookups.SABotulinm(
                parent.getId(), parent.getText(), parent.isActive(), null, img, color));
        parentVoInstance = parentVoInstance.getParent();
        parent = parent.getParent();
      }
      BotulismTreatment.add(voInstance);
    }
    valueObject.setBotulismTreatment(BotulismTreatment);
    // JointContracture
    valueObject.setJointContracture(domainObject.getJointContracture());
    // LimbFinding
    valueObject.setLimbFinding(
        ims.generalmedical.vo.domain.OPDSpasAssLimbsVoAssembler
            .createOPDSpasAssLimbsVoCollectionFromOPDSpasAssLimbs(
                map, domainObject.getLimbFinding()));
    // CareContext
    valueObject.setCareContext(
        ims.core.vo.domain.CareContextShortVoAssembler.create(map, domainObject.getCareContext()));
    // AuthoringInformation
    valueObject.setAuthoringInformation(
        ims.core.vo.domain.AuthoringInformationVoAssembler.create(
            map, domainObject.getAuthoringInformation()));
    return valueObject;
  }