use of org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean in project OpenClinica by OpenClinica.
the class StudyEventDefinitionDAO method findAllByStudyAndLimit.
public Collection findAllByStudyAndLimit(int studyId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(studyId));
variables.put(new Integer(2), new Integer(studyId));
ArrayList alist = this.select(digester.getQuery("findAllByStudyAndLimit"), variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
StudyEventDefinitionBean eb = (StudyEventDefinitionBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean in project OpenClinica by OpenClinica.
the class StudyEventDefinitionDAO method findAllActiveByParentStudyId.
public ArrayList<StudyEventDefinitionBean> findAllActiveByParentStudyId(int parentStudyId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(parentStudyId));
ArrayList alist = this.select(digester.getQuery("findAllActiveByParentStudyId"), variables);
ArrayList<StudyEventDefinitionBean> al = new ArrayList<StudyEventDefinitionBean>();
Iterator it = alist.iterator();
while (it.hasNext()) {
StudyEventDefinitionBean eb = (StudyEventDefinitionBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean in project OpenClinica by OpenClinica.
the class StudyEventDefinitionDAO method findByOid.
public StudyEventDefinitionBean findByOid(String oid) {
StudyEventDefinitionBean studyEventDefinitionBean = new StudyEventDefinitionBean();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), oid);
String sql = digester.getQuery("findByOid");
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
if (it.hasNext()) {
studyEventDefinitionBean = (StudyEventDefinitionBean) this.getEntityFromHashMap((HashMap) it.next());
return studyEventDefinitionBean;
} else {
return null;
}
}
use of org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean in project OpenClinica by OpenClinica.
the class OpenClinicaVariableNode method validateEvent.
void validateEvent() throws OpenClinicaSystemException {
StudyEventDefinitionBean studyEventDefinition = getExpressionService().getStudyEventDefinitionFromExpressionForEventScheduling(number);
String studyEventOID = number.split("\\.")[0];
String expressionContext = expressionWrapper.getExpressionContext();
//Verify expression refers to a valid event.
if (studyEventDefinition == null)
throw new OpenClinicaSystemException("OCRERR_0034", new String[] { number });
//Verify expression doesn't use repeating event notation if event is not repeating
if (!studyEventDefinition.isRepeating() && studyEventOID.matches(REPEATING))
throw new OpenClinicaSystemException("OCRERR_0039", new String[] { number });
//Verify only Target expressions use the 'ALL' repeating notation.
if (expressionContext != null && !expressionContext.equals(ExpressionObjectWrapper.CONTEXT_TARGET)) {
if (studyEventOID.matches(REPEATING) && !studyEventOID.matches(REPEATING_NOALL))
throw new OpenClinicaSystemException("OCRERR_0040", new String[] { number });
}
}
use of org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean in project OpenClinica by OpenClinica.
the class MetadataUnit method collectMetaDataVersion.
/**
* To retrieve the ODM with form version OID as one of the parameters
* @param formVersionOID
*/
private void collectMetaDataVersion(String formVersionOID) {
StudyBean study = studyBase.getStudy();
OdmExtractDAO oedao = new OdmExtractDAO(this.ds);
MetaDataVersionBean metadata = this.odmStudy.getMetaDataVersion();
ODMBean odmBean = new ODMBean();
odmBean.setODMVersion("oc1.3");
setOdmBean(odmBean);
ArrayList<StudyEventDefinitionBean> sedBeansInStudy = (ArrayList<StudyEventDefinitionBean>) studyBase.getSedBeansInStudy();
if (sedBeansInStudy == null || sedBeansInStudy.size() < 1) {
logger.info("null, because there is no study event definition in this study.");
return;
}
if (metadata.getOid() == null || metadata.getOid().length() <= 0) {
metadata.setOid("v1.0.0");
}
if (metadata.getName() == null || metadata.getName().length() <= 0) {
metadata.setName("MetaDataVersion_v1.0.0");
}
oedao.getODMMetadataForForm(metadata, formVersionOID, this.odmBean.getODMVersion());
}
Aggregations