use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findAllByDefinition.
public Collection findAllByDefinition(int definitionId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(definitionId));
String sql = digester.getQuery("findAllByDefinition");
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;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findAllActiveSitesAndStudiesPerParentStudy.
public ArrayList<EventDefinitionCRFBean> findAllActiveSitesAndStudiesPerParentStudy(int parentStudyId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(parentStudyId));
variables.put(new Integer(2), new Integer(parentStudyId));
String sql = digester.getQuery("findAllActiveSitesAndStudiesPerParentStudy");
ArrayList alist = this.select(sql, variables);
ArrayList<EventDefinitionCRFBean> al = new ArrayList();
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 create.
/**
* Creates a new studysubject
*/
@Override
public EntityBean create(EntityBean eb) {
EventDefinitionCRFBean sb = (EventDefinitionCRFBean) eb;
HashMap nullVars = new HashMap();
HashMap variables = new HashMap();
int id = getNextPK();
// INSERT INTO EVENT_DEFINITION_CRF
// (EVENT_DEFINITION_CRF_ID,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,OWNER_ID,DATE_CREATED,ordinal,
// ELECTRONIC_SIGNATURE,HIDE_CRF,SOURCE_DATA_VERIFICATION_ID,
// SELECTED_VERSION_IDS, PARENT_ID)
// VALUES (?,?,?,?,?,?,?,?,?,?,?,?,NOW(),?,?,?,?,?,?)
variables.put(new Integer(1), new Integer(id));
variables.put(new Integer(2), new Integer(sb.getStudyEventDefinitionId()));
variables.put(new Integer(3), new Integer(sb.getStudyId()));
variables.put(new Integer(4), new Integer(sb.getCrfId()));
variables.put(new Integer(5), new Boolean(sb.isRequiredCRF()));
variables.put(new Integer(6), new Boolean(sb.isDoubleEntry()));
variables.put(new Integer(7), new Boolean(sb.isRequireAllTextFilled()));
variables.put(new Integer(8), new Boolean(sb.isDecisionCondition()));
variables.put(new Integer(9), sb.getNullValues());
variables.put(new Integer(10), new Integer(sb.getDefaultVersionId()));
variables.put(new Integer(11), new Integer(sb.getStatus().getId()));
variables.put(new Integer(12), new Integer(sb.getOwnerId()));
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()) {
if (sb.getSubmissionUrl() == null)
sb.setSubmissionUrl("");
variables.put(new Integer(21), sb.getSubmissionUrl());
} else {
sb.setSubmissionUrl("");
variables.put(new Integer(21), sb.getSubmissionUrl());
}
this.execute(digester.getQuery("create"), variables, nullVars);
if (isQuerySuccessful()) {
sb.setId(id);
}
return sb;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findByDefaultVersion.
public ArrayList findByDefaultVersion(int versionId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(versionId));
String sql = digester.getQuery("findByDefaultVersion");
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;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findByPK.
@Override
public EntityBean findByPK(int ID) {
EventDefinitionCRFBean eb = new EventDefinitionCRFBean();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(ID));
String sql = digester.getQuery("findByPK");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
if (it.hasNext()) {
eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
}
return eb;
}
Aggregations