コード例 #1
0
        public static CapabilityStatement CreateServer(string server, string publisher,
                                                       FHIRVersion fhirVersion)
        {
            var capabilityStatement = new CapabilityStatement
            {
                Name        = server,
                Publisher   = publisher,
                FhirVersion = fhirVersion,
                Date        = Date.Today().Value,
            };

            return(capabilityStatement);
        }
コード例 #2
0
        public static CapabilityStatement GetSparkCapabilityStatement(string sparkVersion, ILocalhost localhost)
        {
            FHIRVersion         vsn = FHIRVersion.N4_0_0;
            CapabilityStatement capabilityStatement = CreateServer("Spark", sparkVersion, "Kufu", fhirVersion: vsn);

            capabilityStatement.AddAllCoreResources(readhistory: true, updatecreate: true, versioning: 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 Furore and others");

            return(capabilityStatement);
        }
コード例 #3
0
        public static CapabilityStatement CreateServer(
            string server,
            string serverVersion,
            string publisher,
            FHIRVersion fhirVersion)
        {
            var capabilityStatement = new CapabilityStatement
            {
                Name        = server,
                Publisher   = publisher,
                Version     = serverVersion,
                FhirVersion = fhirVersion,
                //capabilityStatement.AcceptUnknown = CapabilityStatement.UnknownContentCode.No;
                Date = Date.Today().Value
            };

            capabilityStatement.AddServer();
            return(capabilityStatement);
        }
コード例 #4
0
ファイル: FhirService.cs プロジェクト: zzti/dicom-server
        /// <inheritdoc/>
        public async Task CheckFhirServiceCapability(CancellationToken cancellationToken)
        {
            using FhirResponse <CapabilityStatement> response = await _fhirClient.ReadAsync <CapabilityStatement>("metadata", cancellationToken);

            FHIRVersion version = response.Resource.FhirVersion ?? throw new InvalidFhirServerException(DicomCastCoreResource.FailedToValidateFhirVersion);

            if (!_supportedFHIRVersions.Contains(version))
            {
                throw new InvalidFhirServerException(DicomCastCoreResource.InvalidFhirServerVersion);
            }

            foreach (RestComponent element in response.Resource.Rest)
            {
                foreach (SystemInteractionComponent interaction in element.Interaction)
                {
                    if (interaction.Code == SystemRestfulInteraction.Transaction)
                    {
                        return;
                    }
                }
            }

            throw new InvalidFhirServerException(DicomCastCoreResource.FhirServerTransactionNotSupported);
        }
コード例 #5
0
        public static CapabilityStatement CreateServer(String server, String serverVersion, String publisher, FHIRVersion fhirVersion)
        {
            CapabilityStatement capabilityStatement = new CapabilityStatement();

            capabilityStatement.Name        = server;
            capabilityStatement.Publisher   = publisher;
            capabilityStatement.Version     = serverVersion;
            capabilityStatement.FhirVersion = fhirVersion;
            //capabilityStatement.AcceptUnknown = CapabilityStatement.UnknownContentCode.No;
            capabilityStatement.Date = Date.Today().Value;
            capabilityStatement.AddServer();
            return(capabilityStatement);
            //AddRestComponent(true);
            //AddAllCoreResources(true, true, CapabilityStatement.ResourceVersionPolicy.VersionedUpdate);
            //AddAllSystemInteractions();
            //AddAllResourceInteractionsAllResources();
            //AddCoreSearchParamsAllResources();

            //return con;
        }