コード例 #1
0
        public void OnRefreshObject(ICoreChildProvider childProvider, RefreshObjectEventArgs e)
        {
            if (_tree == null)
            {
                return;
            }

            var alwaysShowList = _tree.ModelFilter as AlwaysShowListOnlyFilter;

            if (_beforeModelFilter is CatalogueCollectionFilter f1)
            {
                f1.ChildProvider = childProvider;
            }

            if (_tree.ModelFilter is CatalogueCollectionFilter f2)
            {
                f2.ChildProvider = childProvider;
            }

            //someone somehow erased the pin filter? or overwrote it with another filter
            if (alwaysShowList == null)
            {
                return;
            }

            if (_toPin != null)
            {
                RefreshAlwaysShowList(childProvider, childProvider.GetDescendancyListIfAnyFor(_toPin));
            }
        }
コード例 #2
0
        public FilterManagerFromChildProvider(CatalogueRepository repository, ICoreChildProvider childProvider) : base(repository)
        {
            _containersToFilters =
                childProvider.AllAggregateFilters.Where(f => f.FilterContainer_ID.HasValue)
                .GroupBy(f => f.FilterContainer_ID.Value)
                .ToDictionary(gdc => gdc.Key, gdc => gdc.ToList());

            var server = repository.DiscoveredServer;

            using (var con = repository.GetConnection())
            {
                var r = server.GetCommand("SELECT [AggregateFilterContainer_ParentID],[AggregateFilterContainer_ChildID]  FROM [AggregateFilterSubContainer]", con).ExecuteReader();
                while (r.Read())
                {
                    var parentId       = Convert.ToInt32(r["AggregateFilterContainer_ParentID"]);
                    var subcontainerId = Convert.ToInt32(r["AggregateFilterContainer_ChildID"]);

                    if (!_subcontainers.ContainsKey(parentId))
                    {
                        _subcontainers.Add(parentId, new List <AggregateFilterContainer>());
                    }

                    _subcontainers[parentId].Add(childProvider.AllAggregateContainersDictionary[subcontainerId]);
                }
                r.Close();
            }
        }
コード例 #3
0
        public string GetDatasetSampleSQL(int topX = 1000, ICoreChildProvider childProvider = null)
        {
            if (configuration == null)
            {
                throw new NotSupportedException("Can only generate select * statements when constructed for a single AggregateConfiguration, this was constructed with a container as the root entity (it may even reflect a UNION style query that spans datasets)");
            }

            //Show the user all the fields (*) unless there is a HAVING or it is a Patient Index Table.
            string selectList =
                string.IsNullOrWhiteSpace(configuration.HavingSQL) && !configuration.IsJoinablePatientIndexTable() ? "*" : null;

            RecreateHelpers(new QueryBuilderCustomArgs(selectList, "" /*removes distinct*/, topX));

            Results.BuildFor(configuration, ParameterManager);

            string sampleSQL = Results.Sql;

            string parameterSql = "";

            //get resolved parameters for the select * query
            var finalParams = ParameterManager.GetFinalResolvedParametersList().ToArray();

            if (finalParams.Any())
            {
                parameterSql = QueryBuilder.GetParameterDeclarationSQL(finalParams);

                return(parameterSql + Environment.NewLine + sampleSQL);
            }

            return(sampleSQL);
        }
