/**
   * Updates the study bean with inputs from second section
   *
   * @param request
   * @return true if study type is Interventional, otherwise false
   */
  private boolean updateStudy2() {
    FormProcessor fp = new FormProcessor(request);
    StudyBean newStudy = (StudyBean) session.getAttribute("newStudy");
    // this is not fully supported yet, because the system will not handle
    // studies which are pending
    // or private...
    newStudy.setStatus(Status.get(fp.getInt("statusId")));

    newStudy.setProtocolDateVerification(fp.getDate(INPUT_VER_DATE));

    newStudy.setDatePlannedStart(fp.getDate(INPUT_START_DATE));

    if (StringUtil.isBlank(fp.getString(INPUT_END_DATE))) {
      newStudy.setDatePlannedEnd(null);
    } else {
      newStudy.setDatePlannedEnd(fp.getDate(INPUT_END_DATE));
    }

    newStudy.setPhase(fp.getString("phase"));

    if (fp.getInt("genetic") == 1) {
      newStudy.setGenetic(true);
    } else {
      newStudy.setGenetic(false);
    }

    session.setAttribute("newStudy", newStudy);

    String interventional = resadmin.getString("interventional");
    return interventional.equalsIgnoreCase(newStudy.getProtocolType());
  }
  private boolean updateStudy2(FormProcessor fp) {

    study.setOldStatus(study.getStatus());
    study.setStatus(Status.get(fp.getInt("statusId")));

    if (StringUtil.isBlank(fp.getString(INPUT_VER_DATE))) {
      study.setProtocolDateVerification(null);
    } else {
      study.setProtocolDateVerification(fp.getDate(INPUT_VER_DATE));
    }

    study.setDatePlannedStart(fp.getDate(INPUT_START_DATE));

    if (StringUtil.isBlank(fp.getString(INPUT_END_DATE))) {
      study.setDatePlannedEnd(null);
    } else {
      study.setDatePlannedEnd(fp.getDate(INPUT_END_DATE));
    }

    study.setPhase(fp.getString("phase"));

    if (fp.getInt("genetic") == 1) {
      study.setGenetic(true);
    } else {
      study.setGenetic(false);
    }

    String interventional = resadmin.getString("interventional");
    return interventional.equalsIgnoreCase(study.getProtocolType());
  }
