FHIR Chat · option to return the xml view · hapi

Stream: hapi

Topic: option to return the xml view


view this post on Zulip Eric Haas (Jun 09 2016 at 21:10):

Hi James. Is there a way to return the raw xml instead of the html? My use case may be unique but I'm interested in seeing the narrative view right on the browser when I fetch a resource.

view this post on Zulip Grahame Grieve (Jun 09 2016 at 21:11):

append _format=xml to the url

view this post on Zulip Eric Haas (Jun 09 2016 at 21:16):

doesn't work- still return the html view

view this post on Zulip Grahame Grieve (Jun 09 2016 at 21:17):

ahh oops

view this post on Zulip James Agnew (Jun 10 2016 at 00:02):

When HAPI detects that your request is coming from a browser it serves you up HTML instead of just the raw payload. There are two ways around this:

That second one appears to not be working though. Weird. I need to investigate that.

view this post on Zulip James Agnew (Jun 10 2016 at 00:04):

Would it be better for _format=xml to just force raw XML instead of HTML-ifying it? I know that's how Grahame's server works and I can see the logic in it.. but that means there's no way of specifying that you explicitly want the pretty HTML version of JSON or XML, which at least I do all the time..

view this post on Zulip James Agnew (Jun 10 2016 at 01:55):

Actually, on closer inspection I guess _format=html is intended to force the rendered HTML view you're trying to avoid. Nevermind that part.

view this post on Zulip Grahame Grieve (Jun 10 2016 at 02:38):

_format=xml should force raw xml in accordance with the spec. you could use _format=html/xml for htmlised xml or json. i could do that too

view this post on Zulip Grahame Grieve (Jun 10 2016 at 02:38):

what's with getXFirstRep? is this on any repeating element?

view this post on Zulip James Agnew (Jun 10 2016 at 02:50):

Hmm, yeah, that's not a bad idea to do something like html/xml and html/json. I'll make that change and try it out...

Yeah. getFooFirstRep() just returns the first repetition of a repeating field, creating it if it doesn't already exist. Semantic sugar.

view this post on Zulip Grahame Grieve (Jun 10 2016 at 03:07):

ok thanks. I'll add support for html/xml and html/json too at some stage


Last updated: Apr 12 2022 at 19:14 UTC