1
votes

I can't get the most basic example of the FHIR .NET API to work. I'm trying to read their sample patient data like this:

var client = new FhirClient("http://spark.furore.com/fhir");
var pat = client.Read<Patient>("Patient/1");

The second line throws a FormatException:

At line 1, pos 39: Trying to read a value, but reader is not at the start of a primitive

I've tried several patients, relative and absolute paths, but that didn't help.

1

1 Answers

1
votes

Your code is correct. I think you are trying to use an older DSTU1 version of the .NET library to read data from a DSTU2 server. Can you check the version of the NuGet package is 0.90 (or higher)?

This is the one you need: https://www.nuget.org/packages/Hl7.Fhir.DSTU2/