Stream: dotnet
Topic: Exception parsing DiagnosticReport
George Kustas (Sep 25 2019 at 13:43):
I am brand new to these dotnet libraries. I've read the documentation at http://docs.simplifier.net/fhirnetapi, and searched this Zulip for more info on the subject, but haven't found an example of what I'm trying to do. Hoping someone can point me in the right direction. Thanks!
I have a DiagnosticReport json object like this:
{ "resourceType": "DiagnosticReport", "id": "40012366", "status": "unknown", "imagingStudy": [ { "reference": "ImagingStudy/342123458" }, { "reference": "ImagingStudy/1462123458" } ] }
I have the following code to parse it:
DiagnosticReport dr = null; try { dr = new FhirJsonParser(new ParserSettings { AcceptUnknownMembers = true, AllowUnrecognizedEnums = true }).Parse<DiagnosticReport>(jsonResource); } catch(Exception ex) { string m = ex.Message; }
The parse throws the following exception, which I don't understand. It doesn't appear to be a problem with the contents of the object:
{"Method 'GetElements' in type 'Hl7.Fhir.Specification.PocoComplexTypeSerializationInfo' from assembly 'Hl7.Fhir.R4.Core, Version=1.2.1.0, Culture=neutral, PublicKeyToken=d706911480550fc3' does not have an implementation.":"Hl7.Fhir.Specification.PocoComplexTypeSerializationInfo"}
Michele Mottini (Sep 25 2019 at 13:52):
Seems mismatched DLLs ( the library comes in different pieces )
Ewout Kramer (Sep 25 2019 at 13:54):
Yep. Version mismatch between the support libraries and the Core library. Upgrade to 1.3 please.
Ewout Kramer (Sep 25 2019 at 13:55):
This may help you get started: http://docs.simplifier.net/fhirnetapi/index.html
And otherwise, you found the right channel ;-)
George Kustas (Sep 25 2019 at 15:21):
thanks! I'll give that a try.
George Kustas (Sep 25 2019 at 15:33):
Turns out it was a visual studio/Nuget snafu. I uninstalled everything and re-installed 1.2.1 because that is the version currently supported by my company's Nuget server. Is that going to be a problem? I can get them to offer 1.3 if there is something important in that release. But... the good news is it works now. Thanks again!
Last updated: Apr 12 2022 at 19:14 UTC