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


C# FhirClient.InstanceOperation方法代码示例

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


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

示例1: InvokeTestPatientGetEverything

        [TestMethod, Ignore] //Server throws error: Access violation at address 000000000129D56C in module 'FHIRServer.exe'. Read of address 0000000000000000
        public void InvokeTestPatientGetEverything()
        {
            var client = new FhirClient(testEndpoint);
            var start = new FhirDateTime(2014,11,1);
            var end = new FhirDateTime(2015,1,1);
            var par = new Parameters().Add("start", start).Add("end", end);
            var bundle = (Bundle)client.InstanceOperation(ResourceIdentity.Build("Patient", "1"), "everything", par);
            Assert.IsTrue(bundle.Entry.Any());

            var bundle2 = client.FetchPatientRecord(ResourceIdentity.Build("Patient","1"), start, end);
            Assert.IsTrue(bundle2.Entry.Any());
        }
开发者ID:012345789,项目名称:fhir-net-api,代码行数:13,代码来源:OperationsTests.cs

示例2: CreateAndFullRepresentation

        public void CreateAndFullRepresentation()
        {
            FhirClient client = new FhirClient(testEndpoint);
            client.ReturnFullResource = true;       // which is also the default

            var pat = client.Read<Patient>("Patient/example");
            ResourceIdentity ri = pat.ResourceIdentity().WithBase(client.Endpoint);
            pat.Id = null;
            pat.Identifier.Clear();
            var patC = client.Create<Patient>(pat);
            Assert.IsNotNull(patC);

            client.ReturnFullResource = false;
            patC = client.Create<Patient>(pat);

            Assert.IsNull(patC);

            if (client.LastBody != null)
            {
                var returned = client.LastBodyAsResource;
                Assert.IsTrue(returned is OperationOutcome);
            }

            // Now validate this resource
            client.ReturnFullResource = true;       // which is also the default
            Parameters p = new Parameters();
          //  p.Add("mode", new FhirString("create"));
            p.Add("resource", pat);
            OperationOutcome ooI = (OperationOutcome)client.InstanceOperation(ri.WithoutVersion(), "validate", p);
            Assert.IsNotNull(ooI);
        }
开发者ID:tiloc,项目名称:fhir-net-api,代码行数:31,代码来源:FhirClientTests.cs


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