Open rbrush opened 1 year ago
Thanks for the suggestion. Technically, the order of properties in JSON does not matter to machines; but as you noted, sometimes it matters to humans! We'll have to take a look and see what is causing them to be re-ordered in SUSHI. To be honest, I'm not sure. I thought maybe we were outputting the elements in the order they're defined in the Patient
resource, but that doesn't seem to be the case. So... we'll need to investigate.
Thanks for looking into it, Chris! For some reason it seems to be shifting some primitive fields after repeated structs . You're right it doesn't impact machine usage, but it has created some confusion for humans reading examples at https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/artifacts.html.
Normally I'd look into contributing a fix myself, but I'm TypeScript novice and am entirely unfamiliar with the code base; so I greatly appreciate your expertise here.
Example resources can be difficult for users to inspect and understand since the fields are produced in a surprising order. Here's a minimal example of a simple patient -- notice the
active
andgender
fields are moved to the bottom of the generated resource:And the example output: