FHIR Chat · order of resources in the generated ig.json · shorthand

Stream: shorthand

Topic: order of resources in the generated ig.json


view this post on Zulip Giorgio Cangioli (Nov 15 2021 at 09:04):

following the https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/Order.20of.20artifacts.20in.20the.20index thread I was wondering if there is a way to control the order of the declared resources in the ig.json file

view this post on Zulip Chris Moesel (Nov 15 2021 at 16:45):

Hi @Giorgio Cangioli. Thanks for reporting this. I've just tested it in SUSHI and confirmed that the order you declare resources in the sushi-config.yaml does NOT affect the order of the resource list in the generated ImplementationGuide resource. I think we can fix this, but it does raise a question...

In sushi-config.yaml, you do not have to specify the full resource list; you're allowed to list only the resources you want to "override" metadata values for -- in which case the rest of the resources retain their default inferred metadata values. So... what should SUSHI do if there are 15 resources in the IG, but only 2 resources are listed in sushi-config.yaml? Should it change the overall resource order and put those two resources first, and then follow them with the rest alphabetically? What if you want to override the values but don't want to mess with the order? One approach would be that if the author wants to specify a particular order, they must list all the resources in sushi-config.yaml. On one hand, that could be tedious, but on the other hand, if an author cares about order, wouldn't they want to order all the resources anyway?

Wondering what you think about this.

view this post on Zulip John Moehrke (Nov 15 2021 at 18:36):

alpha would be a better default than what is happening today

view this post on Zulip John Moehrke (Nov 15 2021 at 18:36):

when some are mentioned but not all... first those that are mentioned, then alpha?

view this post on Zulip John Moehrke (Nov 15 2021 at 18:38):

I do agree that partial list seems like at least a warning

view this post on Zulip Jean Duteau (Nov 15 2021 at 18:39):

it is alpha but alpha based on the id instead of the name

view this post on Zulip John Moehrke (Nov 15 2021 at 18:40):

hmm, I didn't notice that. It seemed outright random

view this post on Zulip Jean Duteau (Nov 15 2021 at 18:40):

i tend not to list the resources but do use groupings and it would be nice f the order within a group was as I specified, but it looks likes the IG doesn't allow for that because it just lists groups and then each resource declares what group it belongs to. Does SUSHI need to take the order within a group in account as well?

view this post on Zulip John Moehrke (Nov 15 2021 at 18:40):

but, alpha on filename is not all that useful to a human that never gets to see the filename

view this post on Zulip Jean Duteau (Nov 15 2021 at 18:41):

John Moehrke said:

hmm, I didn't notice that. It seemed outright random

Yeah, I thought it was semi-random until this thread and then I went and looked and realized that it was based on filename/id.

view this post on Zulip John Moehrke (Nov 15 2021 at 18:41):

yup, mostly random.... to the reader of the IG

view this post on Zulip Lloyd McKenzie (Nov 15 2021 at 22:15):

If someone does a mix of enumerating and auto-loading artifacts, then alphabetical is the best thing to do. If someone has enumerated all of their resources in a specific order, then FSH should retain that.

view this post on Zulip Chris Moesel (Nov 15 2021 at 22:22):

That's what I was thinking too, @Lloyd McKenzie. In the case that only some resources are enumerated, I don't think it makes sense to order some of the resources using user-defined order and the rest using system-defined order. But, as you said, if they enumerate all of them, then we should assume that's the order they want.

@John Moehrke and @Jean Duteau -- point taken regarding alpha by ID. When we do an alpha sort, it probably makes sense to do it by the title that is actually visible to the user on the artifact listing page.

@Jean Duteau -- since SUSHI does allow you to list resources by group, then I think we could retain the group-defined order when generating the IG resources list. We'd have to experiment a bit w/ how it works -- but I think there may be something workable there.

view this post on Zulip Giorgio Cangioli (Nov 19 2021 at 07:40):

Chris Moesel said:

Should it change the overall resource order and put those two resources first, and then follow them with the rest alphabetically? What if you want to override the values but don't want to mess with the order? One approach would be that if the author wants to specify a particular order, they must list all the resources in sushi-config.yaml. On one hand, that could be tedious, but on the other hand, if an author cares about order, wouldn't they want to order all the resources anyway?

I understand the issue but I believe that the best solution is in any case to allow to order the resources explicitly listed and order the remaining with default order.

view this post on Zulip Giorgio Cangioli (Nov 19 2021 at 07:48):

but it is not a drama if I should list all of them, the only suggestion is to possibly include some kind of message about the type of ordering applied, just in case I miss to add all the resources.

view this post on Zulip Giorgio Cangioli (Nov 19 2021 at 07:50):

Chris Moesel said:

since SUSHI does allow you to list resources by group, then I think we could retain the group-defined order when generating the IG resources list. We'd have to experiment a bit w/ how it works -- but I think there may be something workable there.

Interesting, when I can learn more about how to use this with sushi ?


Last updated: Apr 12 2022 at 19:14 UTC