コード例 #4
0
        public CohortQueryBuilderDependency(AggregateConfiguration cohortSet,
                                            JoinableCohortAggregateConfigurationUse patientIndexTableIfAny, ICoreChildProvider childProvider)
        {
            _childProvider         = childProvider;
            CohortSet              = cohortSet;
            PatientIndexTableIfAny = patientIndexTableIfAny;

            //record the IsExtractionIdentifier column for the log (helps with debugging count issues)
            var eis = cohortSet?.AggregateDimensions?.Where(d => d.IsExtractionIdentifier).ToArray();

            //Multiple IsExtractionIdentifier columns is a big problem but it's handled elsewhere
            if (eis != null && eis.Length == 1)
            {
                ExtractionIdentifierColumn = eis[0];
            }

            if (PatientIndexTableIfAny != null)
            {
                var join = _childProvider.AllJoinables.SingleOrDefault(j =>
                                                                       j.ID == PatientIndexTableIfAny.JoinableCohortAggregateConfiguration_ID);

                if (join == null)
                {
                    throw new Exception("ICoreChildProvider did not know about the provided patient index table");
                }

                JoinedTo = _childProvider.AllAggregateConfigurations.SingleOrDefault(ac =>
                                                                                     ac.ID == join.AggregateConfiguration_ID);

                if (JoinedTo == null)
                {
                    throw new Exception("ICoreChildProvider did not know about the provided patient index table AggregateConfiguration");
                }
            }
        }
コード例 #5
0
 private void SetChildProviderIfNull()
 {
     if (_childProvider == null)
     {
         _childProvider = new CatalogueChildProvider(
             configuration?.CatalogueRepository ?? container.CatalogueRepository, null, null);
     }
 }
コード例 #6
0
 public CatalogueCollectionFilter(ICoreChildProvider childProvider)
 {
     ChildProvider      = childProvider;
     _isInternal        = UserSettings.ShowInternalCatalogues;
     _isDeprecated      = UserSettings.ShowDeprecatedCatalogues;
     _isColdStorage     = UserSettings.ShowColdStorageCatalogues;
     _isProjectSpecific = UserSettings.ShowProjectSpecificCatalogues;
     _isNonExtractable  = UserSettings.ShowNonExtractableCatalogues;
 }
コード例 #7
0
        /// <summary>
        /// Creates a new result for a single <see cref="AggregateConfiguration"/> or <see cref="CohortAggregateContainer"/>
        /// </summary>
        /// <param name="cacheServer"></param>
        /// <param name="childProvider"></param>
        /// <param name="helper"></param>
        /// <param name="customise"></param>
        public CohortQueryBuilderResult(ExternalDatabaseServer cacheServer, ICoreChildProvider childProvider, CohortQueryBuilderHelper helper, QueryBuilderCustomArgs customise)
        {
            CacheServer   = cacheServer;
            ChildProvider = childProvider;
            Helper        = helper;
            Customise     = customise;

            if (cacheServer != null)
            {
                CacheManager = new CachedAggregateConfigurationResultsManager(CacheServer);
            }
        }
コード例 #8
0
        public void FetchAllRelationships(ICoreChildProvider childProvider)
        {
            using (var con = CatalogueRepository.GetConnection())
            {
                //find all the cohort SET operation subcontainers e.g. UNION Ag1,Ag2,(Agg3 INTERSECT Agg4) would have 2 CohortAggregateContainers (the UNION and the INTERSECT) in which the INTERSECT was the child container of the UNION
                var r = CatalogueRepository.DiscoveredServer.GetCommand("SELECT [CohortAggregateContainer_ParentID],[CohortAggregateContainer_ChildID] FROM [CohortAggregateSubContainer] ORDER BY CohortAggregateContainer_ParentID", con).ExecuteReader();

                while (r.Read())
                {
                    var currentParentId = Convert.ToInt32(r["CohortAggregateContainer_ParentID"]);
                    var currentChildId  = Convert.ToInt32(r["CohortAggregateContainer_ChildID"]);

                    if (!_contents.ContainsKey(currentParentId))
                    {
                        _contents.Add(currentParentId, new List <IOrderable>());
                    }

                    _contents[currentParentId].Add(childProvider.AllCohortAggregateContainers.Single(c => c.ID == currentChildId));
                }
                r.Close();

                //now find all the Agg configurations within the containers too, (in the above example we will find Agg1 in the UNION container at order 1 and Agg2 at order 2 and then we find Agg3 and Agg4 in the INTERSECT container)
                r = CatalogueRepository.DiscoveredServer.GetCommand(@"SELECT [CohortAggregateContainer_ID], [AggregateConfiguration_ID],[Order] FROM [CohortAggregateContainer_AggregateConfiguration] ORDER BY CohortAggregateContainer_ID", con).ExecuteReader();

                while (r.Read())
                {
                    var currentParentId = Convert.ToInt32(r["CohortAggregateContainer_ID"]);
                    var currentChildId  = Convert.ToInt32(r["AggregateConfiguration_ID"]);
                    var currentOrder    = Convert.ToInt32(r["Order"]);

                    if (!_contents.ContainsKey(currentParentId))
                    {
                        _contents.Add(currentParentId, new List <IOrderable>());
                    }

                    AggregateConfiguration config;

                    try
                    {
                        config = childProvider.AllAggregateConfigurations.Single(a => a.ID == currentChildId);
                    }
                    catch (Exception)
                    {
                        throw new Exception("Error occured trying to find AggregateConfiguration with ID " + currentChildId + " which is allegedly a child of CohortAggregateContainer " + currentParentId);
                    }

                    config.SetKnownOrder(currentOrder);

                    _contents[currentParentId].Add(config);
                }
            }
        }
