I am developing a FHIR Based ASP.NET Web API. I would like to know how to plug in Fire.Ly's JSON Parsor in the WEB API Pipeline so as to directly parse the FHIR Resource using [FromBody]
attribute in the POST Request. Any example / documentation would be helpful.
Asked
Active
Viewed 187 times
1

Shubha Lakshmi
- 127
- 2
- 2
- 15
-
The GitHub has a test folder with lots of examples (https://github.com/FirelyTeam/fhir-net-api/tree/develop-1.x/stu3/src). HL7 is xml format so you would need a parser that goes from XML to JSON. the Fire.Ly creates classes from the xml so you may want to convert the class data to JSON. – jdweng Sep 24 '20 at 10:24
-
@jdweng: That is not true. HL7 FHIR can come in both XML and JSON, and the libraries offer parsers for both formats. Of course you'll have to check which format it is, and then use the correct parser. The other way around too, if you need to send a response, you can use the serializer for the format you want to answer with. – Mirjam Baltus Sep 24 '20 at 17:21
-
@Mirjam Baltus : I do not believe the HL7 specification from IEEE has JSON. The FHIR library has JSON methods. – jdweng Sep 24 '20 at 18:01
-
@MirjamBaltus Are there any examples I can refer to to add them to Web API's media formatters / parsers pipeline, to directly parse the request content from body – Shubha Lakshmi Sep 25 '20 at 05:53
-
@jdweng: the OP mentions wanting to parse a FHIR resource, and has not mentioned HL7 (v2) or IEEE. – Mirjam Baltus Sep 26 '20 at 07:08
-
@Mirjam Baltus : Look at the tag for posting. The library FHIR is an HL7 library. The library has Xml/JSON methods so you can view the data on a webpage. – jdweng Sep 26 '20 at 09:46