Search in sources :

Example 1 with OdmClinicalDataBean

use of org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean in project OpenClinica by OpenClinica.

the class GenerateClinicalDataServiceImpl method constructClinicalDataStudy.

private OdmClinicalDataBean constructClinicalDataStudy(List<StudySubject> studySubjs, Study study, List<StudyEvent> studyEvents, String formVersionOID) {
    OdmClinicalDataBean odmClinicalDataBean = new OdmClinicalDataBean();
    ExportSubjectDataBean expSubjectBean;
    List<ExportSubjectDataBean> exportSubjDataBeanList = new ArrayList<ExportSubjectDataBean>();
    for (StudySubject studySubj : studySubjs) {
        studyEvents = (ArrayList<StudyEvent>) getStudySubjectDao().fetchListSEs(studySubj.getOcOid());
        if (studyEvents != null) {
            expSubjectBean = setExportSubjectDataBean(studySubj, study, studyEvents, formVersionOID);
            exportSubjDataBeanList.add(expSubjectBean);
            odmClinicalDataBean.setExportSubjectData(exportSubjDataBeanList);
            odmClinicalDataBean.setStudyOID(study.getOc_oid());
        }
    }
    return odmClinicalDataBean;
// return null;
}
Also used : StudySubject(org.akaza.openclinica.domain.datamap.StudySubject) ArrayList(java.util.ArrayList) OdmClinicalDataBean(org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean) StudyEvent(org.akaza.openclinica.domain.datamap.StudyEvent) ExportSubjectDataBean(org.akaza.openclinica.bean.submit.crfdata.ExportSubjectDataBean)

Example 2 with OdmClinicalDataBean

use of org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean in project OpenClinica by OpenClinica.

the class GenerateClinicalDataServiceImpl method getClinicalData.

public LinkedHashMap<String, OdmClinicalDataBean> getClinicalData(String studyOID) {
    LinkedHashMap<String, OdmClinicalDataBean> hm = new LinkedHashMap<String, OdmClinicalDataBean>();
    Study study = new Study();
    study.setOc_oid(studyOID);
    study = getStudyDao().findByColumnName(studyOID, "oc_oid");
    List<StudySubject> studySubjs = study.getStudySubjects();
    if (study.getStudies().size() < 1) {
        hm.put(studyOID, constructClinicalData(study, studySubjs));
    } else // return odmClinicalDataBean;
    {
        // at study level
        hm.put(studyOID, constructClinicalData(study, studySubjs));
        for (Study s : study.getStudies()) {
            // all the sites
            hm.put(s.getOc_oid(), constructClinicalData(s, s.getStudySubjects()));
        }
    }
    return hm;
// return constructClinicalData(study, studySubjs);
}
Also used : Study(org.akaza.openclinica.domain.datamap.Study) StudySubject(org.akaza.openclinica.domain.datamap.StudySubject) OdmClinicalDataBean(org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean) LinkedHashMap(java.util.LinkedHashMap)

Example 3 with OdmClinicalDataBean

use of org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean in project OpenClinica by OpenClinica.

the class FullReportBean method createOdmXml.

/**
     * Create one ODM XML This method is still under construction. Right now it is for Snapshot filetype only.
     */
@Override
public void createOdmXml(boolean isDataset) {
    this.addHeading();
    this.addRootStartLine();
    // add the contents here in order
    // 1) the information about Study
    Iterator<OdmStudyBean> itm = this.odmStudyMap.values().iterator();
    while (itm.hasNext()) {
        OdmStudyBean s = itm.next();
        addNodeStudy(s, isDataset);
    }
    // 2) the information about administrative data
    String ODMVersion = this.getODMVersion();
    if ("oc1.2".equalsIgnoreCase(ODMVersion) || "oc1.3".equalsIgnoreCase(ODMVersion)) {
        Iterator<OdmAdminDataBean> ita = this.adminDataMap.values().iterator();
        while (ita.hasNext()) {
            OdmAdminDataBean a = ita.next();
            addNodeAdminData(a);
        }
    }
    // 3) the information about reference data
    // addNodeReferenceData();
    // 4) the information about clinical Data
    Iterator<OdmClinicalDataBean> itc = this.clinicalDataMap.values().iterator();
    while (itc.hasNext()) {
        OdmClinicalDataBean c = itc.next();
        if (c.getExportSubjectData().size() > 0) {
            addNodeClinicalData(c);
        }
    }
    this.addRootEndLine();
}
Also used : OdmClinicalDataBean(org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean) OdmStudyBean(org.akaza.openclinica.bean.odmbeans.OdmStudyBean) OdmAdminDataBean(org.akaza.openclinica.bean.odmbeans.OdmAdminDataBean)

Example 4 with OdmClinicalDataBean

use of org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean in project OpenClinica by OpenClinica.

