use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.
the class CRFDAO method update.
public EntityBean update(EntityBean eb) {
CRFBean cb = (CRFBean) eb;
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(cb.getStatus().getId()));
// variables.put(Integer.valueOf(2), cb.getLabel());
variables.put(Integer.valueOf(2), cb.getName());
variables.put(Integer.valueOf(3), cb.getDescription());
variables.put(Integer.valueOf(4), Integer.valueOf(cb.getUpdater().getId()));
variables.put(Integer.valueOf(5), Integer.valueOf(cb.getId()));
this.execute(digester.getQuery("update"), variables);
return eb;
}
use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.
the class CRFDAO method create.
public EntityBean create(EntityBean eb) {
CRFBean cb = (CRFBean) eb;
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(cb.getStatus().getId()));
// variables.put(Integer.valueOf(2), cb.getLabel());
variables.put(Integer.valueOf(2), cb.getName());
variables.put(Integer.valueOf(3), cb.getDescription());
variables.put(Integer.valueOf(4), Integer.valueOf(cb.getOwner().getId()));
variables.put(Integer.valueOf(5), getValidOid(cb, cb.getName()));
variables.put(Integer.valueOf(6), cb.getStudyId());
// am i the only one who runs their daos' unit tests after I change
// things, tbh?
this.execute(digester.getQuery("create"), variables);
if (isQuerySuccessful()) {
cb.setActive(true);
}
return cb;
}
use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.
the class CRFDAO method findByLayoutId.
public CRFBean findByLayoutId(int formLayoutId) {
CRFBean answer = new CRFBean();
this.unsetTypeExpected();
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(formLayoutId));
String sql = digester.getQuery("findByLayoutId");
ArrayList rows = select(sql, variables);
if (rows.size() > 0) {
HashMap row = (HashMap) rows.get(0);
answer = (CRFBean) getEntityFromHashMap(row);
}
return answer;
}
use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.
the class OdmExtractDAO method getEventDefCRF.
private EventDefinitionCRFBean getEventDefCRF(StudyEventDefBean studyEventDefBean, ElementRefBean formRef, int studyId) {
StudyBean studyBean = (StudyBean) sdao.findByPK(studyId);
StudyEventDefinitionBean sedBean = seddao.findByOid(studyEventDefBean.getOid());
CRFBean crfBean = crfdao.findByOid(formRef.getElementDefOID());
return edcdao.findByStudyEventDefinitionIdAndCRFId(studyBean, sedBean.getId(), crfBean.getId());
}
use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.
the class OdmExtractDAO method getFormLayoutRefs.
List<ElementRefBean> getFormLayoutRefs(FormDefBean formDef) {
CRFBean crfBean = crfdao.findByOid(formDef.getOid());
List<FormLayoutBean> formLayouts = fldao.findAllByCRFId(crfBean.getId());
List<ElementRefBean> elementRefs = new ArrayList<>();
ElementRefBean element;
for (FormLayoutBean formLayout : formLayouts) {
element = new ElementRefBean();
element.setName(formLayout.getName());
element.setUrl(formLayout.getUrl());
elementRefs.add(element);
}
return elementRefs;
}
Aggregations