コード例 #9
0
ファイル: CollectionPinFilterUI.cs プロジェクト: rkm/RDMP
        public void OnRefreshObject(ICoreChildProvider childProvider, RefreshObjectEventArgs e)
        {
            if(_tree == null)
                return;

            var whitelistFilter = _tree.ModelFilter as WhiteListOnlyFilter;
            
            //someone somehow erased the pin filter? or overwrote it with another filter
            if(whitelistFilter == null)
                return;

            if(_toPin != null)
                RefreshWhiteList(childProvider,childProvider.GetDescendancyListIfAnyFor(_toPin));
        }
コード例 #10
0
        //Constructors - This one is the base one called by all others
        private CohortQueryBuilder(IEnumerable <ISqlParameter> globals, ICoreChildProvider childProvider)
        {
            _childProvider = childProvider;
            globals        = globals ?? new ISqlParameter[] {};
            _globals       = globals.ToArray();
            TopX           = -1;

            SQLOutOfDate = true;

            foreach (ISqlParameter parameter in _globals)
            {
                ParameterManager.AddGlobalParameter(parameter);
            }
        }
コード例 #11
0
ファイル: CollectionPinFilterUI.cs プロジェクト: rkm/RDMP
        private void RefreshWhiteList(ICoreChildProvider childProvider,DescendancyList descendancy)
        {
            //get rid of all objects that are not the object to emphasise tree either as parents or as children (recursive)
            List<object> whitelist = new List<object>();

            //add parents to whitelist
            if (descendancy != null && descendancy.Parents.Any())
                whitelist.AddRange(descendancy.Parents);

            whitelist.Add(_toPin);

            whitelist.AddRange(childProvider.GetAllChildrenRecursively(_toPin));
            
            _tree.UseFiltering = true;
            _tree.ModelFilter = new WhiteListOnlyFilter(whitelist);
        }
コード例 #12
0
        private void SetAspectGet(ICoreChildProvider childProvider)
        {
            AspectGetter = (o) =>
            {
                if (o == null)
                {
                    return("Null");
                }

                var parent = childProvider.GetDescendancyListIfAnyFor(o)?.GetMostDescriptiveParent();

                return(parent != null ? $"{o.ID} {o.GetType().Name} {o} ({parent})" : $"{o.ID} {o.GetType().Name} {o}");
            };

            _scorer           = new SearchablesMatchScorer();
            _scorer.TypeNames = new HashSet <string>(_masterCollection.Select(m => m.Key.GetType().Name).Distinct(), StringComparer.CurrentCultureIgnoreCase);
        }
