예제 #1
0
        /// <summary>
        /// performs execution of the MEANS command
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {

                Dictionary<string, string> setProperties = this.Context.GetGlobalSettingProperties();

                List<string> NumericVariableList = new List<string>();
                NumericVariableList.Add(this.Numeric_Variable);

                bool isExceptionList = false;
                this.Context.ExpandGroupVariables(NumericVariableList, ref isExceptionList);

                foreach (string Numeric_Variable in NumericVariableList)
                {
                    inputVariableList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

                    inputVariableList.Add("Numeric_Variable", Numeric_Variable);
                    inputVariableList.Add("Cross_Tabulation_Variable", this.Cross_Tabulation_Variable);

                    this.Context.ExpandGroupVariables(this.StratvarList, ref isExceptionList);

                    if (this.StratvarList != null && this.StratvarList.Count > 0)
                    {
                        StringBuilder sb = new StringBuilder();

                        foreach (string s in this.StratvarList)
                        {
                            sb.Append(s);
                            sb.Append(",");
                        }
                        sb.Length = sb.Length - 1;

                        inputVariableList.Add("StratvarList", sb.ToString());
                    }

                    if (!string.IsNullOrEmpty(OutTable))
                    {
                        inputVariableList.Add("OutTable", OutTable);
                    }

                    if (!string.IsNullOrEmpty(WeightVar))
                    {
                        inputVariableList.Add("WeightVar", WeightVar);
                    }
                    inputVariableList.Add("commandText", commandText);
                    if (!string.IsNullOrEmpty(PSUVar))
                    {
                        inputVariableList.Add("PSUVar", PSUVar);
                    }
                    if (this.Context.CurrentRead == null)
                    {
                        inputVariableList.Add("TableName", "");
                    }
                    else
                    {
                        inputVariableList.Add("TableName", this.Context.CurrentRead.Identifier);
                    }

                    if (this.ColumnSize != null)
                    {
                        inputVariableList.Add("ColumnSize", this.ColumnSize);
                    }

                    if (this.NoWrap != null)
                    {
                        inputVariableList.Add("NoWrap", this.NoWrap);
                    }

                    EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                    AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                    if (string.IsNullOrEmpty(this.PSUVar))
                    {
                        this.MeansStatistic = this.Context.GetStatistic("Means", statisticHost);
                    }
                    else
                    {
                        this.MeansStatistic = this.Context.GetStatistic("ComplexSampleMeans", statisticHost);
                    }

                    this.MeansStatistic.Execute();

                    this.MeansStatistic = null;
                }
                this.HasRun = true;
            }

            return result;
        }
