use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findForStudyByStudyEventDefinitionIdAndCRFId.
/**
* Find EventDefinitionCRFBean for a study. So this EventDefinitionCRFBean
* has no parent.
*
* @param studyEventDefinitionId
* @param crfId
* @return
*/
public EventDefinitionCRFBean findForStudyByStudyEventDefinitionIdAndCRFId(int studyEventDefinitionId, int crfId) {
EventDefinitionCRFBean answer = new EventDefinitionCRFBean();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(studyEventDefinitionId));
variables.put(new Integer(2), new Integer(crfId));
String sql = digester.getQuery("findForStudyByStudyEventDefinitionIdAndCRFId");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
while (it.hasNext()) {
answer = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
}
return answer;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findAllActiveNonHiddenByEventDefinitionIdAndStudy.
public Collection findAllActiveNonHiddenByEventDefinitionIdAndStudy(int definitionId, StudyBean study) {
ArrayList al = new ArrayList();
this.setTypesExpected();
HashMap variables = new HashMap();
if (study.getParentStudyId() > 0) {
variables.put(new Integer(1), new Integer(definitionId));
variables.put(new Integer(2), new Integer(study.getId()));
variables.put(new Integer(3), new Integer(definitionId));
String sql = digester.getQuery("findAllActiveNonHiddenByEventDefinitionIdAndSite");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
while (it.hasNext()) {
EventDefinitionCRFBean eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findByStudyEventDefinitionIdAndCRFIdAndStudyId.
public EventDefinitionCRFBean findByStudyEventDefinitionIdAndCRFIdAndStudyId(int studyEventDefinitionId, int crfId, int studyId) {
EventDefinitionCRFBean answer = new EventDefinitionCRFBean();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(studyEventDefinitionId));
variables.put(new Integer(2), new Integer(crfId));
variables.put(new Integer(3), new Integer(studyId));
String sql = digester.getQuery("findByStudyEventDefinitionIdAndCRFIdAndStudyId");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
while (it.hasNext()) {
answer = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
}
return answer;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method update.
/**
* Updates a Study event
*/
@Override
public EntityBean update(EntityBean eb) {
EventDefinitionCRFBean sb = (EventDefinitionCRFBean) eb;
HashMap nullVars = new HashMap();
HashMap variables = new HashMap();
// UPDATE EVENT_DEFINITION_CRF SET
// STUDY_EVENT_DEFINITION_ID=?,STUDY_ID=?,CRF_ID=?, REQUIRED_CRF=?,
// DOUBLE_ENTRY=?,REQUIRE_ALL_TEXT_FILLED=?,DECISION_CONDITIONS=?,
// NULL_VALUES=?,DEFAULT_VERSION_ID=?,STATUS_ID=?,DATE_UPDATED=?,UPDATE_ID=?,
// ordinal=?,ELECTRONIC_SIGNATURE=? HIDE_CRF=?,
// SOURCE_DATA_VERIFICATION_ID=?, Selected_version_ids=?, parent_id=?
// WHERE EVENT_DEFINITION_CRF_ID=?
variables.put(new Integer(1), new Integer(sb.getStudyEventDefinitionId()));
variables.put(new Integer(2), new Integer(sb.getStudyId()));
variables.put(new Integer(3), new Integer(sb.getCrfId()));
variables.put(new Integer(4), new Boolean(sb.isRequiredCRF()));
variables.put(new Integer(5), new Boolean(sb.isDoubleEntry()));
variables.put(new Integer(6), new Boolean(sb.isRequireAllTextFilled()));
variables.put(new Integer(7), new Boolean(sb.isDecisionCondition()));
variables.put(new Integer(8), sb.getNullValues());
variables.put(new Integer(9), new Integer(sb.getDefaultVersionId()));
variables.put(new Integer(10), new Integer(sb.getStatus().getId()));
// DATE_Updated
variables.put(new Integer(11), new java.util.Date());
variables.put(new Integer(12), new Integer(sb.getUpdater().getId()));
variables.put(new Integer(13), new Integer(sb.getOrdinal()));
variables.put(new Integer(14), new Boolean(sb.isElectronicSignature()));
variables.put(new Integer(15), new Boolean(sb.isHideCrf()));
variables.put(new Integer(16), new Integer(sb.getSourceDataVerification().getCode()));
variables.put(new Integer(17), sb.getSelectedVersionIds());
if (sb.getParentId() == 0) {
nullVars.put(new Integer(18), new Integer(Types.INTEGER));
variables.put(new Integer(18), null);
} else {
variables.put(new Integer(18), new Integer(sb.getParentId()));
}
variables.put(new Integer(19), new Boolean(sb.isParticipantForm()));
if (sb.isParticipantForm()) {
variables.put(new Integer(20), new Boolean(sb.isAllowAnonymousSubmission()));
} else {
sb.setAllowAnonymousSubmission(false);
variables.put(new Integer(20), new Boolean(sb.isAllowAnonymousSubmission()));
}
if (sb.isAllowAnonymousSubmission()) {
variables.put(new Integer(21), sb.getSubmissionUrl());
} else {
sb.setSubmissionUrl("");
variables.put(new Integer(21), sb.getSubmissionUrl());
}
variables.put(new Integer(22), new Integer(sb.getId()));
String sql = digester.getQuery("update");
this.execute(sql, variables, nullVars);
return sb;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findAllParentsByDefinition.
/**
* Find all EventDefinitionCRFBean which have no parent
* EventDefinitionCRFBean.
*
* @param definitionId
* @return
*/
public Collection findAllParentsByDefinition(int definitionId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(definitionId));
String sql = digester.getQuery("findAllParentsByDefinition");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
EventDefinitionCRFBean eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
Aggregations