use of org.akaza.openclinica.domain.datamap.StudyEvent in project OpenClinica by OpenClinica.
the class ExpressionBeanService method getStudyEventFromOID.
public StudyEvent getStudyEventFromOID(String oid) {
Integer subjectId = expressionBeanWrapper.getStudySubjectBeanId();
StudyEvent studyEvent = null;
if (oid.contains("[")) {
int leftBracketIndex = oid.indexOf("[");
int rightBracketIndex = oid.indexOf("]");
int ordinal = Integer.valueOf(oid.substring(leftBracketIndex + 1, rightBracketIndex));
studyEvent = expressionBeanWrapper.getStudyEventDaoHib().fetchByStudyEventDefOIDAndOrdinal(oid.substring(0, leftBracketIndex), ordinal, subjectId);
} else
studyEvent = expressionBeanWrapper.getStudyEventDaoHib().fetchByStudyEventDefOIDAndOrdinal(oid, 1, subjectId);
return studyEvent;
}
use of org.akaza.openclinica.domain.datamap.StudyEvent in project OpenClinica by OpenClinica.
the class StudyEventDao method findByStudyEventId.
@Transactional
public StudyEvent findByStudyEventId(int studyEventId) {
Query q = getCurrentSession().createQuery(findByStudyEventIdQuery);
q.setParameter("studyEventId", studyEventId);
return (StudyEvent) q.uniqueResult();
}
use of org.akaza.openclinica.domain.datamap.StudyEvent in project OpenClinica by OpenClinica.
the class StudyEventDao method fetchByStudyEventDefOID.
public StudyEvent fetchByStudyEventDefOID(String oid, Integer studySubjectId) {
String query = " from StudyEvent se where se.studySubject.studySubjectId = :studySubjectId and se.studyEventDefinition.oc_oid = :oid order by se.studyEventDefinition.ordinal,se.sampleOrdinal";
org.hibernate.Query q = getCurrentSession().createQuery(query);
q.setInteger("studySubjectId", studySubjectId);
q.setString("oid", oid);
StudyEvent se = (StudyEvent) q.uniqueResult();
// this.eventPublisher.publishEvent(new OnStudyEventUpdated(se));
return se;
}
use of org.akaza.openclinica.domain.datamap.StudyEvent in project OpenClinica by OpenClinica.
the class StudyEventDao method saveOrUpdate.
@Transactional
public StudyEvent saveOrUpdate(StudyEventContainer container) {
StudyEvent event = saveOrUpdate(container.getEvent());
this.eventPublisher.publishEvent(new OnStudyEventUpdated(container));
return event;
}
use of org.akaza.openclinica.domain.datamap.StudyEvent in project OpenClinica by OpenClinica.
the class GenerateClinicalDataServiceImpl method fetchSE.
private List<StudyEvent> fetchSE(int seOrdinal, List<StudyEvent> studyEvents, String ssOID) {
List<StudyEvent> sEs = new ArrayList<StudyEvent>();
LOGGER.debug("fetching all the study events");
for (StudyEvent se : studyEvents) {
if (se.getSampleOrdinal() == seOrdinal && se.getStudySubject().getOcOid().equals(ssOID)) {
sEs.add(se);
}
}
return sEs;
}
Aggregations