Program: 115239
Project: 115239
Buggy source:
public List<DisplayItemBeanWrapper> lookupValidationErrors(HttpServletRequest request,ODMContainer odmContainer,UserAccountBean ub,HashMap<String,String> totalValidationErrors,HashMap<String,String> hardValidationErrors,ArrayList<Integer> permittedEventCRFIds) throws OpenClinicaException {
  DisplayItemBeanWrapper displayItemBeanWrapper=null;
  HashMap validationErrors=new HashMap();
  List<DisplayItemBeanWrapper> wrappers=new ArrayList<DisplayItemBeanWrapper>();
  ImportHelper importHelper=new ImportHelper();
  FormDiscrepancyNotes discNotes=new FormDiscrepancyNotes();
  DiscrepancyValidator discValidator=new DiscrepancyValidator(request,discNotes);
  HashMap<String,String> hardValidator=new HashMap<String,String>();
  StudyEventDAO studyEventDAO=new StudyEventDAO(ds);
  StudyDAO studyDAO=new StudyDAO(ds);
  StudyBean studyBean=studyDAO.findByOid(odmContainer.getCrfDataPostImportContainer().getStudyOID());
  StudySubjectDAO studySubjectDAO=new StudySubjectDAO(ds);
  StudyEventDefinitionDAO sedDao=new StudyEventDefinitionDAO(ds);
  int maxOrdinal=1;
  HashMap<String,ItemDataBean> blankCheck=new HashMap<String,ItemDataBean>();
  String hardValidatorErrorMsgs="String_Node_Str";
  ArrayList<SubjectDataBean> subjectDataBeans=odmContainer.getCrfDataPostImportContainer().getSubjectData();
  int totalEventCRFCount=0;
  int totalItemDataBeanCount=0;
  for (  SubjectDataBean subjectDataBean : subjectDataBeans) {
    ArrayList<DisplayItemBean> displayItemBeans=new ArrayList<DisplayItemBean>();
    logger.debug("String_Node_Str" + subjectDataBean.getSubjectOID());
    ArrayList<StudyEventDataBean> studyEventDataBeans=subjectDataBean.getStudyEventData();
    totalEventCRFCount+=studyEventDataBeans.size();
    StudySubjectBean studySubjectBean=studySubjectDAO.findByOidAndStudy(subjectDataBean.getSubjectOID(),studyBean.getId());
    for (    StudyEventDataBean studyEventDataBean : studyEventDataBeans) {
      maxOrdinal=1;
      int parentStudyId=studyBean.getParentStudyId();
      StudyEventDefinitionBean sedBean=sedDao.findByOidAndStudy(studyEventDataBean.getStudyEventOID(),studyBean.getId(),parentStudyId);
      ArrayList<FormDataBean> formDataBeans=studyEventDataBean.getFormData();
      logger.debug("String_Node_Str" + studyEventDataBean.getStudyEventOID());
      int ordinal=1;
      try {
        ordinal=new Integer(studyEventDataBean.getStudyEventRepeatKey()).intValue();
      }
 catch (      Exception e) {
      }
      StudyEventBean studyEvent=(StudyEventBean)studyEventDAO.findByStudySubjectIdAndDefinitionIdAndOrdinal(studySubjectBean.getId(),sedBean.getId(),ordinal);
      displayItemBeans=new ArrayList<DisplayItemBean>();
      for (      FormDataBean formDataBean : formDataBeans) {
        maxOrdinal=1;
        CRFVersionDAO crfVersionDAO=new CRFVersionDAO(ds);
        EventCRFDAO eventCRFDAO=new EventCRFDAO(ds);
        ArrayList<CRFVersionBean> crfVersionBeans=crfVersionDAO.findAllByOid(formDataBean.getFormOID());
        ArrayList<ImportItemGroupDataBean> itemGroupDataBeans=formDataBean.getItemGroupData();
        if ((crfVersionBeans == null) || (crfVersionBeans.size() == 0)) {
          MessageFormat mf=new MessageFormat("String_Node_Str");
          mf.applyPattern(respage.getString("String_Node_Str"));
          Object[] arguments={formDataBean.getFormOID()};
          throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
        }
        CRFVersionBean crfVersion=crfVersionBeans.get(0);
        logger.debug("String_Node_Str" + crfVersion.getOid());
        EventCRFBean eventCRFBean=eventCRFDAO.findByEventCrfVersion(studyEvent,crfVersion);
        EventDefinitionCRFDAO eventDefinitionCRFDAO=new EventDefinitionCRFDAO(ds);
        EventDefinitionCRFBean eventDefinitionCRF=eventDefinitionCRFDAO.findByStudyEventIdAndCRFVersionId(studyBean,studyEvent.getId(),crfVersion.getId());
        if (permittedEventCRFIds.contains(new Integer(eventCRFBean.getId()))) {
          for (          ImportItemGroupDataBean itemGroupDataBean : itemGroupDataBeans) {
            ArrayList<ItemBean> blankCheckItems=new ArrayList<ItemBean>();
            ArrayList<ImportItemDataBean> itemDataBeans=itemGroupDataBean.getItemData();
            logger.debug("String_Node_Str" + itemGroupDataBean.getItemGroupOID());
            ItemGroupDAO itemGroupDAO=new ItemGroupDAO(ds);
            ItemGroupBean testBean=itemGroupDAO.findByOid(itemGroupDataBean.getItemGroupOID());
            if (testBean == null) {
              MessageFormat mf=new MessageFormat("String_Node_Str");
              mf.applyPattern(respage.getString("String_Node_Str"));
              Object[] arguments={itemGroupDataBean.getItemGroupOID(),formDataBean.getFormOID()};
              throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
            }
            totalItemDataBeanCount+=itemDataBeans.size();
            for (            ImportItemDataBean importItemDataBean : itemDataBeans) {
              logger.debug("String_Node_Str" + importItemDataBean.getItemOID());
              ItemDAO itemDAO=new ItemDAO(ds);
              ItemFormMetadataDAO itemFormMetadataDAO=new ItemFormMetadataDAO(ds);
              List<ItemBean> itemBeans=itemDAO.findByOid(importItemDataBean.getItemOID());
              if (!itemBeans.isEmpty()) {
                ItemBean itemBean=itemBeans.get(0);
                logger.debug("String_Node_Str" + itemBean.getName());
                DisplayItemBean displayItemBean=new DisplayItemBean();
                displayItemBean.setItem(itemBean);
                ArrayList<ItemFormMetadataBean> metadataBeans=itemFormMetadataDAO.findAllByItemId(itemBean.getId());
                logger.debug("String_Node_Str" + metadataBeans.size());
                int groupOrdinal=1;
                if (itemGroupDataBean.getItemGroupRepeatKey() != null) {
                  try {
                    groupOrdinal=new Integer(itemGroupDataBean.getItemGroupRepeatKey()).intValue();
                    if (groupOrdinal > maxOrdinal) {
                      maxOrdinal=groupOrdinal;
                    }
                  }
 catch (                  Exception e) {
                    logger.debug("String_Node_Str");
                  }
                }
                ItemDataBean itemDataBean=createItemDataBean(itemBean,eventCRFBean,importItemDataBean.getValue(),ub,groupOrdinal);
                blankCheckItems.add(itemBean);
                String newKey=groupOrdinal + "String_Node_Str" + itemGroupDataBean.getItemGroupOID()+ "String_Node_Str"+ itemBean.getOid()+ "String_Node_Str"+ subjectDataBean.getSubjectOID();
                blankCheck.put(newKey,itemDataBean);
                logger.info("String_Node_Str" + newKey + "String_Node_Str");
                if (!metadataBeans.isEmpty()) {
                  ItemFormMetadataBean metadataBean=metadataBeans.get(0);
                  displayItemBean.setData(itemDataBean);
                  displayItemBean.setMetadata(metadataBean);
                  displayItemBean.setEventDefinitionCRF(eventDefinitionCRF);
                  String eventCRFRepeatKey=studyEventDataBean.getStudyEventRepeatKey();
                  attachValidator(displayItemBean,importHelper,discValidator,hardValidator,request,eventCRFRepeatKey,studySubjectBean.getOid());
                  displayItemBeans.add(displayItemBean);
                }
 else {
                  MessageFormat mf=new MessageFormat("String_Node_Str");
                  mf.applyPattern(respage.getString("String_Node_Str"));
                  Object[] arguments={importItemDataBean.getItemOID()};
                  throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
                }
              }
 else {
                MessageFormat mf=new MessageFormat("String_Node_Str");
                mf.applyPattern(respage.getString("String_Node_Str"));
                Object[] arguments={importItemDataBean.getItemOID()};
                throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
              }
            }
            logger.debug("String_Node_Str" + blankCheck.toString());
            for (int i=1; i <= maxOrdinal; i++) {
              for (              ItemBean itemBean : blankCheckItems) {
                String newKey=i + "String_Node_Str" + itemGroupDataBean.getItemGroupOID()+ "String_Node_Str"+ itemBean.getOid()+ "String_Node_Str"+ subjectDataBean.getSubjectOID();
                if (blankCheck.get(newKey) == null) {
                  ItemDataBean itemDataCheck=getItemDataDao().findByItemIdAndEventCRFIdAndOrdinal(itemBean.getId(),eventCRFBean.getId(),i);
                  logger.debug("String_Node_Str" + itemDataCheck.getId() + "String_Node_Str"+ i);
                  if (itemDataCheck.getId() == 0) {
                    ItemDataBean blank=createItemDataBean(itemBean,eventCRFBean,"String_Node_Str",ub,i);
                    DisplayItemBean displayItemBean=new DisplayItemBean();
                    displayItemBean.setItem(itemBean);
                    displayItemBean.setData(blank);
                    displayItemBean.setEventDefinitionCRF(eventDefinitionCRF);
                    String eventCRFRepeatKey=studyEventDataBean.getStudyEventRepeatKey();
                    displayItemBeans.add(displayItemBean);
                    logger.debug("String_Node_Str");
                  }
                }
                logger.debug("String_Node_Str" + i + "String_Node_Str"+ blankCheckItems.size()+ "String_Node_Str");
              }
            }
            blankCheckItems=new ArrayList<ItemBean>();
          }
        }
        CRFDAO crfDAO=new CRFDAO(ds);
        CRFBean crfBean=crfDAO.findByVersionId(crfVersion.getCrfId());
        validationErrors=discValidator.validate();
        for (        Object errorKey : validationErrors.keySet()) {
          if (!totalValidationErrors.containsKey(errorKey.toString()))           totalValidationErrors.put(errorKey.toString(),validationErrors.get(errorKey).toString());
          logger.debug("String_Node_Str" + errorKey.toString());
        }
        logger.debug("String_Node_Str");
        for (        Object errorKey : hardValidator.keySet()) {
          logger.debug(errorKey.toString() + "String_Node_Str" + hardValidator.get(errorKey));
          hardValidationErrors.put(errorKey.toString(),hardValidator.get(errorKey));
          hardValidatorErrorMsgs+=hardValidator.get(errorKey) + "String_Node_Str";
        }
        String studyEventId=studyEvent.getId() + "String_Node_Str";
        String crfVersionId=crfVersion.getId() + "String_Node_Str";
        logger.debug("String_Node_Str" + displayItemBeans.size() + "String_Node_Str"+ totalItemDataBeanCount+ "String_Node_Str"+ validationErrors.size()+ "String_Node_Str"+ subjectDataBeans.size()+ "String_Node_Str"+ totalEventCRFCount+ "String_Node_Str"+ hardValidator.size());
        logger.debug("String_Node_Str" + maxOrdinal);
        DataEntryStage dataEntryStage=eventCRFBean.getStage();
        Status eventCRFStatus=eventCRFBean.getStatus();
        boolean overwrite=false;
        if (dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY)|| dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
          overwrite=true;
        }
        displayItemBeanWrapper=new DisplayItemBeanWrapper(displayItemBeans,true,overwrite,validationErrors,studyEventId,crfVersionId,studyEventDataBean.getStudyEventOID(),studySubjectBean.getLabel(),eventCRFBean.getCreatedDate(),crfBean.getName(),crfVersion.getName(),studySubjectBean.getOid(),studyEventDataBean.getStudyEventRepeatKey());
        validationErrors=new HashMap();
        discValidator=new DiscrepancyValidator(request,discNotes);
      }
      wrappers.add(displayItemBeanWrapper);
    }
  }
  if (!hardValidator.isEmpty()) {
  }
  return wrappers;
}

