Stream: implementers
Topic: fhirpath in javascript
David Hay (Aug 11 2017 at 19:03):
anyone know how to use the javascript implementation of fhirpath from: https://github.com/jmandel/fhirpath.js directly in the browser (from an angular app)?
Josh Mandel (Aug 11 2017 at 19:03):
I think this something @nicola (RIO/SS) and I hacked on for ~2 days about 2 years ago...
Josh Mandel (Aug 11 2017 at 19:04):
That said, the live demo linked from the README still works a bit: https://niquola.github.io/fhirpath-demo/#/
Josh Mandel (Aug 11 2017 at 19:04):
(Though this will have fallen way out of line with the fhirepath spec by now.)
David Hay (Aug 11 2017 at 20:31):
Thanks Josh - so the underlying FHIRpath implementation in JS is already out of date? I did find the demo (works well!) but couldn't figure out how to call it directly from the browser (when I did the NPM install the only js file was 'bundle.js' and I wasn't sure how to use it in the browser...
David Hay (Aug 11 2017 at 20:31):
I've got a project where this would be really useful to be able to do!
Josh Mandel (Aug 11 2017 at 20:35):
Instructions in the readme seem to work. Here's a runnable/tweakable example:
https://runkit.com/embed/sw8usff18pzc
David Hay (Aug 11 2017 at 23:42):
But that's within node isn't it? (ie server side) I was hoping to execute clientside it in a browser... (Or am I missing something obvious?)
Josh Mandel (Aug 12 2017 at 03:54):
Ah, to use it browser side I guess I'd recommend browserify or webpack. Don't think we got it packaged up for ready inclusion. (Looking at the commit history: this was indeed just a 2 day project.)
nicola (RIO/SS) (Aug 12 2017 at 16:17):
I have a fresh implementation of fhirpath in clojure - i could share - if somebody interested to port it to js
David Hay (Aug 12 2017 at 19:00):
Thanks guys - I wasn't able to make it work in the browser - but moved the code to server-side nodeJs so that worked for me! Would certainly be interested in the most recent version (I doubt I'd be able to do the port myself unfortunately)...
David Hay (Aug 12 2017 at 19:01):
Alternatively, Is it possible to execute clojure from node??
nicola (RIO/SS) (Aug 12 2017 at 21:19):
Potentially yes by clojurescript - i will investigate this :)
David Hay (Aug 13 2017 at 03:48):
cool! let me know if you can do it, and it will be in clinFHIR before you can sneeze!
David Hay (Aug 13 2017 at 03:49):
(well, maybe a wee bit longer than that ;) )
David Hay (Aug 13 2017 at 08:49):
Oh, and if you can make it work in the browser that would be wonderful!
David Hay (Aug 14 2017 at 01:04):
btw - the current library doesn't seem to recognize extensions on primative elements...
David Hay (Aug 16 2017 at 08:57):
https://fhirblog.com/2017/08/16/fhirpath/
nicola (RIO/SS) (Aug 16 2017 at 13:12):
I have to port antlr to cljs to make it work in js :( - so this will take some time. Have you read my article with some critic of fhirpath - https://medium.com/@niquola/query-languages-for-recursive-data-structures-da348036f679
nicola (RIO/SS) (Aug 16 2017 at 13:51):
I found another parser - instaparse which work in both clj & cljs, so will rewrite using it
Michel Rutten (Aug 16 2017 at 14:13):
@nicola (RIO/SS) interesting article! Looking forward to your new client-side FHIRPath implementation.
David Hay (Aug 16 2017 at 22:38):
Thanks Nicola - appreciate all the effort you have put into this. Just let me know when you're ready to go and I'll update clinFHIR...
David Hay (Aug 16 2017 at 22:39):
(btw - will read that article when I can, I'm in China right now and that site doesn't seem to want to display!
Last updated: Apr 12 2022 at 19:14 UTC