Esempio n. 1
0
 internal ClientTermContextFactory(
     TerminologySqlSettings settings,
     ILogger logger,
     ISeededDatabaseInitializer <ClientTermContext> seededDatabaseInitializer = null)
     : base(settings, logger, seededDatabaseInitializer)
 {
 }
 protected DbContextFactoryBase(
     TerminologySqlSettings settings,
     ILogger logger,
     [CanBeNull] ISeededDatabaseInitializer <TDbContext> seededDatabaseInitializer)
 {
     this.Settings = settings;
     this.Logger   = logger;
     this.SeededDatabaseInitializer = seededDatabaseInitializer;
 }
Esempio n. 3
0
        public ValueSetMetadataModule(
            ISwaggerModelCatalog modelCatalog,
            ISwaggerTagCatalog tagCatalog,
            TerminologySqlSettings settings)
            : base(modelCatalog, tagCatalog)
        {
            modelCatalog.AddModels(
                typeof(CodeSetCodeApiModel),
                typeof(CodeSystem),
                typeof(FindByTermQuery),
                typeof(PagedCollection <ValueSetApiModel>),
                typeof(PagerSettings),
                typeof(ValueSetApiModel),
                typeof(ValueSetCodeApiModel),
                typeof(ValueSetCreationApiModel));

            // /{valueSetId}
            this.RouteDescriber.DescribeRouteWithParams(
                "GetValueSet",
                "Returns one or more ValueSet(s) by ValueSetUniqueId(s)",
                "Gets a ValueSet by it's ValueSetUniqueId or a collection of ValueSets by CSV of ValueSetUniqueId(s)",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[] { ParameterFactory.GetValueSetIdArray(), ParameterFactory.GetSummary(), ParameterFactory.GetCodeSystemCodesArray() },
                new[] { TagsFactory.GetValueSetTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetPaged",
                "Returns a paged list of ValueSets",
                "Gets a paged collection of ValueSets",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetSkip(),
                ParameterFactory.GetTop(settings.DefaultItemsPerPage),
                ParameterFactory.GetSummary(),
                ParameterFactory.GetCodeSystemCodesArray()
            },
                new[] { TagsFactory.GetValueSetTag() });


            this.RouteDescriber.DescribeRouteWithParams(
                "Find",
                "Search by 'Name' of ValueSet operation",
                "Gets a paged collection of ValueSet's matching the 'Name' filter",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                //ParameterFactory.GetContentType(),
                new BodyParameter <FindByTermQuery>(modelCatalog)
                {
                    Required = false
                }
            },
                new[] { TagsFactory.GetValueSetFindTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "AddValueSet",
                "Creates a new value set",
                "Creates a new value set",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                //ParameterFactory.GetContentType(),
                new BodyParameter <ValueSetCreationApiModel>(modelCatalog)
                {
                    Required = true
                }
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });
        }
        public ValueSetMetadataModule(
            ISwaggerModelCatalog modelCatalog,
            ISwaggerTagCatalog tagCatalog,
            TerminologySqlSettings settings)
            : base(modelCatalog, tagCatalog)
        {
            modelCatalog.AddModels(
                typeof(ValueSetFindByTermQuery),
                typeof(PagedCollection <ValueSetApiModel>),
                typeof(PagedCollection <ValueSetItemApiModel>),
                typeof(PagerSettings),
                typeof(ValueSetApiModel),
                typeof(ValueSetItemApiModel),
                typeof(ValueSetCodeApiModel),
                typeof(ValueSetCodeCountApiModel),
                typeof(ClientTermValueSetApiModel),
                typeof(CodeOperation),
                typeof(ValueSetCopyApiModel),
                typeof(ValueSetStatus),
                typeof(CodeOperationSource),
                typeof(OperationInstruction),
                typeof(SortDirection),
                typeof(Guid)
                );

            // /{valueSetGuid}
            this.RouteDescriber.DescribeRouteWithParams(
                "GetValueSet",
                "Returns a ValueSet by it's ValueSetGuid",
                "Gets a ValueSet by it's ValueSetGuid",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 400, Message = "Bad Request"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetValueSetGuid(),
                ParameterFactory.GetSummary(),
                ParameterFactory.GetCodeSystemGuidsArray()
            },
                new[] { TagsFactory.GetValueSetTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetMultipleValueSets",
                "Gets multiple ValueSets",
                "Gets a collection of ValueSet's given a collection of ValueSetGuid(s)",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <MultipleValueSetsQuery>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[] { TagsFactory.GetValueSetTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetPaged",
                "Returns a paged list of ValueSets",
                "Gets a paged collection of ValueSets",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetSkip(),
                ParameterFactory.GetTop(settings.DefaultItemsPerPage),
                ParameterFactory.GetSummary(),
                ParameterFactory.GetCodeSystemGuidsArray(),
                ParameterFactory.GetQueryStringStatusCode(),
                ParameterFactory.GetOrderBy("Name")
            },
                new[] { TagsFactory.GetValueSetTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetValueSetVersions",
                "Gets all versions of a ValueSet",
                "Gets all versions of a ValueSet by it's published ID (Usually OID)",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[] { ParameterFactory.GetValueSetReferenceId(), ParameterFactory.GetSummary(), ParameterFactory.GetCodeSystemGuidsArray() },
                new[] { TagsFactory.GetValueSetTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "Search",
                "Search by 'Name' of ValueSet operation",
                "Gets a paged collection of ValueSet's matching the 'Name' filter",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <ValueSetFindByTermQuery>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[] { TagsFactory.GetValueSetTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "AddValueSet",
                "Creates a new value set",
                "Creates a new value set",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 400, Message = "Bad Request"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <ClientTermValueSetApiModel>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });

            this.RouteDescriber.DescribeRouteWithParams(
                "PatchValueSet",
                "Updates a value set",
                "Updates a value set",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 400, Message = "Bad Request"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetValueSetGuid(),
                new BodyParameter <ClientTermValueSetApiModel>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });

            this.RouteDescriber.DescribeRouteWithParams(
                "ChangeValueSetStatus",
                "Updates the status of an existing value set",
                "Updates the status of an existing value set.  Draft may be changed to active.  Active may be changed to Archived.  Archived may be changed to Active.",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetValueSetGuid(),
                ParameterFactory.GetPathStatusCode()
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });

            this.RouteDescriber.DescribeRouteWithParams(
                "CopyValueSet",
                "Creates a copy of a ValueSet",
                "Creates a copy of a ValueSet",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <ValueSetCopyApiModel>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });

            this.RouteDescriber.DescribeRouteWithParams(
                "CompareValueSets",
                "Compares two or more ValueSets",
                "Compares two or more ValueSets",
                new[]
            {
                new HttpResponseMetadata <ValueSetApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <CompareValueSetsQuery>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });

            this.RouteDescriber.DescribeRouteWithParams(
                "DeleteValueSet",
                "Deletes a client term ValueSet",
                "Deletes a client term ValueSet.  Request is only valid for client term value sets with a 'Draft' status.",
                new[]
            {
                new HttpResponseMetadata {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 400, Message = "Bad Request"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetValueSetGuid()
            },
                new[]
            {
                TagsFactory.GetValueSetTag()
            });
        }
