当前位置: 首页>>代码示例>>C#>>正文


C# FhirClient.Conformance方法代码示例

本文整理汇总了C#中FhirClient.Conformance方法的典型用法代码示例。如果您正苦于以下问题:C# FhirClient.Conformance方法的具体用法?C# FhirClient.Conformance怎么用?C# FhirClient.Conformance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FhirClient的用法示例。


在下文中一共展示了FhirClient.Conformance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FetchConformance

        public void FetchConformance()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var entry = client.Conformance();

            Assert.IsNotNull(entry);
            // Assert.AreEqual("Spark.Service", c.Software.Name); // This is only for ewout's server
            Assert.AreEqual(Conformance.RestfulConformanceMode.Server, entry.Rest[0].Mode.Value);
            Assert.AreEqual(HttpStatusCode.OK.ToString(), client.LastResult.Status);
        }
开发者ID:alexandru360,项目名称:fhir-net-api,代码行数:11,代码来源:FhirClientTests.cs

示例2: FetchConformance

        public void FetchConformance()
        {
            FhirClient client = new FhirClient(testEndpoint);

            Conformance c = client.Conformance().Resource;

            Assert.IsNotNull(c);
            Assert.AreEqual("HL7Connect", c.Software.Name);
            Assert.AreEqual(Conformance.RestfulConformanceMode.Server, c.Rest[0].Mode.Value);
            Assert.AreEqual(ContentType.XML_CONTENT_HEADER, client.LastResponseDetails.ContentType.ToLower());
            Assert.AreEqual(HttpStatusCode.OK, client.LastResponseDetails.Result);
        }
开发者ID:nagyistoce,项目名称:kevinpeterson-fhir,代码行数:12,代码来源:FhirClientTests.cs

示例3: FetchConformance

        public void FetchConformance()
        {
            FhirClient client = new FhirClient(testEndpoint);

            var entry = client.Conformance();
            var c = entry.Resource;

            Assert.IsNotNull(c);
            // Assert.AreEqual("Spark.Service", c.Software.Name); // This is only for ewout's server
            Assert.AreEqual(Conformance.RestfulConformanceMode.Server, c.Rest[0].Mode.Value);
            Assert.AreEqual(HttpStatusCode.OK, client.LastResponseDetails.Result);

            // Does't currently work on Grahame's server
            Assert.AreEqual(ContentType.XML_CONTENT_HEADER, client.LastResponseDetails.ContentType.ToLower());
        }
开发者ID:wdebeau1,项目名称:fhir-net-api,代码行数:15,代码来源:FhirClientTests.cs

示例4: FhirVersionIsChecked

        public void FhirVersionIsChecked()
        {
            var testEndpointDSTU2 = new Uri("http://spark-dstu2.furore.com/fhir");
            var testEndpointDSTU1 = new Uri("http://spark.furore.com/fhir");
            var testEndpointDSTU12 = new Uri("http://fhirtest.uhn.ca/baseDstu1");
            var testEndpointDSTU22 = new Uri("http://fhirtest.uhn.ca/baseDstu2");
            var testEndpointDSTU23 = new Uri("http://fhir-dev.healthintersections.com.au/open");

            var client = new FhirClient(testEndpointDSTU1);

            Conformance p;

            try
            {
                client = new FhirClient(testEndpointDSTU23, verifyFhirVersion: true);
                p = client.Conformance();
            }
            catch (NotSupportedException)
            {
                //Client uses 1.0.1, server states 1.0.0-7104
            }

            client = new FhirClient(testEndpointDSTU23);
            p = client.Conformance();

            //client = new FhirClient(testEndpointDSTU2);
            //p = client.Read<Patient>("Patient/example");
            //p = client.Read<Patient>("Patient/example");

            //client = new FhirClient(testEndpointDSTU22, verifyFhirVersion:true);
            //p = client.Read<Patient>("Patient/example");
            //p = client.Read<Patient>("Patient/example");


            client = new FhirClient(testEndpointDSTU12);

            try
            {
                p = client.Conformance();
                Assert.Fail("Getting DSTU1 data using DSTU2 parsers should have failed");
            }
            catch (FormatException)
            {
                // OK
            }
        }
开发者ID:molsches,项目名称:fhir-net-api,代码行数:46,代码来源:FhirClientTests.cs

示例5: TestConnectionError

        public void TestConnectionError()
        {
            // todo: Thread error handling
            // In Forge, a Conformance request to a nonexisting endpoint, results in an exception that cannot be caught.
            // This unit tests simulates that behaviour, but here we can catch the error. 
            // The error however is a NullReferenceException and not the original WebException.
            // Solution: The AsyncCallBack of GetResponseNoEx(this WebRequest req) should have a catch block.
            // -- MH.
            Exception register = null;

            try
            {
                string endpoint = "http://localhost:9876/fhir";
                FhirClient client = new FhirClient(endpoint);
                client.Conformance();
            }
            catch (Exception e)
            {
                register = e;
            }

            Assert.IsTrue(register != null);
        }
开发者ID:wdebeau1,项目名称:fhir-net-api,代码行数:23,代码来源:FhirClientTests.cs


注:本文中的FhirClient.Conformance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。