Stream: fhirpath.js
Topic: JSON in demo website
Paul Lynch (Sep 13 2018 at 14:46):
I was showing the fhirpath.js demo website to our group here, and it was suggested that we have the ability to paste JSON into the demo instead of just YAML. I don't want to remove the YAML, but I will add an option near the top to switch to a JSON entry mode. (An XML entry mode might be nice too, eventually, but that would be for later.)
nicola (RIO/SS) (Sep 13 2018 at 15:55):
agree
nicola (RIO/SS) (Sep 13 2018 at 15:55):
with xml we have problem - we need converter :)
nicola (RIO/SS) (Sep 13 2018 at 15:55):
There is no xml->json converter in js
nicola (RIO/SS) (Sep 13 2018 at 15:56):
And it's quite a tricky problem - i did it in clojure
Paul Lynch (Sep 13 2018 at 16:53):
I think you mean there is no json->xml converter, right? xml->json could be done with https://www.npmjs.com/package/xml2js. The tricky part about json->xml that I see is not knowing whether to put something in as an attribute or a child element.
Paul Lynch (Sep 13 2018 at 16:55):
So, if someone pasted in a JSON resource, and the switched modes to XML, we probably could not do the correct transformation for them. (But then again, why would they do that?)
nicola (RIO/SS) (Sep 13 2018 at 19:56):
with fhir this is more complex, you need metadata to convert from/to json
Paul Lynch (Sep 14 2018 at 21:54):
I got the JSON option working, but I am think we should have some tests for the demo website to make sure it stays working. I am planning to try adding a protractor test for it on Monday.
nicola (RIO/SS) (Sep 18 2018 at 02:54):
@Paul Lynch may be defer demo tests for some time?
Paul Lynch (Sep 18 2018 at 15:34):
I think I am close to getting the protractor test working, and will probably get a pull request out today.
Paul Lynch (Sep 18 2018 at 18:20):
@nicola (RIO/SS) https://github.com/lhncbc/fhirpath.js/pull/60
I had difficulty getting Protractor to run in Travis, and eventually decided to put that off.
Last updated: Apr 12 2022 at 19:14 UTC