<commit_before>package gov.nih.nci.cabig.caaers.domain;

import gov.nih.nci.cabig.caaers.CaaersSystemException;
import gov.nih.nci.cabig.caaers.domain.attribution.*;
import gov.nih.nci.cabig.caaers.domain.meddra.LowLevelTerm;
import gov.nih.nci.cabig.ctms.domain.AbstractMutableDomainObject;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.hibernate.annotations.*;
import org.hibernate.annotations.CascadeType;

import javax.persistence.*;
import javax.persistence.Entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * This class represents the Adverse Event domain object associated with the Adverse event report.
 *
 * @author <NAME>
 * @author <NAME>
 */

@Entity
@GenericGenerator(name = "id-generator", strategy = "native", parameters = {@Parameter(name = "sequence", value = "seq_adverse_events_id")})
public class AdverseEvent extends AbstractMutableDomainObject implements ExpeditedAdverseEventReportChild, RoutineAdverseEventReportChild {
    private AbstractAdverseEventTerm adverseEventTerm;

    private String detailsForOther;

    private Grade grade;

    private Hospitalization hospitalization;

    private Boolean expected; // false assignment removed cause that is not default for RoutineAEs

    private Attribution attributionSummary;

    private String comments;

    private Date startDate;

    private Date endDate;

    private LowLevelTerm lowLevelTerm;

    private ExpeditedAdverseEventReport report;

    private RoutineAdverseEventReport routineReport;

    private List<CourseAgentAttribution> courseAgentAttributions;

    private List<ConcomitantMedicationAttribution> concomitantMedicationAttributions;

    private List<OtherCauseAttribution> otherCauseAttributions;

    private List<DiseaseAttribution> diseaseAttributions;

    private List<SurgeryAttribution> surgeryAttributions;

    private List<RadiationAttribution> radiationAttributions;

    private List<DeviceAttribution> deviceAttributions;

    private List<Outcome> outcomes;

    private AdverseEventReportingPeriod reportingPeriod;

    private Boolean solicited;

    private OutcomeType serious;

    private Boolean requiresReporting;

    private String displayExpected;

    private TimeValue eventApproximateTime;

    private String eventLocation;
    
    public AdverseEvent() {
        solicited = false;
    }

    ///LOGIC
    public void addOutcome(Outcome o) {
        this.getOutcomes().add(o);
    }

    // //// BOUND PROPERTIES

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "low_level_term_id")
    public LowLevelTerm getLowLevelTerm() {
        return lowLevelTerm;<commit_msg>annotated getLowLevelTerm() to EAGER as LAZY was not working properly in oracle , <commit_after>package gov.nih.nci.cabig.caaers.domain;

import gov.nih.nci.cabig.caaers.CaaersSystemException;
import gov.nih.nci.cabig.caaers.domain.attribution.*;
import gov.nih.nci.cabig.caaers.domain.meddra.LowLevelTerm;
import gov.nih.nci.cabig.ctms.domain.AbstractMutableDomainObject;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.hibernate.annotations.*;
import org.hibernate.annotations.CascadeType;

import javax.persistence.*;
import javax.persistence.Entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * This class represents the Adverse Event domain object associated with the Adverse event report.
 *
 * @author <NAME>
 * @author <NAME>
 */

@Entity
@GenericGenerator(name = "id-generator", strategy = "native", parameters = {@Parameter(name = "sequence", value = "seq_adverse_events_id")})
public class AdverseEvent extends AbstractMutableDomainObject implements ExpeditedAdverseEventReportChild, RoutineAdverseEventReportChild {
    private AbstractAdverseEventTerm adverseEventTerm;

    private String detailsForOther;

    private Grade grade;

    private Hospitalization hospitalization;

    private Boolean expected; // false assignment removed cause that is not default for RoutineAEs

    private Attribution attributionSummary;

    private String comments;

    private Date startDate;

    private Date endDate;

    private LowLevelTerm lowLevelTerm;

    private ExpeditedAdverseEventReport report;

    private RoutineAdverseEventReport routineReport;

    private List<CourseAgentAttribution> courseAgentAttributions;

    private List<ConcomitantMedicationAttribution> concomitantMedicationAttributions;

    private List<OtherCauseAttribution> otherCauseAttributions;

    private List<DiseaseAttribution> diseaseAttributions;

    private List<SurgeryAttribution> surgeryAttributions;

    private List<RadiationAttribution> radiationAttributions;

    private List<DeviceAttribution> deviceAttributions;

    private List<Outcome> outcomes;

    private AdverseEventReportingPeriod reportingPeriod;

    private Boolean solicited;

    private OutcomeType serious;

    private Boolean requiresReporting;

    private String displayExpected;

    private TimeValue eventApproximateTime;

    private String eventLocation;
    
    public AdverseEvent() {
        solicited = false;
    }

    ///LOGIC
    public void addOutcome(Outcome o) {
        this.getOutcomes().add(o);
    }

    // //// BOUND PROPERTIES
    // annotated to EAGER as LAZY was not working properly in oracle , 
    // dont make it LAZY , oracle is giving problems.
    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "low_level_term_id")
    public LowLevelTerm getLowLevelTerm() {
        return lowLevelTerm;
{'fraction_non_alphanumeric': 0.0747362774897193, 'fraction_numerical': 0.0, 'mean_word_length': 4.516765285996056, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1568329', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1526, 'n_words': 382}