Beispiel #1
0
        public override void LoadExtraText(string s)
        {
            CohortSummaryAdjustment a;

            if (!CohortSummaryAdjustment.TryParse(s, out a))
            {
                throw new Exception("Could not parse '" + s + "' into a valid CohortSummaryAdjustment");
            }

            Adjustment = a;
        }
Beispiel #2
0
        /// <summary>
        /// Overload that does the operation on a container with (WhereExtractionIdentifiersIn - the only permissable option)
        /// </summary>
        /// <param name="container"></param>
        /// <param name="graph"></param>
        public CohortSummaryAggregateGraphObjectCollection(CohortAggregateContainer container, AggregateConfiguration graph)
            : this()
        {
            if (graph.IsCohortIdentificationAggregate)
            {
                throw new ArgumentException("Parameter graph was AggregateConfiguration '" + graph + "' which is a Cohort Aggregate (not allowed)", "graph");
            }

            DatabaseObjects.Add(container);
            DatabaseObjects.Add(graph);
            Adjustment = CohortSummaryAdjustment.WhereExtractionIdentifiersIn;
        }
Beispiel #3
0
        private string GetAdjustmentDescription(CohortSummaryAdjustment adjustment)
        {
            switch (adjustment)
            {
            case CohortSummaryAdjustment.WhereExtractionIdentifiersIn:
                return("Graphing All Records For Patients");

            case CohortSummaryAdjustment.WhereRecordsIn:
                return("Graphing Cohort Query Result");

            default:
                throw new ArgumentOutOfRangeException("adjustment");
            }
        }
Beispiel #4
0
        /// <summary>
        /// Use this constructor at runtime
        /// </summary>
        /// <param name="cohort"></param>
        /// <param name="graph"></param>
        /// <param name="adjustment"></param>
        public CohortSummaryAggregateGraphObjectCollection(AggregateConfiguration cohort, AggregateConfiguration graph, CohortSummaryAdjustment adjustment) : this()
        {
            if (!cohort.IsCohortIdentificationAggregate)
            {
                throw new ArgumentException("Parameter cohort was AggregateConfiguration '" + cohort + "' which is not a Cohort Aggregate (not allowed)", "cohort");
            }
            if (graph.IsCohortIdentificationAggregate)
            {
                throw new ArgumentException("Parameter graph was AggregateConfiguration '" + graph + "' which is a Cohort Aggregate (not allowed)", "graph");
            }

            DatabaseObjects.Add(cohort);
            DatabaseObjects.Add(graph);
            Adjustment = adjustment;
        }
        /// <summary>
        /// Functions in two modes
        ///
        /// <para>WhereExtractionIdentifiersIn:
        /// Returns a adjusted AggregateBuilder that is based on the summary AggregateConfiguration but which has an inception WHERE statement that restricts the IsExtractionIdentifier column
        /// by those values returned by the Cohort query.  In order that this query doesn't become super insane we require that the Cohort be cached so that it is just a simple single
        /// like IFilter e.g. conceptually: WHERE CHI IN (Select CHI from IndexedExtractionIdentifierList_AggregateConfiguration5)</para>
        ///
        /// <para>WhereRecordsIn
        /// Returns an adjusted AggregateBuilder that is based on the summary AggregateConfiguration but which has an root AND container which includes both the container tree of the summary
        /// and the cohort (resulting in a graphing of the RECORDS returned by the cohort set query instead of a master set of all those patients records - as above does).</para>
        /// </summary>
        /// <returns></returns>
        public AggregateBuilder GetAdjustedAggregateBuilder(CohortSummaryAdjustment adjustment, IFilter singleFilterOnly = null)
        {
            switch (adjustment)
            {
            case CohortSummaryAdjustment.WhereExtractionIdentifiersIn:
                if (singleFilterOnly != null)
                {
                    throw new NotSupportedException("You cannot graph a single IFilter with CohortSummaryAdjustment.WhereExtractionIdentifiersIn");
                }

                return(GetAdjustedForExtractionIdentifiersIn());

            case CohortSummaryAdjustment.WhereRecordsIn:
                return(GetAdjustedForRecordsIn(singleFilterOnly));

            default:
                throw new ArgumentOutOfRangeException("adjustment");
            }
        }
Beispiel #6
0
 public CohortSummaryAggregateGraphObjectCollection(AggregateConfiguration cohort, AggregateConfiguration graph, CohortSummaryAdjustment adjustment, AggregateFilter singleFilterOnly) : this(cohort, graph, adjustment)
 {
     DatabaseObjects.Add(singleFilterOnly);
 }