コード例 #13
0
        /// <inheritdoc/>
        public override void RefreshProblems(ICoreChildProvider childProvider)
        {
            _childProvider = childProvider;

            //Take all the catalogue items which DONT have an associated ColumnInfo (should hopefully be quite rare)
            var orphans = _childProvider.AllCatalogueItems.Where(ci => ci.ColumnInfo_ID == null);

            //now identify those which have an ExtractionInformation (that's a problem! they are extractable but orphaned)
            _orphanCatalogueItems = new HashSet <int>(
                orphans.Where(o => _childProvider.AllExtractionInformations.Any(ei => ei.CatalogueItem_ID == o.ID))

                //store just the ID for performance
                .Select(i => i.ID));

            _usedJoinables = new HashSet <int>(
                childProvider.AllJoinableCohortAggregateConfigurationUse.Select(
                    ju => ju.JoinableCohortAggregateConfiguration_ID));
        }
コード例 #14
0
        /// <summary>
        /// Read class description to see what the class does, use this constructor to specify an Aggregate graph and a cohort with which to restrict it.  The cohort
        /// aggregate must return a list of private identifiers.  The parameters must belong to the same Catalogue (dataset).
        /// </summary>
        /// <param name="summary">A basic aggregate that you want to restrict by cohort e.g. a pivot on drugs prescribed over time with an axis interval of year</param>
        /// <param name="cohort">A cohort aggregate that has a single AggregateDimension which must be an IsExtractionIdentifier and must follow the correct cohort aggregate naming conventions (See IsCohortIdentificationAggregate)</param>
        /// <param name="childProvider"></param>
        public CohortSummaryQueryBuilder(AggregateConfiguration summary, AggregateConfiguration cohort, ICoreChildProvider childProvider)
        {
            if (cohort == null)
            {
                throw new ArgumentException("cohort was null in CohortSummaryQueryBuilder constructor", "cohort");
            }

            if (summary.Equals(cohort))
            {
                throw new ArgumentException("Summary and Cohort should be different aggregates.  Summary should be a graphable useful aggregate while cohort should return a list of private identifiers");
            }

            ThrowIfNotValidGraph(summary);

            try
            {
                ThrowIfNotCohort(cohort);
            }
            catch (Exception e)
            {
                throw new ArgumentException("The second argument to constructor CohortSummaryQueryBuilder should be a cohort identification aggregate (i.e. have a single AggregateDimension marked IsExtractionIdentifier and have a name starting with " + CohortIdentificationConfiguration.CICPrefix + ") but the argument you passed ('" + cohort + "') was NOT a cohort identification configuration aggregate", e);
            }

            if (summary.Catalogue_ID != cohort.Catalogue_ID)
            {
                throw new ArgumentException("Constructor arguments to CohortSummaryQueryBuilder must belong to the same dataset (i.e. have the same underlying Catalogue), the first argument (the graphable aggregate) was called '" + summary + " and belonged to Catalogue ID " + summary.Catalogue_ID + " while the second argument (the cohort) was called '" + cohort + "' and belonged to Catalogue ID " + cohort.Catalogue_ID);
            }

            _summary       = summary;
            _cohort        = cohort;
            _childProvider = childProvider;

            //here we take the identifier from the cohort because the dataset might have multiple identifiers e.g. birth record could have patient Id, parent Id, child Id etc.  The Aggregate will already have one of those selected and only one of them selected
            _extractionIdentifierColumn = _cohort.AggregateDimensions.Single(d => d.IsExtractionIdentifier);

            var cic = _cohort.GetCohortIdentificationConfigurationIfAny();

            if (cic == null)
            {
                throw new ArgumentException("AggregateConfiguration " + _cohort + " looked like a cohort but did not belong to any CohortIdentificationConfiguration");
            }

            _globals = cic.GetAllParameters();
        }
コード例 #15
0
ファイル: ActivateItems.cs プロジェクト: HDRUK/RDMP
        protected override ICoreChildProvider GetChildProvider()
        {
            //constructor call in base class
            if (PluginUserInterfaces == null)
            {
                return(null);
            }

            //Dispose the old one
            ICoreChildProvider temp = null;

            //prefer a linked repository with both
            if (RepositoryLocator.DataExportRepository != null)
            {
                try
                {
                    temp = new DataExportChildProvider(RepositoryLocator, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as DataExportChildProvider);
                }
                catch (Exception e)
                {
                    ExceptionViewer.Show(e);
                }
            }

            //there was an error generating a data export repository or there was no repository specified

            //so just create a catalogue one
            if (temp == null)
            {
                temp = new CatalogueChildProvider(RepositoryLocator.CatalogueRepository, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as CatalogueChildProvider);
            }

            // first time
            if (CoreChildProvider == null)
            {
                CoreChildProvider = temp;
            }
            else
            {
                CoreChildProvider.UpdateTo(temp);
            }

            return(CoreChildProvider);
        }
