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