FHIR / fhir.js

JavaScript client for FHIR
425 stars 136 forks source link

add full support of xml format #33

Open maksym opened 9 years ago

maksym commented 9 years ago

let us imagine that server supports only xml format, how to deal with that situation. any ideas ?

samueljseay commented 9 years ago

Sorry to jump in on this conversation, at my company we are interested in using this library.

I think looking at the code the simplest way currently would be to implement a custom adapter which then converts received xml to json. Not ideal.

To address this you would need to pass a content type configuration to the adapter and... perhaps you'd need an adapter for how data is processed as well, or a set of well reasoned default adapters. (xml and json would be the obvious main types you'd want to process).

niquola commented 9 years ago

Hi, converting from xml to json is not so trivial and require meta information (profiles for resources & datatypes descriptions). I asked twice in fhir group to make it pure transformation :) but this problem is not yet addressed. We are working on guide to implement fhir ref impl in dynamic languages as couple of functions validate & serialize - now in clojure. Then we can port this implementation to js.