コード例 #16
0
        public override void UpdateTo(ICoreChildProvider other)
        {
            lock (WriteLock)
            {
                base.UpdateTo(other);

                if (!(other is DataExportChildProvider dxOther))
                {
                    throw new NotSupportedException("Did not know how to UpdateTo ICoreChildProvider of type " + other.GetType().Name);
                }

                //That's one way to avoid memory leaks... anyone holding onto a stale one of these is going to have a bad day
                RootCohortsNode                                  = dxOther.RootCohortsNode;
                CohortSources                                    = dxOther.CohortSources;
                ExtractableDataSets                              = dxOther.ExtractableDataSets;
                SelectedDataSets                                 = dxOther.SelectedDataSets;
                AllPackages                                      = dxOther.AllPackages;
                Projects                                         = dxOther.Projects;
                _cohortsByOriginId                               = dxOther._cohortsByOriginId;
                Cohorts                                          = dxOther.Cohorts;
                ExtractionConfigurations                         = dxOther.ExtractionConfigurations;
                ExtractionConfigurationsByProject                = dxOther.ExtractionConfigurationsByProject;
                _configurationToDatasetMapping                   = dxOther._configurationToDatasetMapping;
                _dataExportFilterManager                         = dxOther._dataExportFilterManager;
                ForbidListedSources                              = dxOther.ForbidListedSources;
                DuplicatesByProject                              = dxOther.DuplicatesByProject;
                DuplicatesByCohortSourceUsedByProjectNode        = dxOther.DuplicatesByCohortSourceUsedByProjectNode;
                ProjectNumberToCohortsDictionary                 = dxOther.ProjectNumberToCohortsDictionary;
                AllProjectAssociatedCics                         = dxOther.AllProjectAssociatedCics;
                AllGlobalExtractionFilterParameters              = dxOther.AllGlobalExtractionFilterParameters;
                _cicAssociations                                 = dxOther._cicAssociations;
                AllFreeCohortIdentificationConfigurationsNode    = dxOther.AllFreeCohortIdentificationConfigurationsNode;
                AllProjectCohortIdentificationConfigurationsNode = dxOther.AllProjectCohortIdentificationConfigurationsNode;
                _selectedDataSetsWithNoIsExtractionIdentifier    = dxOther._selectedDataSetsWithNoIsExtractionIdentifier;
                AllContainers                                    = dxOther.AllContainers;
                AllDeployedExtractionFilters                     = dxOther.AllDeployedExtractionFilters;
                _allParameters                                   = dxOther._allParameters;
                dataExportRepository                             = dxOther.dataExportRepository;
                _extractionInformationsByCatalogueItem           = dxOther._extractionInformationsByCatalogueItem;
                _extractionProgressesBySelectedDataSetID         = dxOther._extractionProgressesBySelectedDataSetID;
            }
        }
コード例 #17
0
        public CohortQueryBuilder(CohortIdentificationConfiguration configuration, ICoreChildProvider childProvider) : this(configuration.GetAllParameters(), childProvider)
        {
            if (configuration == null)
            {
                throw new QueryBuildingException("Configuration has not been set yet");
            }

            if (configuration.RootCohortAggregateContainer_ID == null)
            {
                throw new QueryBuildingException("Root container not set on CohortIdentificationConfiguration " + configuration);
            }

            if (configuration.QueryCachingServer_ID != null)
            {
                CacheServer = configuration.QueryCachingServer;
            }

            //set ourselves up to run with the root container
            container = configuration.RootCohortAggregateContainer;

            SetChildProviderIfNull();
        }