Fixed version (ground truth):
public List<DisplayItemBeanWrapper> lookupValidationErrors(HttpServletRequest request,ODMContainer odmContainer,UserAccountBean ub,HashMap<String,String> totalValidationErrors,HashMap<String,String> hardValidationErrors,ArrayList<Integer> permittedEventCRFIds,StudyEventBean studyEvent) throws OpenClinicaException {
  DisplayItemBeanWrapper displayItemBeanWrapper=null;
  HashMap validationErrors=new HashMap();
  List<DisplayItemBeanWrapper> wrappers=new ArrayList<DisplayItemBeanWrapper>();
  ImportHelper importHelper=new ImportHelper();
  FormDiscrepancyNotes discNotes=new FormDiscrepancyNotes();
  DiscrepancyValidator discValidator=new DiscrepancyValidator(request,discNotes);
  HashMap<String,String> hardValidator=new HashMap<String,String>();
  StudyEventDAO studyEventDAO=new StudyEventDAO(ds);
  StudyDAO studyDAO=new StudyDAO(ds);
  StudyBean studyBean=studyDAO.findByOid(odmContainer.getCrfDataPostImportContainer().getStudyOID());
  StudySubjectDAO studySubjectDAO=new StudySubjectDAO(ds);
  StudyEventDefinitionDAO sedDao=new StudyEventDefinitionDAO(ds);
  int maxOrdinal=1;
  HashMap<String,ItemDataBean> blankCheck=new HashMap<String,ItemDataBean>();
  String hardValidatorErrorMsgs="String_Node_Str";
  ArrayList<SubjectDataBean> subjectDataBeans=odmContainer.getCrfDataPostImportContainer().getSubjectData();
  int totalEventCRFCount=0;
  int totalItemDataBeanCount=0;
  for (  SubjectDataBean subjectDataBean : subjectDataBeans) {
    ArrayList<DisplayItemBean> displayItemBeans=new ArrayList<DisplayItemBean>();
    logger.debug("String_Node_Str" + subjectDataBean.getSubjectOID());
    ArrayList<StudyEventDataBean> studyEventDataBeans=subjectDataBean.getStudyEventData();
    totalEventCRFCount+=studyEventDataBeans.size();
    StudySubjectBean studySubjectBean=studySubjectDAO.findByOidAndStudy(subjectDataBean.getSubjectOID(),studyBean.getId());
    for (    StudyEventDataBean studyEventDataBean : studyEventDataBeans) {
      maxOrdinal=1;
      int parentStudyId=studyBean.getParentStudyId();
      StudyEventDefinitionBean sedBean=sedDao.findByOidAndStudy(studyEventDataBean.getStudyEventOID(),studyBean.getId(),parentStudyId);
      ArrayList<FormDataBean> formDataBeans=studyEventDataBean.getFormData();
      logger.debug("String_Node_Str" + studyEventDataBean.getStudyEventOID());
      int ordinal=1;
      try {
        ordinal=new Integer(studyEventDataBean.getStudyEventRepeatKey()).intValue();
      }
 catch (      Exception e) {
      }
      if (studyEvent == null) {
        studyEvent=(StudyEventBean)studyEventDAO.findByStudySubjectIdAndDefinitionIdAndOrdinal(studySubjectBean.getId(),sedBean.getId(),ordinal);
      }
      displayItemBeans=new ArrayList<DisplayItemBean>();
      for (      FormDataBean formDataBean : formDataBeans) {
        maxOrdinal=1;
        CRFVersionDAO crfVersionDAO=new CRFVersionDAO(ds);
        EventCRFDAO eventCRFDAO=new EventCRFDAO(ds);
        ArrayList<CRFVersionBean> crfVersionBeans=crfVersionDAO.findAllByOid(formDataBean.getFormOID());
        ArrayList<ImportItemGroupDataBean> itemGroupDataBeans=formDataBean.getItemGroupData();
        if ((crfVersionBeans == null) || (crfVersionBeans.size() == 0)) {
          MessageFormat mf=new MessageFormat("String_Node_Str");
          mf.applyPattern(respage.getString("String_Node_Str"));
          Object[] arguments={formDataBean.getFormOID()};
          throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
        }
        CRFVersionBean crfVersion=crfVersionBeans.get(0);
        logger.debug("String_Node_Str" + crfVersion.getOid());
        EventCRFBean eventCRFBean=eventCRFDAO.findByEventCrfVersion(studyEvent,crfVersion);
        System.out.println("String_Node_Str" + studyEvent.getId() + "String_Node_Str"+ crfVersion.getOid());
        EventDefinitionCRFDAO eventDefinitionCRFDAO=new EventDefinitionCRFDAO(ds);
        EventDefinitionCRFBean eventDefinitionCRF=eventDefinitionCRFDAO.findByStudyEventIdAndCRFVersionId(studyBean,studyEvent.getId(),crfVersion.getId());
        if (permittedEventCRFIds.contains(new Integer(eventCRFBean.getId()))) {
          for (          ImportItemGroupDataBean itemGroupDataBean : itemGroupDataBeans) {
            ArrayList<ItemBean> blankCheckItems=new ArrayList<ItemBean>();
            ArrayList<ImportItemDataBean> itemDataBeans=itemGroupDataBean.getItemData();
            logger.debug("String_Node_Str" + itemGroupDataBean.getItemGroupOID());
            ItemGroupDAO itemGroupDAO=new ItemGroupDAO(ds);
            ItemGroupBean testBean=itemGroupDAO.findByOid(itemGroupDataBean.getItemGroupOID());
            if (testBean == null) {
              MessageFormat mf=new MessageFormat("String_Node_Str");
              mf.applyPattern(respage.getString("String_Node_Str"));
              Object[] arguments={itemGroupDataBean.getItemGroupOID(),formDataBean.getFormOID()};
              throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
            }
            totalItemDataBeanCount+=itemDataBeans.size();
            for (            ImportItemDataBean importItemDataBean : itemDataBeans) {
              logger.debug("String_Node_Str" + importItemDataBean.getItemOID());
              ItemDAO itemDAO=new ItemDAO(ds);
              ItemFormMetadataDAO itemFormMetadataDAO=new ItemFormMetadataDAO(ds);
              List<ItemBean> itemBeans=itemDAO.findByOid(importItemDataBean.getItemOID());
              if (!itemBeans.isEmpty()) {
                ItemBean itemBean=itemBeans.get(0);
                logger.debug("String_Node_Str" + itemBean.getName());
                DisplayItemBean displayItemBean=new DisplayItemBean();
                displayItemBean.setItem(itemBean);
                ArrayList<ItemFormMetadataBean> metadataBeans=itemFormMetadataDAO.findAllByItemId(itemBean.getId());
                logger.debug("String_Node_Str" + metadataBeans.size());
                int groupOrdinal=1;
                if (itemGroupDataBean.getItemGroupRepeatKey() != null) {
                  try {
                    groupOrdinal=new Integer(itemGroupDataBean.getItemGroupRepeatKey()).intValue();
                    if (groupOrdinal > maxOrdinal) {
                      maxOrdinal=groupOrdinal;
                    }
                  }
 catch (                  Exception e) {
                    logger.debug("String_Node_Str");
                  }
                }
                ItemDataBean itemDataBean=createItemDataBean(itemBean,eventCRFBean,importItemDataBean.getValue(),ub,groupOrdinal);
                blankCheckItems.add(itemBean);
                String newKey=groupOrdinal + "String_Node_Str" + itemGroupDataBean.getItemGroupOID()+ "String_Node_Str"+ itemBean.getOid()+ "String_Node_Str"+ subjectDataBean.getSubjectOID();
                blankCheck.put(newKey,itemDataBean);
                logger.info("String_Node_Str" + newKey + "String_Node_Str");
                if (!metadataBeans.isEmpty()) {
                  ItemFormMetadataBean metadataBean=metadataBeans.get(0);
                  displayItemBean.setData(itemDataBean);
                  displayItemBean.setMetadata(metadataBean);
                  displayItemBean.setEventDefinitionCRF(eventDefinitionCRF);
                  String eventCRFRepeatKey=studyEventDataBean.getStudyEventRepeatKey();
                  attachValidator(displayItemBean,importHelper,discValidator,hardValidator,request,eventCRFRepeatKey,studySubjectBean.getOid());
                  displayItemBeans.add(displayItemBean);
                }
 else {
                  MessageFormat mf=new MessageFormat("String_Node_Str");
                  mf.applyPattern(respage.getString("String_Node_Str"));
                  Object[] arguments={importItemDataBean.getItemOID()};
                  throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
                }
              }
 else {
                MessageFormat mf=new MessageFormat("String_Node_Str");
                mf.applyPattern(respage.getString("String_Node_Str"));
                Object[] arguments={importItemDataBean.getItemOID()};
                throw new OpenClinicaException(mf.format(arguments),"String_Node_Str");
              }
            }
            logger.debug("String_Node_Str" + blankCheck.toString());
            for (int i=1; i <= maxOrdinal; i++) {
              for (              ItemBean itemBean : blankCheckItems) {
                String newKey=i + "String_Node_Str" + itemGroupDataBean.getItemGroupOID()+ "String_Node_Str"+ itemBean.getOid()+ "String_Node_Str"+ subjectDataBean.getSubjectOID();
                if (blankCheck.get(newKey) == null) {
                  ItemDataBean itemDataCheck=getItemDataDao().findByItemIdAndEventCRFIdAndOrdinal(itemBean.getId(),eventCRFBean.getId(),i);
                  logger.debug("String_Node_Str" + itemDataCheck.getId() + "String_Node_Str"+ i);
                  if (itemDataCheck.getId() == 0) {
                    ItemDataBean blank=createItemDataBean(itemBean,eventCRFBean,"String_Node_Str",ub,i);
                    DisplayItemBean displayItemBean=new DisplayItemBean();
                    displayItemBean.setItem(itemBean);
                    displayItemBean.setData(blank);
                    displayItemBean.setEventDefinitionCRF(eventDefinitionCRF);
                    String eventCRFRepeatKey=studyEventDataBean.getStudyEventRepeatKey();
                    displayItemBeans.add(displayItemBean);
                    logger.debug("String_Node_Str");
                  }
                }
                logger.debug("String_Node_Str" + i + "String_Node_Str"+ blankCheckItems.size()+ "String_Node_Str");
              }
            }
            blankCheckItems=new ArrayList<ItemBean>();
          }
        }
        CRFDAO crfDAO=new CRFDAO(ds);
        CRFBean crfBean=crfDAO.findByVersionId(crfVersion.getCrfId());
        validationErrors=discValidator.validate();
        for (        Object errorKey : validationErrors.keySet()) {
          if (!totalValidationErrors.containsKey(errorKey.toString()))           totalValidationErrors.put(errorKey.toString(),validationErrors.get(errorKey).toString());
          logger.debug("String_Node_Str" + errorKey.toString());
        }
        logger.debug("String_Node_Str");
        for (        Object errorKey : hardValidator.keySet()) {
          logger.debug(errorKey.toString() + "String_Node_Str" + hardValidator.get(errorKey));
          hardValidationErrors.put(errorKey.toString(),hardValidator.get(errorKey));
          hardValidatorErrorMsgs+=hardValidator.get(errorKey) + "String_Node_Str";
        }
        String studyEventId=studyEvent.getId() + "String_Node_Str";
        String crfVersionId=crfVersion.getId() + "String_Node_Str";
        logger.debug("String_Node_Str" + displayItemBeans.size() + "String_Node_Str"+ totalItemDataBeanCount+ "String_Node_Str"+ validationErrors.size()+ "String_Node_Str"+ subjectDataBeans.size()+ "String_Node_Str"+ totalEventCRFCount+ "String_Node_Str"+ hardValidator.size());
        logger.debug("String_Node_Str" + maxOrdinal);
        DataEntryStage dataEntryStage=eventCRFBean.getStage();
        Status eventCRFStatus=eventCRFBean.getStatus();
        boolean overwrite=false;
        if (dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY)|| dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
          overwrite=true;
        }
        displayItemBeanWrapper=new DisplayItemBeanWrapper(displayItemBeans,true,overwrite,validationErrors,studyEventId,crfVersionId,studyEventDataBean.getStudyEventOID(),studySubjectBean.getLabel(),eventCRFBean.getCreatedDate(),crfBean.getName(),crfVersion.getName(),studySubjectBean.getOid(),studyEventDataBean.getStudyEventRepeatKey());
        validationErrors=new HashMap();
        discValidator=new DiscrepancyValidator(request,discNotes);
      }
      wrappers.add(displayItemBeanWrapper);
    }
  }
  if (!hardValidator.isEmpty()) {
  }
  return wrappers;
}