FHIR Chat · FHIR Server .Net · implementers

Stream: implementers

Topic: FHIR Server .Net


view this post on Zulip Dongtu (Sep 21 2019 at 10:02):

Hi all,
I have plan build Fhir Server in .Net framework. I'm looking for git sample project to build basic CRUD operations on certain entities like patient(example). it looks like hapi-fhir-jpaserver.
Has anyone ever done that project yet? Please give me your example

view this post on Zulip Yunwei Wang (Sep 21 2019 at 14:08):

There are two .NET server implementations: Firely Spark (https://github.com/FirelyTeam/spark) and Microsoft FHIR server (https://github.com/Microsoft/fhir-server)

view this post on Zulip Brian Postlethwaite (Sep 22 2019 at 00:29):

And the fhir facade project at
Http://github.com/brianpos/fhir-net-web-api
This is one intended to show how to do it, but storage is really up to you.
Demo just uses a file system.

view this post on Zulip Dongtu (Sep 23 2019 at 01:07):

Thank you, I 'll try

view this post on Zulip Ward Weistra (Sep 24 2019 at 09:24):

And if you're not looking to build your own, you can use https://fire.ly/products/vonk/ :vonk:
It's not open source, but does allow for a lot of extensibility via plugins/components: http://docs.simplifier.net/vonk/components/components.html

view this post on Zulip Dongtu (Sep 30 2019 at 02:27):

Hi @Brian Postlethwaite , I tried your opensource (Http://github.com/brianpos/fhir-net-web-api). I think it suits my project.
I tested some usecase for validate resource by postman. It return html document. But I want to return OperationOutcome. How can I do that?
I debuged. Exception at line: "var resource = new FhirJsonParser().Parse<Resource>(jsonReader);"
then catch "throw new FhirServerException(HttpStatusCode.BadRequest, "Body parsing failed: " + exception.Message);"

view this post on Zulip Brian Postlethwaite (Sep 30 2019 at 03:00):

Did you put in the accept header?

view this post on Zulip Brian Postlethwaite (Sep 30 2019 at 03:00):

Application/xml+fhir

view this post on Zulip Dongtu (Sep 30 2019 at 03:02):

Yes, I did.

view this post on Zulip Dongtu (Sep 30 2019 at 03:05):

Any exception, it return html doc with error. I want return OperationOutcome example:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"text": "exception"
}
}
]
}

view this post on Zulip Dongtu (Sep 30 2019 at 03:08):

pasted image

view this post on Zulip Brian Postlethwaite (Sep 30 2019 at 22:33):

What are you posting in the body?
That looks like a valid operation outcome in json as requested.
So I would suggest that what you are sending is dud.

view this post on Zulip Dongtu (Oct 01 2019 at 01:06):

I'm posting Patient Resource and changing value of gender 1 invalid value (ex: "gender":"abc"). It run to ReadRequestBodyAsync function in file JsonFhirFormatter.cs

view this post on Zulip Dongtu (Oct 01 2019 at 01:12):

pasted image

view this post on Zulip Michele Mottini (Oct 01 2019 at 12:36):

You have to catch the errors and convert them to OperationOutcome I guess - maybe a filter is missing on the controller?

view this post on Zulip Dongtu (Oct 02 2019 at 01:21):

this is validate input function, run berfore go to controller. It throw exception when Parse msg

view this post on Zulip Yunwei Wang (Oct 02 2019 at 13:54):

What's your json payload?

view this post on Zulip Michele Mottini (Oct 02 2019 at 13:56):

The payload has an invalid gender code - so of course the parsing fails . . . what behavior were you expecting?

view this post on Zulip Yunwei Wang (Oct 02 2019 at 14:19):

I think @Dongtu expected a OperationOutcome for the invalid payload, not HTML code. @Dongtu You need to check if the server has exception filter attached. If not, you need create one to catch validation exception and convert it to OperationOutcome.

view this post on Zulip Brian Postlethwaite (Oct 02 2019 at 21:36):

This is probably new with the lack of permissive parsing in the lib. When it's updated to a later version should be ok.

view this post on Zulip Brian Postlethwaite (Oct 02 2019 at 21:36):

Can you report an issue on the github project and I'll take a look


Last updated: Apr 12 2022 at 19:14 UTC