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;
}
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);
}
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();
}
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;
}
Aggregations