Search in sources :

Example 16 with StudyEvent

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;
}
Also used : StudyEvent(org.akaza.openclinica.domain.datamap.StudyEvent)

Example 17 with 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();
}
Also used : Query(org.hibernate.query.Query) StudyEvent(org.akaza.openclinica.domain.datamap.StudyEvent) Transactional(org.springframework.transaction.annotation.Transactional)

Example 18 with StudyEvent

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;
}
Also used : StudyEvent(org.akaza.openclinica.domain.datamap.StudyEvent)

Example 19 with StudyEvent

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;
}
Also used : OnStudyEventUpdated(org.akaza.openclinica.patterns.ocobserver.OnStudyEventUpdated) StudyEvent(org.akaza.openclinica.domain.datamap.StudyEvent) Transactional(org.springframework.transaction.annotation.Transactional)

Example 20 with StudyEvent

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;
}
Also used : ArrayList(java.util.ArrayList) StudyEvent(org.akaza.openclinica.domain.datamap.StudyEvent)

Aggregations

StudyEvent (org.akaza.openclinica.domain.datamap.StudyEvent)25 StudySubject (org.akaza.openclinica.domain.datamap.StudySubject)6 ArrayList (java.util.ArrayList)5 EventCrf (org.akaza.openclinica.domain.datamap.EventCrf)5 Date (java.util.Date)4 FormLayout (org.akaza.openclinica.domain.datamap.FormLayout)4 Study (org.akaza.openclinica.domain.datamap.Study)4 StudyEventDefinition (org.akaza.openclinica.domain.datamap.StudyEventDefinition)4 Transactional (org.springframework.transaction.annotation.Transactional)4 SimpleDateFormat (java.text.SimpleDateFormat)3 HashMap (java.util.HashMap)2 EventDefinitionCrf (org.akaza.openclinica.domain.datamap.EventDefinitionCrf)2 RuleSetBean (org.akaza.openclinica.domain.rule.RuleSetBean)2 EventActionBean (org.akaza.openclinica.domain.rule.action.EventActionBean)2 ExpressionBean (org.akaza.openclinica.domain.rule.expression.ExpressionBean)2 OpenClinicaSystemException (org.akaza.openclinica.exception.OpenClinicaSystemException)2 OpenClinicaExpressionParser (org.akaza.openclinica.logic.expressionTree.OpenClinicaExpressionParser)2 OnStudyEventUpdated (org.akaza.openclinica.patterns.ocobserver.OnStudyEventUpdated)2 StudyEventChangeDetails (org.akaza.openclinica.patterns.ocobserver.StudyEventChangeDetails)2 StudyEventContainer (org.akaza.openclinica.patterns.ocobserver.StudyEventContainer)2