コード例 #18
0
        /// <summary>
        /// Creates a new result for a single <see cref="AggregateConfiguration"/> or <see cref="CohortAggregateContainer"/>
        /// </summary>
        /// <param name="cacheServer"></param>
        /// <param name="childProvider"></param>
        /// <param name="helper"></param>
        /// <param name="customise"></param>
        /// <param name="cancellationToken"></param>
        public CohortQueryBuilderResult(ExternalDatabaseServer cacheServer, ICoreChildProvider childProvider, CohortQueryBuilderHelper helper, QueryBuilderCustomArgs customise, CancellationToken cancellationToken)
        {
            CacheServer       = cacheServer;
            ChildProvider     = childProvider;
            Helper            = helper;
            Customise         = customise;
            CancellationToken = cancellationToken;

            if (cacheServer != null)
            {
                CacheManager = new CachedAggregateConfigurationResultsManager(CacheServer);

                try
                {
                    PluginCohortCompilers = new PluginCohortCompilerFactory(cacheServer.CatalogueRepository.MEF).CreateAll();
                }
                catch (Exception ex)
                {
                    throw new Exception("Failed to build list of IPluginCohortCompilers", ex);
                }
            }
        }
コード例 #19
0
        protected virtual ICoreChildProvider GetChildProvider()
        {
            // Build new CoreChildProvider in a temp then update to it to avoid stale references
            ICoreChildProvider temp = null;

            //prefer a linked repository with both
            if (RepositoryLocator.DataExportRepository != null)
            {
                try
                {
                    temp = new DataExportChildProvider(RepositoryLocator, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as DataExportChildProvider);
                }
                catch (Exception e)
                {
                    ShowException("Error constructing DataExportChildProvider", e);
                }
            }

            //there was an error generating a data export repository or there was no repository specified

            //so just create a catalogue one
            if (temp == null)
            {
                temp = new CatalogueChildProvider(RepositoryLocator.CatalogueRepository, PluginUserInterfaces.ToArray(), GlobalErrorCheckNotifier, CoreChildProvider as CatalogueChildProvider);
            }

            // first time
            if (CoreChildProvider == null)
            {
                CoreChildProvider = temp;
            }
            else
            {
                CoreChildProvider.UpdateTo(temp);
            }

            return(CoreChildProvider);
        }
コード例 #20
0
        public ParameterCollectionUIOptions Create(ICollectSqlParameters host, ICoreChildProvider coreChildProvider)
        {
            if (host is TableInfo)
            {
                return(Create((TableInfo)host));
            }

            if (host is ExtractionFilterParameterSet)
            {
                return(Create((ExtractionFilterParameterSet)host));
            }

            if (host is AggregateConfiguration)
            {
                return(Create((AggregateConfiguration)host, coreChildProvider));
            }

            if (host is IFilter)
            {
                FilterUIOptionsFactory factory = new FilterUIOptionsFactory();
                var globals = factory.Create((IFilter)host).GetGlobalParametersInFilterScope();

                return(Create((IFilter)host, globals));
            }

            if (host is CohortIdentificationConfiguration)
            {
                return(Create((CohortIdentificationConfiguration)host, coreChildProvider));
            }

            if (host is ExtractionConfiguration)
            {
                return(Create((ExtractionConfiguration)host));
            }

            throw new ArgumentException("Host Type was not recognised as one of the Types we know how to deal with", "host");
        }
コード例 #21
0
 public ConsoleGuiSelectOne(ICoreChildProvider coreChildProvider, IMapsDirectlyToDatabaseTable[] availableObjects) : this()
 {
     _masterCollection = availableObjects.ToDictionary(k => k, v => coreChildProvider.GetDescendancyListIfAnyFor(v));
     SetAspectGet(coreChildProvider);
 }
コード例 #22
0
 public ConsoleGuiSelectOne(ICoreChildProvider childProvider) : this()
 {
     _masterCollection = childProvider.GetAllSearchables();
     SetAspectGet(childProvider);
 }