Example #3
0
  public Object getEntityFromHashMap(HashMap hm) {
    ItemBean eb = new ItemBean();
    // below inserted to find out a class cast exception, tbh
    Date dateCreated = (Date) hm.get("date_created");
    Date dateUpdated = (Date) hm.get("date_updated");
    Integer statusId = (Integer) hm.get("status_id");
    Integer ownerId = (Integer) hm.get("owner_id");
    Integer updateId = (Integer) hm.get("update_id");

    eb.setCreatedDate(dateCreated);
    eb.setUpdatedDate(dateUpdated);
    eb.setStatus(Status.get(statusId.intValue()));
    eb.setOwnerId(ownerId.intValue());
    eb.setUpdaterId(updateId.intValue());
    // something to trip over
    // something else to trip over
    // eb = (ItemBean)this.getEntityAuditInformation(hm);
    eb.setName((String) hm.get("name"));
    eb.setId(((Integer) hm.get("item_id")).intValue());
    eb.setDescription((String) hm.get("description"));
    eb.setUnits((String) hm.get("units"));
    eb.setPhiStatus(((Boolean) hm.get("phi_status")).booleanValue());
    eb.setItemDataTypeId(((Integer) hm.get("item_data_type_id")).intValue());
    eb.setItemReferenceTypeId(((Integer) hm.get("item_reference_type_id")).intValue());
    // logger.info("item name|date type id" + eb.getName() + "|" +
    // eb.getItemDataTypeId());
    eb.setDataType(ItemDataType.get(eb.getItemDataTypeId()));
    eb.setOid((String) hm.get("oc_oid"));
    // the rest should be all set
    return eb;
  }
 public Object getEntityFromHashMap(HashMap hm) {
   ItemDataBean eb = new ItemDataBean();
   this.setEntityAuditInformation(eb, hm);
   eb.setId(((Integer) hm.get("item_data_id")).intValue());
   eb.setEventCRFId(((Integer) hm.get("event_crf_id")).intValue());
   eb.setItemId(((Integer) hm.get("item_id")).intValue());
   eb.setValue((String) hm.get("value"));
   eb.setStatus(Status.get(((Integer) hm.get("status_id")).intValue()));
   return eb;
 }
  public Object getEntityFromHashMap(HashMap hm) {
    RuleSetAuditBean ruleSetAudit = new RuleSetAuditBean();
    ruleSetAudit.setId((Integer) hm.get("rule_set_audit_id"));
    int ruleSetId = (Integer) hm.get("rule_set_id");
    int userAccountId = (Integer) hm.get("updater_id");
    int statusId = (Integer) hm.get("status_id");
    Date dateUpdated = (Date) hm.get("date_updated");
    ruleSetAudit.setDateUpdated(dateUpdated);
    ruleSetAudit.setStatus(Status.get(statusId));
    ruleSetAudit.setRuleSetBean((RuleSetBean) getRuleSetDao().findByPK(ruleSetId));
    ruleSetAudit.setUpdater((UserAccountBean) getUserAccountDao().findByPK(userAccountId));

    return ruleSetAudit;
  }
  @RequestMapping(method = RequestMethod.POST)
  public String processSubmit(
      @ModelAttribute("studyModuleStatus") StudyModuleStatus studyModuleStatus,
      BindingResult result,
      SessionStatus status,
      HttpServletRequest request) {
    StudyBean currentStudy = (StudyBean) request.getSession().getAttribute("study");
    studyModuleStatusDao.saveOrUpdate(studyModuleStatus);
    status.setComplete();

    currentStudy.setStatus(Status.get(studyModuleStatus.getStudyStatus()));
    if (currentStudy.getParentStudyId() > 0) {
      studyDao.updateStudyStatus(currentStudy);
    } else {
      studyDao.updateStudyStatus(currentStudy);
    }

    return "redirect:studymodule";
  }
  /**
   * Constructs study bean from request
   *
   * @param request
   * @return
   */
  private StudyBean createStudyBean() {
    FormProcessor fp = new FormProcessor(request);
    StudyBean study = (StudyBean) session.getAttribute("newStudy");
    study.setName(fp.getString("name"));
    study.setIdentifier(fp.getString("uniqueProId"));
    study.setSecondaryIdentifier(fp.getString("secondProId"));
    study.setSummary(fp.getString("description"));
    study.setPrincipalInvestigator(fp.getString("prinInvestigator"));
    study.setExpectedTotalEnrollment(fp.getInt("expectedTotalEnrollment"));
    java.util.Date startDate = null;
    java.util.Date endDate = null;
    try {
      local_df.setLenient(false);
      startDate = local_df.parse(fp.getString("startDate"));

    } catch (ParseException fe) {
      startDate = study.getDatePlannedStart();
      logger.info(fe.getMessage());
    }
    study.setDatePlannedStart(startDate);

    try {
      local_df.setLenient(false);
      endDate = local_df.parse(fp.getString("endDate"));

    } catch (ParseException fe) {
      endDate = study.getDatePlannedEnd();
    }
    study.setDatePlannedEnd(endDate);

    study.setFacilityCity(fp.getString("facCity"));
    study.setFacilityContactDegree(fp.getString("facConDrgree"));
    study.setFacilityName(fp.getString("facName"));
    study.setFacilityContactEmail(fp.getString("facConEmail"));
    study.setFacilityContactPhone(fp.getString("facConPhone"));
    study.setFacilityContactName(fp.getString("facConName"));
    study.setFacilityContactDegree(fp.getString("facConDegree"));
    study.setFacilityCountry(fp.getString("facCountry"));
    // study.setFacilityRecruitmentStatus(fp.getString("facRecStatus"));
    study.setFacilityState(fp.getString("facState"));
    study.setFacilityZip(fp.getString("facZip"));
    study.setStatus(Status.get(fp.getInt("statusId")));

    ArrayList parameters = study.getStudyParameters();

    for (int i = 0; i < parameters.size(); i++) {
      StudyParamsConfig scg = (StudyParamsConfig) parameters.get(i);
      String value = fp.getString(scg.getParameter().getHandle());
      logger.info("get value:" + value);
      scg.getValue().setParameter(scg.getParameter().getHandle());
      scg.getValue().setValue(value);
    }

    // YW 10-12-2007 <<
    study
        .getStudyParameterConfig()
        .setInterviewerNameRequired(fp.getString("interviewerNameRequired"));
    study
        .getStudyParameterConfig()
        .setInterviewerNameDefault(fp.getString("interviewerNameDefault"));
    study.getStudyParameterConfig().setInterviewDateRequired(fp.getString("interviewDateRequired"));
    study.getStudyParameterConfig().setInterviewDateDefault(fp.getString("interviewDateDefault"));
    // YW >>

    return study;
  }