예제 #2
0
        /// <summary>
        /// performs execution of the Freq(uency) command
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {
                this.Context.AddConfigSettings(this.SetOptions);

                Dictionary<string, string> setProperties = this.Context.GetGlobalSettingProperties();
                Dictionary<string, string> inputVariableList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
                //bool isExceptionList = false;

                this.Context.ExpandGroupVariables(this.IdentifierList, ref isExceptionList);

                StringBuilder sb = new StringBuilder();
                foreach (string s in IdentifierList)
                {
                    sb.Append(s);
                    sb.Append(",");
                }
                sb.Length = sb.Length - 1;

                inputVariableList.Add("IdentifierList", sb.ToString());

                if (StratvarList != null)
                {
                    sb.Length = 0;

                    foreach (string s in StratvarList)
                    {
                        sb.Append(s);
                        sb.Append(",");
                    }
                    sb.Length = sb.Length - 1;

                    inputVariableList.Add("StratvarList", sb.ToString());
                }

                inputVariableList.Add("OutTable", OutTable);
                inputVariableList.Add("WeightVar", WeightVar);
                inputVariableList.Add("commandText", commandText);
                inputVariableList.Add("PSUVar", PSUVar);
                if (this.Context.CurrentRead == null)
                {
                    inputVariableList.Add("TableName", "");
                }
                else
                {
                    inputVariableList.Add("TableName", this.Context.CurrentRead.Identifier);
                }

                EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

               // Context.DataTableRefreshNeeded = true;

                AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                if (string.IsNullOrEmpty(this.PSUVar))
                {
                    this.FrequencyStatistic = this.Context.GetStatistic("Frequency", statisticHost);
                }
                else
                {
                    this.FrequencyStatistic = this.Context.GetStatistic("ComplexSampleTables", statisticHost);
                }

                this.FrequencyStatistic.Execute();
                this.FrequencyStatistic = null;
                this.HasRun = true;
            }

            return result;
        }
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {
                Dictionary <string, string> setProperties = this.Context.GetGlobalSettingProperties();

                if (!string.IsNullOrEmpty(_commandText))
                {
                    inputVariableList.Add("Command_Text", _commandText);
                }
                if (!string.IsNullOrEmpty(_independentVariableList))
                {
                    inputVariableList.Add("Independent_Variable_List", _independentVariableList.Trim(','));
                }
                if (!string.IsNullOrEmpty(_graphCrossTab))
                {
                    inputVariableList.Add("Cross_Tabulation_Variable", _graphCrossTab);
                }
                if (!string.IsNullOrEmpty(_strataVar))
                {
                    inputVariableList.Add("StrataVar", _strataVar);
                }
                if (!string.IsNullOrEmpty(_graphType))
                {
                    inputVariableList.Add("Graph_Type", _graphType);
                }
                if (!string.IsNullOrEmpty(_graphTitle))
                {
                    inputVariableList.Add("Graph_Title", _graphTitle);
                }
                if (!string.IsNullOrEmpty(_graphXAxisLabel))
                {
                    inputVariableList.Add("Graph_Independent_Value_Axis_Label", _graphXAxisLabel);
                }
                if (!string.IsNullOrEmpty(_graphYAxisLabel))
                {
                    inputVariableList.Add("Graph_Dependent_Value_Axis_Label", _graphYAxisLabel);
                }
                if (!string.IsNullOrEmpty(_weightVar))
                {
                    inputVariableList.Add("Weight_Variable", _weightVar);
                }
                if (!string.IsNullOrEmpty(_aggregateFunction))
                {
                    inputVariableList.Add("Aggregate_Function", _aggregateFunction);
                }
                if (!string.IsNullOrEmpty(_graphDateFormat))
                {
                    inputVariableList.Add("Date_Format", _graphDateFormat);
                }

                if (!string.IsNullOrEmpty(_graphInterval))
                {
                    inputVariableList.Add("Interval", _graphInterval);
                }
                if (!string.IsNullOrEmpty(_graphIntervalUnits))
                {
                    inputVariableList.Add("Interval_Units", _graphIntervalUnits);
                }
                if (!string.IsNullOrEmpty(_graphStartFrom))
                {
                    inputVariableList.Add("Start_From", _graphStartFrom);
                }

                EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                this.GraphStatistic = this.Context.GetStatistic("Graph", statisticHost);
                this.GraphStatistic.Execute();
                this.GraphStatistic = null;
                this.HasRun         = true;
            }
            return(result);
        }
예제 #4
0
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {
                //Configuration config = Configuration.GetNewInstance();


                Dictionary <string, string> setProperties = this.Context.GetGlobalSettingProperties();
                List <string> ExposureVariableList        = new List <string>();
                ExposureVariableList.Add(this.Exposure);

                bool isExceptionList = false;
                this.Context.ExpandGroupVariables(ExposureVariableList, ref isExceptionList);


                foreach (string EXPOSURE_VARIABLE in ExposureVariableList)
                {
                    inputVariableList = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

                    inputVariableList.Add("EXPOSURE_VARIABLE", EXPOSURE_VARIABLE);
                    inputVariableList.Add("OUTCOME_VARIABLE", this.Outcome);

                    if (this.Stratvar != null)
                    {
                        StringBuilder temp = new StringBuilder();
                        foreach (string s in Stratvar)
                        {
                            temp.Append(s);
                            temp.Append(',');
                        }
                        if (temp.Length > 0)
                        {
                            temp.Length = temp.Length - 1;
                        }
                        inputVariableList.Add("STRATAVAR", temp.ToString());
                    }

                    if (!string.IsNullOrEmpty(OutTable))
                    {
                        inputVariableList.Add("OutTable", OutTable);
                    }

                    if (!string.IsNullOrEmpty(WeightVar))
                    {
                        inputVariableList.Add("WeightVar", WeightVar);
                    }
                    if (!tablesShowStatistics)
                    {
                        inputVariableList.Add("STATISTICS", "NONE");
                    }
                    inputVariableList.Add("commandText", commandText);
                    if (!string.IsNullOrEmpty(PSUVar))
                    {
                        inputVariableList.Add("PSUVar", PSUVar);
                    }
                    if (this.Context.CurrentRead == null)
                    {
                        inputVariableList.Add("TableName", "");
                    }
                    else
                    {
                        inputVariableList.Add("TableName", this.Context.CurrentRead.Identifier);
                    }

                    EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                    AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                    if (!inputVariableList.ContainsKey("PSUVAR"))
                    {
                        this.TablesStatistic = this.Context.GetStatistic("Tables", statisticHost);
                    }
                    else
                    {
                        this.TablesStatistic = this.Context.GetStatistic("ComplexSampleTables", statisticHost);
                    }

                    this.TablesStatistic.Execute();

                    this.TablesStatistic = null;
                }

                this.HasRun = true;
            }

            return(result);
        }