Esempio n. 5
0
 public ClientTermContext(DbContextOptions options, TerminologySqlSettings settings)
     : base(options)
 {
     this.Settings = settings;
 }
Esempio n. 6
0
 public ClientTermContextFactory(TerminologySqlSettings sqlSettings, ILogger logger)
     : this(sqlSettings, logger, null)
 {
 }
Esempio n. 7
0
        public ValueSetCodeMetadataModule(
            ISwaggerModelCatalog modelCatalog,
            ISwaggerTagCatalog tagCatalog,
            TerminologySqlSettings settings)
            : base(modelCatalog, tagCatalog)
        {
            modelCatalog.AddModel <PagedCollection <ValueSetCodeApiModel> >();

            this.RouteDescriber.DescribeRouteWithParams(
                "GetAllValueSetCodesPaged",
                "Returns a paged list of value set codes",
                "Gets a paged collection of value set codes",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetCodeApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetSkip(),
                ParameterFactory.GetTop(settings.DefaultItemsPerPage),
                ParameterFactory.GetCodeSystemGuidsArray()
            },
                new[] { TagsFactory.GetValueSetCodeTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetValueSetCodes",
                "Returns a list of value set codes for a given a CodeGuid",
                "Gets a list of value set codes for a given a CodeGuid",
                new[]
            {
                new HttpResponseMetadata <IEnumerable <ValueSetCodeApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetCodeGuid()
            },
                new[]
            {
                TagsFactory.GetValueSetCodeTag()
            });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetValueSetCodePagedByValueSet",
                "Returns a paged list of value set codes",
                "Gets a paged collection of value set codes",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetCodeApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetValueSetGuid(),
                ParameterFactory.GetSkip(),
                ParameterFactory.GetTop(settings.DefaultItemsPerPage),
                ParameterFactory.GetCodeSystemGuidsArray()
            },
                new[] { TagsFactory.GetValueSetCodeTag() });
        }
        public CodeSystemCodeMetadataModule(
            ISwaggerModelCatalog modelCatalog,
            ISwaggerTagCatalog tagCatalog,
            TerminologySqlSettings settings)
            : base(modelCatalog, tagCatalog)
        {
            modelCatalog.AddModel <CodeSystemCodeApiModel>();
            modelCatalog.AddModel <PagedCollection <CodeSystemCodeApiModel> >();
            modelCatalog.AddModel <MultipleCodeSystemCodeQuery>();
            modelCatalog.AddModel <FindByTermQuery>();
            modelCatalog.AddModel <BatchCodeQuery>();
            modelCatalog.AddModel <BatchCodeResultApiModel>();
            modelCatalog.AddModel <Guid>();

            this.RouteDescriber.DescribeRouteWithParams(
                "GetCodeSystemCode",
                "Returns a code system code by it's CodeGuid (key)",
                "Gets a CodeSystemCode by it's CodeGuid",
                new[]
            {
                new HttpResponseMetadata <CodeSystemCodeApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 404, Message = "Not Found"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[] { ParameterFactory.GetCodeGuid() },
                new[] { TagsFactory.GetCodeSystemCodeTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetPagedCodeSystemCodes",
                "Returns a paged collection of code system codes",
                "Gets a paged collection of code system codes",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <ValueSetApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                ParameterFactory.GetSkip(),
                ParameterFactory.GetTop(settings.DefaultItemsPerPage),
                ParameterFactory.GetCodeSystemGuidsArray()
            },
                new[] { TagsFactory.GetCodeSystemCodeTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetCodeSystemCodes",
                "Gets multiple code system codes",
                "Gets an array of code system codes matching the CodeGuid collection",
                new[]
            {
                new HttpResponseMetadata <IEnumerable <CodeSystemCodeApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <MultipleCodeSystemCodeQuery>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[] { TagsFactory.GetCodeSystemCodeTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "GetBatchCodes",
                "Gets a batch code system codes and non matching 'codes' given an array of 'codes', optionally constrained by code system",
                "Gets an array of code system codes matching the 'codes' collection and an array non matching 'codes', optionally constrained by code system",
                new[]
            {
                new HttpResponseMetadata <BatchCodeResultApiModel> {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 400, Message = "Bad Request"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <BatchCodeQuery>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[] { TagsFactory.GetCodeSystemCodeTag() });

            this.RouteDescriber.DescribeRouteWithParams(
                "SearchCodeSystemCodes",
                "Search by 'Name' or 'Code' code system code operation",
                "Gets a paged collection of code system codes matching the 'Name' or 'Code' filter",
                new[]
            {
                new HttpResponseMetadata <PagedCollection <CodeSystemCodeApiModel> > {
                    Code = 200, Message = "OK"
                },
                new HttpResponseMetadata {
                    Code = 500, Message = "Internal Server Error"
                }
            },
                new[]
            {
                new BodyParameter <FindByTermQuery>(modelCatalog)
                {
                    Required = true, Name = "Model"
                }
            },
                new[] { TagsFactory.GetCodeSystemCodeTag() });
        }
 public SharedContextFactory(TerminologySqlSettings sqlSettings, ILogger logger)
     : this(sqlSettings, logger, null)
 {
 }