Search in sources :

Example 6 with ItemGroupBean

use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.

the class ItemGroupDAO method findByOid.

public ItemGroupBean findByOid(String oid) {
    ItemGroupBean itemGroup = new ItemGroupBean();
    this.unsetTypeExpected();
    setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), oid);
    String sql = digester.getQuery("findGroupByOid");
    ArrayList rows = this.select(sql, variables);
    Iterator it = rows.iterator();
    if (it.hasNext()) {
        itemGroup = (ItemGroupBean) this.getEntityFromHashMap((HashMap) it.next());
        return itemGroup;
    } else {
        return null;
    }
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean)

Example 7 with ItemGroupBean

use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.

the class ItemGroupDAO method findGroupByCRFVersionIDMap.

public List<ItemGroupBean> findGroupByCRFVersionIDMap(int Id) {
    this.setTypesExpected();
    HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
    variables.put(1, Id);
    List listofMaps = this.select(digester.getQuery("findGroupByCRFVersionIDMap"), variables);
    List<ItemGroupBean> beanList = new ArrayList<ItemGroupBean>();
    ItemGroupBean bean;
    for (Object map : listofMaps) {
        bean = (ItemGroupBean) this.getEntityFromHashMap((HashMap) map);
        beanList.add(bean);
    }
    return beanList;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean)

Example 8 with ItemGroupBean

use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.

the class ItemGroupDAO method findByPK.

public EntityBean findByPK(int ID) {
    ItemGroupBean formGroupB = new ItemGroupBean();
    this.setTypesExpected();
    HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
    variables.put(1, ID);
    String sql = digester.getQuery("findByPK");
    ArrayList listofMap = this.select(sql, variables);
    for (Object map : listofMap) {
        formGroupB = (ItemGroupBean) this.getEntityFromHashMap((HashMap) map);
    }
    return formGroupB;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean)

Example 9 with ItemGroupBean

use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.

the class ItemGroupDAO method findGroupsByItemID.

// YW 10-30-2007, one item_id might have more than one item_groups
public Collection findGroupsByItemID(int ID) {
    this.setTypesExpected();
    HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
    variables.put(1, ID);
    List listofMap = this.select(digester.getQuery("findGroupsByItemID"), variables);
    List<ItemGroupBean> formGroupBs = new ArrayList<ItemGroupBean>();
    for (Object map : listofMap) {
        ItemGroupBean bean = (ItemGroupBean) this.getEntityFromHashMap((HashMap) map);
        formGroupBs.add(bean);
    }
    return formGroupBs;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean)

Example 10 with ItemGroupBean

use of org.akaza.openclinica.bean.submit.ItemGroupBean in project OpenClinica by OpenClinica.

the class ItemGroupDAO method findByOidAndCrf.

public ItemGroupBean findByOidAndCrf(String oid, int crfId) {
    ItemGroupBean itemGroup = new ItemGroupBean();
    this.unsetTypeExpected();
    setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), oid);
    variables.put(new Integer(2), new Integer(crfId));
    String sql = digester.getQuery("findGroupByOidAndCrfId");
    ArrayList rows = this.select(sql, variables);
    Iterator it = rows.iterator();
    if (it.hasNext()) {
        itemGroup = (ItemGroupBean) this.getEntityFromHashMap((HashMap) it.next());
        return itemGroup;
    } else {
        return null;
    }
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean)

Aggregations

ItemGroupBean (org.akaza.openclinica.bean.submit.ItemGroupBean)71 ArrayList (java.util.ArrayList)45 HashMap (java.util.HashMap)34 ItemBean (org.akaza.openclinica.bean.submit.ItemBean)26 DisplayItemGroupBean (org.akaza.openclinica.bean.submit.DisplayItemGroupBean)25 ItemGroupDAO (org.akaza.openclinica.dao.submit.ItemGroupDAO)23 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)20 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)18 DisplayItemBean (org.akaza.openclinica.bean.submit.DisplayItemBean)17 ItemFormMetadataBean (org.akaza.openclinica.bean.submit.ItemFormMetadataBean)16 ItemGroupMetadataBean (org.akaza.openclinica.bean.submit.ItemGroupMetadataBean)16 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)15 DisplaySectionBean (org.akaza.openclinica.bean.submit.DisplaySectionBean)14 ItemDAO (org.akaza.openclinica.dao.submit.ItemDAO)14 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)13 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)12 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)12 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)11 SectionDAO (org.akaza.openclinica.dao.submit.SectionDAO)11 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)10