Stream: implementers
Topic: JSON parser
Shailendra Bajracharya (Sep 17 2016 at 14:31):
Can someone help me with sample code or info page to parse JSON String (QuestionnareResponse)?
I am using .NET
I tried something like below. But could not figure out where to find Question /Answer.
using (var reader = SerializationUtil.JsonReaderFromJsonText(JSONString)) { var temp = new JsonDomFhirReader(reader); }
Brian Postlethwaite (Sep 17 2016 at 14:33):
Which platform are you looking for (.NET java, javascript...)
Shailendra Bajracharya (Sep 17 2016 at 14:33):
.NET
Brian Postlethwaite (Sep 17 2016 at 15:02):
There is the .NET fhir client which has all that stuff in it which is available on NuGet.
https://www.nuget.org/packages/Hl7.Fhir.STU3/0.90.6-alpha7
Shailendra Bajracharya (Sep 18 2016 at 14:21):
I have STU3 installed and referenced
I am having hard time to figure out how to use it
QuestionnaireResponse responses = parser.Parse<QuestionnaireResponse>(JSONString); foreach (var item in responses.Item) { //How do I parse it here. I need to parse question and its answer something like below string q = item.Text; string a = item.Answer; }
Grahame Grieve (Sep 18 2016 at 14:29):
I think you want to task on the DotNet stream
Richard Kavanagh (Sep 22 2016 at 18:56):
Typically a QuestionnareResponse resource only has the answers to the questions not the actual questions themselves.
Lloyd McKenzie (Sep 22 2016 at 20:07):
Actually, QuestionnaireResponse *should* have the question text too - it's designed to do that. The intention is that the QuestionnaireResponse should be renderable and understandable (though not validatable) without the Questionnaire being accessible
Last updated: Apr 12 2022 at 19:14 UTC