use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findAllByCrfDefinitionInSiteOnly.
public ArrayList<EventDefinitionCRFBean> findAllByCrfDefinitionInSiteOnly(int definitionId, int crfId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(definitionId));
variables.put(new Integer(2), new Integer(crfId));
String sql = digester.getQuery("findAllByCrfDefinitionInSiteOnly");
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 findAllActiveByEventDefinitionIdAndSiteIdAndParentStudyId.
public Collection findAllActiveByEventDefinitionIdAndSiteIdAndParentStudyId(int definitionId, int siteId, int parentStudyId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(definitionId));
variables.put(new Integer(2), new Integer(siteId));
variables.put(new Integer(3), new Integer(parentStudyId));
variables.put(new Integer(4), new Integer(definitionId));
variables.put(new Integer(5), new Integer(siteId));
String sql = digester.getQuery("findAllActiveByEventDefinitionIdAndSiteIdAndParentStudyId");
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 findAllSubmissionUriAndStudyId.
public ArrayList<EventDefinitionCRFBean> findAllSubmissionUriAndStudyId(String submissionUri, int studyId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new String(submissionUri));
variables.put(new Integer(2), new Integer(studyId));
variables.put(new Integer(3), new Integer(studyId));
String sql = digester.getQuery("findAllSubmissionUriAndStudyId");
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 getEntityFromHashMap.
/**
* <p>
* getEntityFromHashMap, the method that gets the object from the database
* query.
*/
@Override
public Object getEntityFromHashMap(HashMap hm) {
EventDefinitionCRFBean eb = new EventDefinitionCRFBean();
super.setEntityAuditInformation(eb, hm);
// EVENT_DEFINITION_CRF_ID STUDY_EVENT_DEFINITION_ID STUDY_ID
// CRF_ID REQUIRED_CRF DOUBLE_ENTRY REQUIRE_ALL_TEXT_FILLED
// DECISION_CONDITIONS DEFAULT_VERSION_ID STATUS_ID OWNER_ID
// DATE_CREATED DATE_UPDATED UPDATE_ID
eb.setId(((Integer) hm.get("event_definition_crf_id")).intValue());
eb.setStudyEventDefinitionId(((Integer) hm.get("study_event_definition_id")).intValue());
eb.setStudyId(((Integer) hm.get("study_id")).intValue());
eb.setCrfId(((Integer) hm.get("crf_id")).intValue());
eb.setRequiredCRF(((Boolean) hm.get("required_crf")).booleanValue());
eb.setDoubleEntry(((Boolean) hm.get("double_entry")).booleanValue());
eb.setRequireAllTextFilled(((Boolean) hm.get("require_all_text_filled")).booleanValue());
eb.setDecisionCondition(((Boolean) hm.get("decision_conditions")).booleanValue());
eb.setNullValues((String) hm.get("null_values"));
eb.setDefaultVersionId(((Integer) hm.get("default_version_id")).intValue());
eb.setOrdinal(((Integer) hm.get("ordinal")).intValue());
eb.setElectronicSignature(((Boolean) hm.get("electronic_signature")).booleanValue());
// issue 3212
eb.setHideCrf(((Boolean) hm.get("hide_crf")));
int sdvId = (Integer) hm.get("source_data_verification_code");
eb.setSourceDataVerification(SourceDataVerification.getByCode(sdvId > 0 ? sdvId : 3));
String selectedVersionIds = (String) hm.get("selected_version_ids");
eb.setSelectedVersionIds(selectedVersionIds != null ? selectedVersionIds : "");
int parentId = (Integer) hm.get("parent_id");
eb.setParentId(parentId > 0 ? parentId : 0);
eb.setParticipantForm(((Boolean) hm.get("participant_form")).booleanValue());
eb.setAllowAnonymousSubmission(((Boolean) hm.get("allow_anonymous_submission")).booleanValue());
eb.setSubmissionUrl(((String) hm.get("submission_url")));
return eb;
}
use of org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean in project OpenClinica by OpenClinica.
the class EventDefinitionCRFDAO method findAllByCRF.
public Collection findAllByCRF(int crfId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(crfId));
String sql = digester.getQuery("findByCRFId");
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