the class GenerateClinicalDataServiceImpl method getClinicalData.

/**
     * This is a generic method where the control enters first. Regardless what URL is being used. Depending upon the
     * combination of URL parameters, further course is determined.
     */
@Override
public LinkedHashMap<String, OdmClinicalDataBean> getClinicalData(String studyOID, String studySubjectOID, String studyEventOID, String formVersionOID, Boolean collectDNs, Boolean collectAudit, Locale locale, int userId) {
    setLocale(locale);
    setCollectDns(collectDNs);
    setCollectAudits(collectAudit);
    LinkedHashMap<String, OdmClinicalDataBean> clinicalDataHash = new LinkedHashMap<String, OdmClinicalDataBean>();
    UserAccount userAccount = getUserAccountDao().findByColumnName(userId, "userId");
    LOGGER.debug("Entering the URL with " + studyOID + ":" + studySubjectOID + ":" + studyEventOID + ":" + formVersionOID + ":DNS:" + collectDNs + ":Audits:" + collectAudit);
    LOGGER.info("Determining the generic paramters...");
    Study study = getStudyDao().findByOcOID(studyOID);
    int parentStudyId = 0;
    int studyId = study.getStudyId();
    if (study.getStudy() != null) {
        isActiveRoleAtSite = true;
        parentStudyId = study.getStudy().getStudyId();
    } else {
        parentStudyId = studyId;
        isActiveRoleAtSite = false;
    }
    ArrayList<StudyUserRole> surlist = getStudyUserRoleDao().findAllUserRolesByUserAccount(userAccount, studyId, parentStudyId);
    if (surlist == null || surlist.size() == 0) {
        // Does not have permission to view study or site info / return null
        return null;
    }
    // subject assigned to site is pulled from study level this will get the site OID correctly displayed.
    if (!studySubjectOID.equals(INDICATE_ALL)) {
        StudySubjectDao ssdao = getStudySubjectDao();
        StudySubject ss = (StudySubject) getStudySubjectDao().findByColumnName(studySubjectOID, "ocOid");
        studyOID = ss.getStudy().getOc_oid();
    }
    if (studyEventOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL)) {
        LOGGER.info("Adding all the study events,formevents as it is a *");
        LOGGER.info("study subject is not all and so is study");
        clinicalDataHash.put(studyOID, getClinicalData(studyOID, studySubjectOID));
        return clinicalDataHash;
    } else if (studyEventOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL) && studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL)) {
        LOGGER.info("At the study level.. study event,study subject and forms are *");
        return getClinicalData(studyOID);
    } else if (!studyEventOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL) && formVersionOID.equals(INDICATE_ALL)) {
        LOGGER.info("Obtaining the form version specific");
        clinicalDataHash.put(studyOID, getClinicalDatas(studyOID, studySubjectOID, studyEventOID, null));
        return clinicalDataHash;
    } else if (!studyEventOID.equals(INDICATE_ALL) && !studySubjectOID.equals(INDICATE_ALL) && !studyOID.equals(INDICATE_ALL) && !formVersionOID.equals(INDICATE_ALL)) {
        clinicalDataHash.put(studyOID, getClinicalDatas(studyOID, studySubjectOID, studyEventOID, formVersionOID));
        return clinicalDataHash;
    }
    return null;
}
Also used : Study(org.akaza.openclinica.domain.datamap.Study) StudyUserRole(org.akaza.openclinica.domain.datamap.StudyUserRole) StudySubject(org.akaza.openclinica.domain.datamap.StudySubject) OdmClinicalDataBean(org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean) UserAccount(org.akaza.openclinica.domain.user.UserAccount) StudySubjectDao(org.akaza.openclinica.dao.hibernate.StudySubjectDao) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

OdmClinicalDataBean (org.akaza.openclinica.bean.odmbeans.OdmClinicalDataBean)4 StudySubject (org.akaza.openclinica.domain.datamap.StudySubject)3 LinkedHashMap (java.util.LinkedHashMap)2 Study (org.akaza.openclinica.domain.datamap.Study)2 ArrayList (java.util.ArrayList)1 OdmAdminDataBean (org.akaza.openclinica.bean.odmbeans.OdmAdminDataBean)1 OdmStudyBean (org.akaza.openclinica.bean.odmbeans.OdmStudyBean)1 ExportSubjectDataBean (org.akaza.openclinica.bean.submit.crfdata.ExportSubjectDataBean)1 StudySubjectDao (org.akaza.openclinica.dao.hibernate.StudySubjectDao)1 StudyEvent (org.akaza.openclinica.domain.datamap.StudyEvent)1 StudyUserRole (org.akaza.openclinica.domain.datamap.StudyUserRole)1 UserAccount (org.akaza.openclinica.domain.user.UserAccount)1