示例#1
0
        public static Conformance GetSparkConformance(string sparkVersion, ILocalhost localhost)
        {
            var vsn         = ModelInfo.Version;
            var conformance = CreateServer("NGE FHIR Server", sparkVersion, "NextGen Healthcare", vsn);

            conformance.AddAllCoreResources(true, true, Conformance.ResourceVersionPolicy.VersionedUpdate);
            conformance.AddAllSystemInteractions().AddAllInteractionsForAllResources()
            .AddCoreSearchParamsAllResources();
            conformance.AddSummaryForAllResources();
            conformance.AddOperation("Fetch Patient Record",
                                     new ResourceReference
            {
                Url = localhost.Absolute(new Uri("OperationDefinition/Patient-everything", UriKind.Relative))
            });
            conformance.AddOperation("Generate a Document",
                                     new ResourceReference
            {
                Url = localhost.Absolute(new Uri("OperationDefinition/Composition-document", UriKind.Relative))
            });
            conformance.AcceptUnknown = Conformance.UnknownContentCode.Both;
            conformance.Experimental  = true;
            conformance.Kind          = Conformance.ConformanceStatementKind.Capability;
            conformance.Format        = new[] { "xml", "json" };
            conformance.Description   =
                "This is FHIR SERVER"; // is a reference Implementation server built in C# on HL7.Fhir.Core (nuget) by Furore and others";

            return(conformance);
        }
示例#2
0
        public static CapabilityStatement GetSparkCapabilityStatement(string sparkVersion, ILocalhost localhost)
        {
            var vsn = FHIRVersion.N4_0_1;
            var capabilityStatement = CreateServer("Spark", sparkVersion, "Incendi", fhirVersion: vsn);

            capabilityStatement.AddAllCoreResources(
                true,
                true,
                CapabilityStatement.ResourceVersionPolicy.VersionedUpdate);
            capabilityStatement.AddAllSystemInteractions()
            .AddAllInteractionsForAllResources()
            .AddCoreSearchParamsAllResources();
            capabilityStatement.AddSummaryForAllResources();
            capabilityStatement.AddOperation(
                "Fetch Patient Record",
                localhost.Absolute(new Uri("OperationDefinition/Patient-everything", UriKind.Relative)).ToString());
            capabilityStatement.AddOperation(
                "Generate a Document",
                localhost.Absolute(new Uri("OperationDefinition/Composition-document", UriKind.Relative)).ToString());
            //capabilityStatement.AcceptUnknown = CapabilityStatement.UnknownContentCode.Both;
            capabilityStatement.Experimental = true;
            capabilityStatement.Kind         = CapabilityStatementKind.Capability;
            capabilityStatement.Format       = new string[] { "xml", "json" };
            capabilityStatement.Description  = new Markdown("This FHIR SERVER is a reference Implementation server built in C# on HL7.Fhir.Core (nuget) by Firely, Incendi and others");

            return(capabilityStatement);
        }
示例#3
0
文件: Export.cs 项目: tomhydra/spark
        //Key ExternalizeReference(Key original)
        //{
        //    KeyKind triage = (localhost.GetKeyKind(original));
        //    if (triage == KeyKind.Foreign | triage == KeyKind.Temporary)
        //    {
        //        Key replacement = mapper.TryGet(original);
        //        if (replacement != null)
        //        {
        //            return replacement;
        //        }
        //        else
        //        {
        //            throw new SparkException(HttpStatusCode.Conflict, "This reference does not point to a resource in the server or the current transaction: {0}", original);
        //        }
        //    }
        //    else if (triage == KeyKind.Local)
        //    {
        //        return original.WithoutBase();
        //    }
        //    else
        //    {
        //        return original;
        //    }
        //}

        string ExternalizeReference(string uristring)
        {
            if (string.IsNullOrWhiteSpace(uristring))
            {
                return(uristring);
            }

            Uri uri = new Uri(uristring, UriKind.RelativeOrAbsolute);

            if (!uri.IsAbsoluteUri && exportSettings.ExternalizeFhirUri)
            {
                var absoluteUri = localhost.Absolute(uri);
                if (absoluteUri.Fragment == uri.ToString()) //don't externalize uri's that are just anchor fragments
                {
                    return(uristring);
                }
                else
                {
                    return(absoluteUri.ToString());
                }
            }
            else
            {
                return(uristring);
            }
        }
示例#4
0
        private static SearchParams ParseQueryString(ILocalhost localhost, Uri searchUri)
        {
            var absoluteUri    = localhost.Absolute(searchUri);
            var keysCollection = ParseQueryString(absoluteUri);

            return(SearchParams.FromUriParamList(keysCollection));
        }