예제 #5
0
        /// <summary>
        /// performs execution of the Freq(uency) command
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {
                this.Context.AddConfigSettings(this.SetOptions);

                Dictionary <string, string> setProperties     = this.Context.GetGlobalSettingProperties();
                Dictionary <string, string> inputVariableList = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
                //bool isExceptionList = false;

                this.Context.ExpandGroupVariables(this.IdentifierList, ref isExceptionList);

                StringBuilder sb = new StringBuilder();
                foreach (string s in IdentifierList)
                {
                    sb.Append(s);
                    sb.Append(",");
                }
                sb.Length = sb.Length - 1;

                inputVariableList.Add("IdentifierList", sb.ToString());

                if (StratvarList != null)
                {
                    sb.Length = 0;

                    foreach (string s in StratvarList)
                    {
                        sb.Append(s);
                        sb.Append(",");
                    }
                    sb.Length = sb.Length - 1;

                    inputVariableList.Add("StratvarList", sb.ToString());
                }

                inputVariableList.Add("OutTable", OutTable);
                inputVariableList.Add("WeightVar", WeightVar);
                inputVariableList.Add("commandText", commandText);
                inputVariableList.Add("PSUVar", PSUVar);
                if (this.Context.CurrentRead == null)
                {
                    inputVariableList.Add("TableName", "");
                }
                else
                {
                    inputVariableList.Add("TableName", this.Context.CurrentRead.Identifier);
                }

                EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                // Context.DataTableRefreshNeeded = true;

                AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                if (string.IsNullOrEmpty(this.PSUVar))
                {
                    this.FrequencyStatistic = this.Context.GetStatistic("Frequency", statisticHost);
                }
                else
                {
                    this.FrequencyStatistic = this.Context.GetStatistic("ComplexSampleTables", statisticHost);
                }

                this.FrequencyStatistic.Execute();
                this.FrequencyStatistic = null;
                this.HasRun             = true;
            }

            return(result);
        }
예제 #6
0
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {

                Dictionary<string, string> setProperties = this.Context.GetGlobalSettingProperties();

                if (!string.IsNullOrEmpty(_commandText)) inputVariableList.Add("Command_Text", _commandText);
                if (!string.IsNullOrEmpty(_independentVariableList)) inputVariableList.Add("Independent_Variable_List", _independentVariableList.Trim(','));
                if (!string.IsNullOrEmpty(_graphCrossTab)) inputVariableList.Add("Cross_Tabulation_Variable", _graphCrossTab);
                if (!string.IsNullOrEmpty(_strataVar)) inputVariableList.Add("StrataVar", _strataVar);
                if (!string.IsNullOrEmpty(_graphType)) inputVariableList.Add("Graph_Type", _graphType);
                if (!string.IsNullOrEmpty(_graphTitle)) inputVariableList.Add("Graph_Title", _graphTitle);
                if (!string.IsNullOrEmpty(_graphXAxisLabel)) inputVariableList.Add("Graph_Independent_Value_Axis_Label", _graphXAxisLabel);
                if (!string.IsNullOrEmpty(_graphYAxisLabel)) inputVariableList.Add("Graph_Dependent_Value_Axis_Label", _graphYAxisLabel);
                if (!string.IsNullOrEmpty(_weightVar)) inputVariableList.Add("Weight_Variable", _weightVar);
                if (!string.IsNullOrEmpty(_aggregateFunction)) inputVariableList.Add("Aggregate_Function", _aggregateFunction);
                if (!string.IsNullOrEmpty(_graphDateFormat)) inputVariableList.Add("Date_Format", _graphDateFormat);

                if (!string.IsNullOrEmpty(_graphInterval)) inputVariableList.Add("Interval", _graphInterval);
                if (!string.IsNullOrEmpty(_graphIntervalUnits)) inputVariableList.Add("Interval_Units", _graphIntervalUnits);
                if (!string.IsNullOrEmpty(_graphStartFrom)) inputVariableList.Add("Start_From", _graphStartFrom);

                EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                this.GraphStatistic = this.Context.GetStatistic("Graph", statisticHost);
                this.GraphStatistic.Execute();
                this.GraphStatistic = null;
                this.HasRun = true;
            }
            return result;
        }
