本文整理汇总了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());
}
示例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);
}