示例#5
0
        private static SearchParams ParseQueryString(ILocalhost localhost, Uri searchUri)
        {
            Uri absoluteUri = localhost.Absolute(searchUri);
            NameValueCollection keysCollection = UriExtensions.ParseQueryString(absoluteUri);

            IEnumerable <Tuple <string, string> > searchValues =
                keysCollection.Keys.Cast <string>()
                .Select(k => new Tuple <string, string>(k, keysCollection[k]));

            return(SearchParams.FromUriParamList(searchValues));
        }
        public static CapabilityStatement GetSparkCapabilityStatement(string sparkVersion, ILocalhost localhost)
        {
            string vsn = Hl7.Fhir.Model.ModelInfo.Version;
            CapabilityStatement conformance = CreateServer("Spark", sparkVersion, "Furore", fhirVersion: vsn);

            conformance.AddAllCoreResources(readhistory: true, updatecreate: true, versioning: CapabilityStatement.ResourceVersionPolicy.VersionedUpdate);
            conformance.AddAllSystemInteractions().AddAllInteractionsForAllResources().AddCoreSearchParamsAllResources();
            conformance.AddSummaryForAllResources();
            conformance.AddOperation("Fetch Patient Record", new ResourceReference()
            {
                Url = localhost.Absolute(new Uri("OperationDefinition/Patient-everything", UriKind.Relative))
            });
            conformance.AddOperation("Generate a Document", new ResourceReference()
            {
                Url = localhost.Absolute(new Uri("OperationDefinition/Composition-document", UriKind.Relative))
            });

            conformance.AcceptUnknown = CapabilityStatement.UnknownContentCode.Both;
            conformance.Experimental  = true;
            conformance.Format        = new string[] { "xml", "json" };
            conformance.Description   = new Markdown("This FHIR SERVER is a reference Implementation server built in C# on HL7.Fhir.Core (nuget) by Furore and others");

            return(conformance);
        }
示例#7
0
        //Key ExternalizeReference(Key original)
        //{
        //    KeyKind triage = (localhost.GetKeyKind(original));
        //    if (triage == KeyKind.Foreign | triage == KeyKind.Temporary)
        //    {
        //        Key replacement = mapper.TryGet(original);
        //        if (replacement != null)
        //        {
        //            return replacement;
        //        }
        //        else
        //        {
        //            throw new SparkException(HttpStatusCode.Conflict, "This reference does not point to a resource in the server or the current transaction: {0}", original);
        //        }
        //    }
        //    else if (triage == KeyKind.Local)
        //    {
        //        return original.WithoutBase();
        //    }
        //    else
        //    {
        //        return original;
        //    }
        //}

        Uri ExternalizeReference(Uri uri)
        {
            if (uri == null)
            {
                return(null);
            }
            else if (!uri.IsAbsoluteUri)
            {
                return(localhost.Absolute(uri));
            }
            else
            {
                return(uri);
            }
        }
示例#8
0
        private void BuildLinks(Bundle bundle, int?start = null)
        {
            bundle.SelfLink = start == null
                ? _localhost.Absolute(new Uri(_snapshot.FeedSelfLink, UriKind.RelativeOrAbsolute))
                : BuildSnapshotPageLink(0);

            bundle.FirstLink = BuildSnapshotPageLink(0);
            bundle.LastLink  = BuildSnapshotPageLink(_snapshotPaginationCalculator.GetIndexForLastPage(_snapshot));

            var previousPageIndex = _snapshotPaginationCalculator.GetIndexForPreviousPage(_snapshot, start);

            if (previousPageIndex != null)
            {
                bundle.PreviousLink = BuildSnapshotPageLink(previousPageIndex);
            }

            var nextPageIndex = _snapshotPaginationCalculator.GetIndexForNextPage(_snapshot, start);

            if (nextPageIndex != null)
            {
                bundle.NextLink = BuildSnapshotPageLink(nextPageIndex);
            }
        }
示例#9
0
        //Key ExternalizeReference(Key original)
        //{
        //    KeyKind triage = (localhost.GetKeyKind(original));
        //    if (triage == KeyKind.Foreign | triage == KeyKind.Temporary)
        //    {
        //        Key replacement = mapper.TryGet(original);
        //        if (replacement != null)
        //        {
        //            return replacement;
        //        }
        //        else
        //        {
        //            throw new SparkException(HttpStatusCode.Conflict, "This reference does not point to a resource in the server or the current transaction: {0}", original);
        //        }
        //    }
        //    else if (triage == KeyKind.Local)
        //    {
        //        return original.WithoutBase();
        //    }
        //    else
        //    {
        //        return original;
        //    }
        //}

        Uri ExternalizeReference(Uri uri)
        {
            if (uri == null)
            {
                return(null);
            }
            else if (!uri.IsAbsoluteUri)
            {
                var absoluteUri = localhost.Absolute(uri);
                if (absoluteUri.Fragment == uri.ToString()) //don't externalize uri's that are just anchor fragments
                {
                    return(uri);
                }
                else
                {
                    return(absoluteUri);
                }
            }
            else
            {
                return(uri);
            }
        }