Search in sources :

Example 66 with ItemBean

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;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 67 with ItemBean

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;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 68 with ItemBean

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;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) HashMap(java.util.HashMap)

Example 69 with ItemBean

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;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 70 with ItemBean

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;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Aggregations

ItemBean (org.akaza.openclinica.bean.submit.ItemBean)132 ArrayList (java.util.ArrayList)77 DisplayItemBean (org.akaza.openclinica.bean.submit.DisplayItemBean)56 HashMap (java.util.HashMap)50 ItemDAO (org.akaza.openclinica.dao.submit.ItemDAO)43 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)42 ItemFormMetadataBean (org.akaza.openclinica.bean.submit.ItemFormMetadataBean)36 ItemGroupBean (org.akaza.openclinica.bean.submit.ItemGroupBean)26 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)25 Iterator (java.util.Iterator)23 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)22 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)22 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)21 ItemFormMetadataDAO (org.akaza.openclinica.dao.submit.ItemFormMetadataDAO)20 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)15 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)15 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)15 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)13 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)13 DisplayItemGroupBean (org.akaza.openclinica.bean.submit.DisplayItemGroupBean)13