FHIR Chat · Issue with c# · implementers

Stream: implementers

Topic: Issue with c#


view this post on Zulip Oscar Amado (Dec 12 2019 at 21:26):

Hi I'm trying to start using C# and I create a Patient, and then send it to a FHIR demo server. I use this
http://docs.simplifier.net/fhirnetapi/client/crud.html
http://docs.simplifier.net/fhirnetapi/model/patient-example.html

But I got this error message.
System.FormatException: 'type (at Cannot determine the type of the root element at 'Resource', please supply a type argument.)'

Any idea?

view this post on Zulip Grahame Grieve (Dec 12 2019 at 21:31):

looks like you have the content-type wrong? (xml vs json?)

view this post on Zulip Oscar Amado (Dec 12 2019 at 21:32):

I want to use json
this is my code
var client = new FhirClient("http://10.0.2.2:3000/api/fhir");
client.PreferredFormat = ResourceFormat.Json;
client.ReturnFullResource = false;

view this post on Zulip Grahame Grieve (Dec 12 2019 at 21:32):

use some http debugger to see what goes on the wire.

view this post on Zulip Oscar Amado (Dec 13 2019 at 02:02):

It creates the payload, the issue wash the conten/type Content-Type: application/fhir+json; charset=utf-8
The server (that also I'm writing on ruby I suppose dont parse correct

view this post on Zulip Grahame Grieve (Dec 13 2019 at 02:02):

yep. your server will be the problem

view this post on Zulip Oscar Amado (Dec 13 2019 at 02:14):

thanks a lot @Grahame Grieve


Last updated: Apr 12 2022 at 19:14 UTC