예제 #7
0
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {
                //Configuration config = Configuration.GetNewInstance();

                Dictionary<string, string> setProperties = this.Context.GetGlobalSettingProperties();
                List<string> ExposureVariableList = new List<string>();
                ExposureVariableList.Add(this.Exposure);

                bool isExceptionList = false;
                this.Context.ExpandGroupVariables(ExposureVariableList, ref isExceptionList);

                foreach (string EXPOSURE_VARIABLE in ExposureVariableList)
                {
                    inputVariableList = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

                    inputVariableList.Add("EXPOSURE_VARIABLE", EXPOSURE_VARIABLE);
                    inputVariableList.Add("OUTCOME_VARIABLE", this.Outcome);

                    if (this.Stratvar != null)
                    {
                        StringBuilder temp = new StringBuilder();
                        foreach (string s in Stratvar)
                        {
                            temp.Append(s);
                            temp.Append(',');
                        }
                        if (temp.Length > 0)
                        {
                            temp.Length = temp.Length - 1;
                        }
                        inputVariableList.Add("STRATAVAR", temp.ToString());
                    }

                    if (!string.IsNullOrEmpty(OutTable))
                    {
                        inputVariableList.Add("OutTable", OutTable);
                    }

                    if (!string.IsNullOrEmpty(WeightVar))
                    {
                        inputVariableList.Add("WeightVar", WeightVar);
                    }
                    inputVariableList.Add("commandText", commandText);
                    if (!string.IsNullOrEmpty(PSUVar))
                    {
                        inputVariableList.Add("PSUVar", PSUVar);
                    }
                    if (this.Context.CurrentRead == null)
                    {
                        inputVariableList.Add("TableName", "");
                    }
                    else
                    {
                        inputVariableList.Add("TableName", this.Context.CurrentRead.Identifier);
                    }

                    EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                    AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                    if (!inputVariableList.ContainsKey("PSUVAR"))
                    {
                        this.TablesStatistic = this.Context.GetStatistic("Tables", statisticHost);
                    }
                    else
                    {
                        this.TablesStatistic = this.Context.GetStatistic("ComplexSampleTables", statisticHost);
                    }

                    this.TablesStatistic.Execute();

                    this.TablesStatistic = null;
                }

                this.HasRun = true;
            }

            return result;
        }
예제 #8
0
        /// <summary>
        /// performs execution of the MEANS command
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (!this.HasRun)
            {
                Dictionary <string, string> setProperties = this.Context.GetGlobalSettingProperties();

                List <string> NumericVariableList = new List <string>();
                NumericVariableList.Add(this.Numeric_Variable);

                bool isExceptionList = false;
                this.Context.ExpandGroupVariables(NumericVariableList, ref isExceptionList);


                foreach (string Numeric_Variable in NumericVariableList)
                {
                    inputVariableList = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

                    inputVariableList.Add("Numeric_Variable", Numeric_Variable);
                    inputVariableList.Add("Cross_Tabulation_Variable", this.Cross_Tabulation_Variable);


                    this.Context.ExpandGroupVariables(this.StratvarList, ref isExceptionList);

                    if (this.StratvarList != null && this.StratvarList.Count > 0)
                    {
                        StringBuilder sb = new StringBuilder();

                        foreach (string s in this.StratvarList)
                        {
                            sb.Append(s);
                            sb.Append(",");
                        }
                        sb.Length = sb.Length - 1;

                        inputVariableList.Add("StratvarList", sb.ToString());
                    }

                    if (!string.IsNullOrEmpty(OutTable))
                    {
                        inputVariableList.Add("OutTable", OutTable);
                    }

                    if (!string.IsNullOrEmpty(WeightVar))
                    {
                        inputVariableList.Add("WeightVar", WeightVar);
                    }
                    inputVariableList.Add("commandText", commandText);
                    if (!string.IsNullOrEmpty(PSUVar))
                    {
                        inputVariableList.Add("PSUVar", PSUVar);
                    }
                    if (this.Context.CurrentRead == null)
                    {
                        inputVariableList.Add("TableName", "");
                    }
                    else
                    {
                        inputVariableList.Add("TableName", this.Context.CurrentRead.Identifier);
                    }

                    if (this.ColumnSize != null)
                    {
                        inputVariableList.Add("ColumnSize", this.ColumnSize);
                    }

                    if (this.NoWrap != null)
                    {
                        inputVariableList.Add("NoWrap", this.NoWrap);
                    }

                    EpiInfo.Plugin.IDataSource DataSource = this.Context.GetDefaultIDataSource();

                    AnalysisStatisticExecuteHost statisticHost = new AnalysisStatisticExecuteHost(this.Context, setProperties, DataSource, inputVariableList, this.Context.CurrentSelect.ToString(), this.Context.AnalysisInterpreterHost);

                    if (string.IsNullOrEmpty(this.PSUVar))
                    {
                        this.MeansStatistic = this.Context.GetStatistic("Means", statisticHost);
                    }
                    else
                    {
                        this.MeansStatistic = this.Context.GetStatistic("ComplexSampleMeans", statisticHost);
                    }

                    this.MeansStatistic.Execute();

                    this.MeansStatistic = null;
                }
                this.HasRun = true;
            }

            return(result);
        }