Example #1
0
        /// <summary>
        /// Get the <see cref="DatasetCompilerContext"/> from the provider, validates its state, and wraps it in <see cref="CompilerValidationContext{DatasetCompilerContext}"/>.
        /// </summary>
        /// <returns>The compiler validation context.</returns>
        /// <param name="request">Execution request.</param>
        /// <exception cref="Validation.LeafRPCException"/>
        /// <exception cref="DbException"/>
        public async Task <CompilerValidationContext <DatasetCompilerContext> > GetCompilerContextAsync(DatasetExecutionRequest request)
        {
            log.LogInformation("Getting dataset query compiler context. Request:{@Request}", request);
            try
            {
                var context = await contextProvider.GetCompilerContextAsync(request);

                var state = GetContextState(context);
                return(new CompilerValidationContext <DatasetCompilerContext>
                {
                    Context = context,
                    State = state
                });
            }
            catch (DbException de)
            {
                log.LogError("Failed to get dataset query context. Context:{@Context} Code:{Code} Error:{Error}", request, de.ErrorCode, de.Message);
                de.MapThrow();
                throw;
            }
        }
Example #2
0
        /// <summary>
        /// Get the <see cref="DemographicCompilerContext"/> from the provider, validates it's state, and wraps it in <see cref="CompilerValidationContext{DemographicCompilerContext}"/>.
        /// </summary>
        /// <returns>The compiler validation context.</returns>
        /// <param name="qr">Query reference.</param>
        /// <exception cref="Validation.LeafRPCException"/>
        /// <exception cref="System.Data.Common.DbException"/>
        public async Task <CompilerValidationContext <DemographicCompilerContext> > GetCompilerContextAsync(QueryRef qr)
        {
            log.LogInformation("Getting DemographicQueryCompilerContext. QueryRef:{@QueryRef}", qr);
            try
            {
                var context = await contextProvider.GetCompilerContextAsync(qr);

                var state = GetContextState(context);
                return(new CompilerValidationContext <DemographicCompilerContext>
                {
                    Context = context,
                    State = state
                });
            }
            catch (DbException de)
            {
                log.LogError("Could not get demographic query context. Query:{@QueryRef} Code:{Code} Error:{Error}", qr, de.ErrorCode, de.Message);
                de.MapThrow();
                throw;
            }
        }
Example #3
0
        public async Task <CompilerValidationContext <PanelDatasetCompilerContext> > GetCompilerContextAsync(QueryRef qr, int panelIdx)
        {
            log.LogInformation("Getting ConceptDatasetCompilerContext. PanelIndex:{@PanelIndex}, QueryRef:{@QueryRef}", panelIdx, qr);
            try
            {
                var context = await contextProvider.GetCompilerContextAsync(qr, panelIdx);

                var state = GetContextState(context);
                return(new CompilerValidationContext <PanelDatasetCompilerContext>
                {
                    Context = context,
                    State = state
                });
            }
            catch (DbException de)
            {
                log.LogError("Failed to get PanelDatasetCompilerContext. Query:{@QueryRef} Code:{Code} Error:{Error}", qr, de.ErrorCode, de.Message);
                de.MapThrow();
                throw;
            }
        }