FHIR Chat · Order of elements · implementers

Stream: implementers

Topic: Order of elements


view this post on Zulip Brian Reinhold (Nov 16 2018 at 13:01):

Is the order of the elements in a FHIR resource important? In other words can I have a value[x] element before the code? I have implicitly assumed the order WAS important but I don't recall that being specified anywhere. It certainly makes no difference to a JSON parser.

view this post on Zulip Lloyd McKenzie (Nov 16 2018 at 13:28):

It depends on the serialization. Order of elements matters for XML, but not for JSON or RDF. In JSON, Order of elements within an array matters. In RDF, array order is handled via a property, so order of serialization doesn't matter.

view this post on Zulip John Moehrke (Nov 16 2018 at 18:44):

nice clarification. Is this said somewhere in the spec? Where? It should be said this clearly.

view this post on Zulip Lloyd McKenzie (Nov 16 2018 at 19:00):

Each of the syntaxes indicates where order matters. I'm not sure if there's a section of the spec that specifically highlights differences between the syntaxes.

view this post on Zulip Lloyd McKenzie (Nov 16 2018 at 19:00):

You can submit a change request if you like :)

view this post on Zulip Michael Calderero (Nov 17 2018 at 00:22):

I think http://build.fhir.org/formats.html would be the place to find this information


Last updated: Apr 12 2022 at 19:14 UTC