Stream: dotnet
Topic: OperationOutcome FHIR .NET API
Thomas K (Jul 12 2016 at 20:02):
Hello all.
I am currently working on a basic FHIR client (ASP.NET) and would like to display the results of a transaction in a simple memo style text box. An example would be the success message when a new patient resource is created. I am able to create a patient resource with the following code:
http://ewoutkramer.github.io/fhir-net-api/client-crud.html
var pat = (Patient)FhirParser.ParseResourceFromJson(jsonString);
var patEntry = client.Create(pat);
"Most FHIR servers will return a human-readable error description in the OperationOutcome to help you out"
I am looking to add a few lines of code to capture and show the HTTP response message from the server showing success (or failure) on my client page.
Using the .NET API, how would I capture and display this information as a simple HTML string? I have been researching for quite some time and still unsure if I am on the right track. It looks like I need to focus on the "OperationOutcome" class, but I am just not sure of the syntax.
Any ideas or help?
Thank you! -- Thomas K.
Grahame Grieve (Jul 12 2016 at 22:15):
what version of FHIR are you using?
Brian Postlethwaite (Jul 13 2016 at 10:52):
You might get some inspiration from this
https://github.com/brianpos/spark/blob/dstu2/feature/htmlview/src/Spark/Views/ResourceBundle.cshtml
Which is the htmlrenderer that is also found in sqlonfhir
Thomas K (Jul 13 2016 at 20:30):
(Grahame) - Currently I am using the "DSTU-2" build of the following project. Is this the information you are looking for? I am sure these is a more robust version / build number, however I am not too sure where to locate that information as I am still in the learning phase on this technology / spec.
https://github.com/furore-fhir/spark/tree/dstu2/master
(Brian) - Thank you for the link. I am going to look further into the code provided as suggested and see what I can come up with.
One thing I have noticed is that many of the public testing sites (client pages) seem to have a VERY similar look / layout for performing searches, updates, etc. Perhaps playing around with my own client code is not necessary if an open source client exists? I will continue my research and see if I even need to really be going down this path. I just like to know how things work, thus building my own "play" client using the .NET API.
Thank you both again and I will be in touch. Just need to keep researching I think.
Last updated: Apr 12 2022 at 19:14 UTC