/// Python reorder FHIR properties

ClassMethod PyFHIRResourceReOrder(resource As %String) As %String [ Language = python ]

{

    import json

    from collections import OrderedDict

    result = json.loads(resource, object_pairs_hook=OrderedDict)

    result.move_to_end("extension", last = False)

    result.move_to_end("meta", last = False)

    result.move_to_end("id", last = False)

    result.move_to_end("resourceType", last = False)

    return json.dumps(result)

}

This Python code is what I ended up with. It re-orders the properties "resourceType", "id", "meta" and "extension" to be at the start

Hi @Lorenzo,

Thanks for the great tool! I tried generating a Fitbit client based on https://dev.fitbit.com/build/reference/web-api/explore/fitbit-web-api-sw..., but it failed, because parameter names have "-" characters, and these cannot be part of a Property name. Therefore I extended the name() Class method  to also have the "-":

ClassMethod name(name As %String) As %String [ CodeMode = expression ]
{
$Translate(name, "$_-","")
}

The proxy generation still fails, and given that I don't use that right now, I have disabled that. With these changes everything works great!