use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.
the class ItemDAO method findAllItemsByGroupIdForPrint.
public List<ItemBean> findAllItemsByGroupIdForPrint(int id, int crfVersionId, int sectionId) {
this.setTypesExpected();
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(1, id);
variables.put(2, crfVersionId);
variables.put(3, sectionId);
String sql = digester.getQuery("findAllItemsByGroupIdForPrint");
List listofMaps = this.select(sql, variables);
List<ItemBean> beanList = new ArrayList<ItemBean>();
ItemBean bean;
for (Object map : listofMaps) {
bean = (ItemBean) this.getEntityFromHashMap((HashMap) map);
beanList.add(bean);
}
return beanList;
}
use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.
the class ItemDAO method findByPK.
public EntityBean findByPK(int ID) {
ItemBean eb = new ItemBean();
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 = (ItemBean) this.getEntityFromHashMap((HashMap) it.next());
}
return eb;
}
use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.
the class ItemDAO method create.
public EntityBean create(EntityBean eb) {
ItemBean ib = (ItemBean) eb;
// per the create sql statement
HashMap variables = new HashMap();
variables.put(new Integer(1), ib.getName());
variables.put(new Integer(2), ib.getDescription());
variables.put(new Integer(3), ib.getUnits());
variables.put(new Integer(4), new Boolean(ib.isPhiStatus()));
variables.put(new Integer(5), new Integer(ib.getItemDataTypeId()));
variables.put(new Integer(6), new Integer(ib.getItemReferenceTypeId()));
variables.put(new Integer(7), new Integer(ib.getStatus().getId()));
variables.put(new Integer(8), new Integer(ib.getOwnerId()));
// date_created=now() in Postgres
this.execute(digester.getQuery("create"), variables);
// set the id here????
return eb;
}
use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.
the class FormLayoutDAO method findItemFromMap.
public Collection findItemFromMap(int versionId) {
this.unsetTypeExpected();
this.setTypeExpected(1, TypeNames.INT);
this.setTypeExpected(2, TypeNames.STRING);
this.setTypeExpected(3, TypeNames.INT);
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(versionId));
String sql = digester.getQuery("findItemFromMap");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
ItemBean eb = new ItemBean();
HashMap hm = (HashMap) it.next();
eb.setId(((Integer) hm.get("item_id")).intValue());
eb.setName((String) hm.get("name"));
Integer ownerId = (Integer) hm.get("owner_id");
eb.setOwnerId(ownerId.intValue());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.
the class FormLayoutDAO method findNotSharedItemsByVersion.
public ArrayList findNotSharedItemsByVersion(int versionId) {
this.unsetTypeExpected();
this.setTypeExpected(1, TypeNames.INT);
this.setTypeExpected(2, TypeNames.STRING);
this.setTypeExpected(3, TypeNames.INT);
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(versionId));
variables.put(new Integer(2), new Integer(versionId));
String sql = digester.getQuery("findNotSharedItemsByVersion");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
ItemBean eb = new ItemBean();
HashMap hm = (HashMap) it.next();
eb.setId(((Integer) hm.get("item_id")).intValue());
eb.setName((String) hm.get("name"));
eb.setOwnerId(((Integer) hm.get("owner_id")).intValue());
al.add(eb);
}
return al;
}
Aggregations