コード例 #23
0
 public ConsoleGuiSelectOne(ICoreChildProvider coreChildProvider, IMapsDirectlyToDatabaseTable[] availableObjects) : this()
 {
     _masterCollection = coreChildProvider.GetAllSearchables().Where(k => availableObjects.Contains(k.Key)).ToDictionary(k => k.Key, v => v.Value);
     SetAspectGet(coreChildProvider);
 }
コード例 #24
0
        public CohortQueryBuilder(AggregateConfiguration config, IEnumerable <ISqlParameter> globals, ICoreChildProvider childProvider) : this(globals, childProvider)
        {
            //set ourselves up to run with the root container
            configuration = config;

            SetChildProviderIfNull();
        }
コード例 #25
0
 private void OnRefreshChildProvider(ICoreChildProvider coreChildProvider)
 {
     CoreChildProvider = coreChildProvider;
 }
コード例 #26
0
        private ParameterCollectionUIOptions Create(CohortIdentificationConfiguration cohortIdentificationConfiguration, ICoreChildProvider coreChildProvider)
        {
            var builder = new CohortQueryBuilder(cohortIdentificationConfiguration, coreChildProvider);

            builder.RegenerateSQL();

            var paramManager = builder.ParameterManager;

            return(new ParameterCollectionUIOptions(UseCaseCohortIdentificationConfiguration, cohortIdentificationConfiguration, ParameterLevel.Global, paramManager));
        }
コード例 #27
0
        private ParameterCollectionUIOptions Create(CohortIdentificationConfiguration cohortIdentificationConfiguration, ICoreChildProvider coreChildProvider)
        {
            var builder = new CohortQueryBuilder(cohortIdentificationConfiguration, coreChildProvider);

            try
            {
                builder.RegenerateSQL();
            }
            catch (QueryBuildingException ex)
            {
                ExceptionViewer.Show("There was a problem resolving all the underlying parameters in all your various Aggregates, the following dialogue is reliable only for the Globals", ex);
            }

            var paramManager = builder.ParameterManager;

            return(new ParameterCollectionUIOptions(UseCaseCohortIdentificationConfiguration, cohortIdentificationConfiguration, ParameterLevel.Global, paramManager));
        }
コード例 #28
0
        public ParameterCollectionUIOptions Create(AggregateConfiguration aggregateConfiguration, ICoreChildProvider coreChildProvider)
        {
            ParameterManager pm;

            if (aggregateConfiguration.IsCohortIdentificationAggregate)
            {
                //Add the globals if it is part of a CohortIdentificationConfiguration
                var cic = aggregateConfiguration.GetCohortIdentificationConfigurationIfAny();

                var globals = cic != null?cic.GetAllParameters() : new ISqlParameter[0];

                var builder = new CohortQueryBuilder(aggregateConfiguration, globals, coreChildProvider);
                pm = builder.ParameterManager;

                try
                {
                    //Generate the SQL which will make it find all the other parameters
                    builder.RegenerateSQL();
                }
                catch (QueryBuildingException)
                {
                    //if there's a problem with parameters or anything else, it is okay this dialog might let the user fix that
                }
            }
            else
            {
                var builder = aggregateConfiguration.GetQueryBuilder();
                pm = builder.ParameterManager;

                try
                {
                    //Generate the SQL which will make it find all the other parameters
                    builder.RegenerateSQL();
                }
                catch (QueryBuildingException)
                {
                    //if there's a problem with parameters or anything else, it is okay this dialog might let the user fix that
                }
            }


            return(new ParameterCollectionUIOptions(UseCaseAggregateConfiguration, aggregateConfiguration, ParameterLevel.CompositeQueryLevel, pm));
        }
コード例 #29
0
ファイル: ProblemProvider.cs プロジェクト: 24418863/rdm
 public abstract void RefreshProblems(ICoreChildProvider childProvider);
コード例 #30
0
 /// <inheritdoc/>
 public override void RefreshProblems(ICoreChildProvider childProvider)
 {
     _exportChildProvider = childProvider as DataExportChildProvider;
 }