Stream: shorthand
Topic: A question of style...
David Hay (Oct 12 2020 at 17:54):
I've got a profile with a number of extensions - including one on a primitive type (.status). When I create an example, the extension on the primitive is at the top of the instance with all the others. Would it be feasible to have the extension immediately follow the primitive value?
Jose Costa Teixeira (Oct 12 2020 at 18:19):
I don't understand. Do you want to extend resource.status?
David Hay (Oct 12 2020 at 18:30):
* status = #active
* status.extension[regimen-under-review].valueCode = #**MiHIN Public Health Reporting**
should become:
"status": "active",
"_status": {
"extension": [
{
"url": "http://clinfhir.com/fhir/StructureDefinition/regimen-under-review",
"valueCode": "review"
}
]
},
and it does - it's just that the extension is at the top of the instance, separated from the primary value. Style over substance!
Jose Costa Teixeira (Oct 12 2020 at 18:45):
ah, i see now. but isn't that json sorting?
David Hay (Oct 12 2020 at 19:22):
I believe that this is how sushi outputs it...
Chris Moesel (Oct 12 2020 at 19:42):
That's what I need to look into. Does SUSHI have control over this or is it something that happens in the JSON serialization? Based on the way SUSHI works, I'd actually expect that SUSHI builds the JSON in the order @David Hay expects -- so it is a little surprising that it comes out in a different order. But it's possible that I may be remembering SUSHI's approach incorrectly -- so we need to check it out.
Chris Moesel (Nov 04 2020 at 20:29):
Hi @David Hay -- the newly announced SUSHI 1.0.0 Beta 4 now generates instances w/ any _
properties adjacent to their corresponding non-_
properties.
David Hay (Nov 04 2020 at 20:46):
Thanks!
Last updated: Apr 12 2022 at 19:14 UTC