Convert your FHIR JSON -> XML and back here. The CDA Book is sometimes listed for Kindle here and it is also SHIPPING from Amazon! See here for Errata.

Saturday, September 5, 2015

Squirrels on FHIR

Distractions in my family are often identified by someone shouting Squirrel! (It's a reference from the movie UP).  So, here is my obligatory squirrel picture.

My current distraction is the FHIR JavaScript conversion tool that I built earlier this week.  At the end of the day today, I decided to give myself some time to play.  I realized that I could probably write an XSLT that would handle 90% of the conversion of FHIR XML to JSON.  From there I could recode it in JavaScript, and then tie it to the data I've generated.  This will only take a few minutes I thought.  An hour later and one false start left me KNOWING it could be done.

Three distractions later, and its now tomorrow.  BUT: You can now use my test page to go in either direction, and I've fixed a bug I found in the original script, as well as created a method to reverse the conversion.  I've also restructured the repository a bit based on a suggestion from Josh.

It too isn't QUITE finished.  Again, I have to deal with all that cruft around properties that start with underscores.  The FHIR documentation isn't quite clear about what the correct behavior is, AND the examples only go so far.  What I've written though, is good enough for my purposes, which is to test things out.

But of course, I realized, that if just refactor things to actually construct the JSON object as I read the XML, then I could use JSON.stringify to ...

ENOUGH!  Back to my homework...

1 comment:

  1. Great movie. Greater code. This saved me days of research. Thank you.