Stream: shorthand
Topic: How I use Sushi 1.0.0 to manage an IG
Eric Haas (Oct 09 2020 at 01:10):
I know you envisioned sushi a little differently but I use it to:
- create and manage the IG resource and menu which it does beautifully
- to create new resources with the basic stuff and which I then grab and finish off the authoring by hand the input files directly if I need to. (I find some stuff easier in .fsh and other stuff easier to edit directly which I prefer to do in YAML ).
- I use my own bash scripts to split the sushi generation from the ig-publisher and autobuild and it works pretty well.
We plan to migrate US Core over starting with everything in the input directory and using sushi for the IG resource and eventually migrating to .fsh files as needed.
John Moehrke (Oct 09 2020 at 12:34):
I use sushi only for the feature of having easier to create FSH that sushi converts into the json. From that point on I am 100% IG build based. I do like the automatic invoking of sushi when a FSH tank is found. I too sometimes refine the json, for which I simply rename that refined so as to not conflict. My biggest struggle is that the very fact my IG normative source is the json, not the fsh. Thus I am highly reliant on a stable sushi that I can feel confident will do the exact same slicing and rolling (sushi) 10 years from now.
Jose Costa Teixeira (Oct 09 2020 at 12:44):
@Chris Moesel is the ci build fixed? If so I can update the sample IG to show how this is done
Chris Moesel (Oct 09 2020 at 14:09):
Thank you @Eric Haas and @John Moehrke for sharing how you use SUSHI! @John Moehrke -- we do our best to ensure stability of output between releases. We have a pretty robust suite of unit tests and we also do manual regression testing against some IGs (right now, usually the mCODE IG). But of course, SUSHI output may change based on discovered bugs, new publisher rules, and/or best practices that emerge from the community. We don't anticipate any major changes to project structure / configuration for quite a while though -- which is why we really wanted to get this last big project structure change into 1.0.0 (rather than post-1.0.0).
Chris Moesel (Oct 09 2020 at 14:10):
@Jose Costa Teixeira -- Grahame has implemented a fix to allow the SUSHI version to be set in the fsh.ini
, but I just tested it and found it doesn't appear to be in the latest released publisher yet. You can track the conversation here.
David Hay (Oct 09 2020 at 17:31):
I'm similar to Eric - I use sushi to generate all the resources (including the IG required ones), but do have some scripts that I run post-sushi to generate various summary pages that are then fed to the IG publisher....
Jose Costa Teixeira (Oct 14 2020 at 23:07):
I'm getting this
Sushi: error No sushi-config.yaml in . folder, and no configuration could be extracted from an ImplementationGuide resource.
Jose Costa Teixeira (Oct 14 2020 at 23:07):
what configuration should be extracted from which implementationguide resource?
Jose Costa Teixeira (Oct 14 2020 at 23:08):
in other words, do I really need to add sushi-config.yaml?
Jean Duteau (Oct 14 2020 at 23:08):
you either need a config file or you need an ImplementationGuide resource
Jose Costa Teixeira (Oct 14 2020 at 23:09):
what does the IG resource have to have? I have an implementationguide resource
Jean Duteau (Oct 14 2020 at 23:11):
From the documentation:
If there is no sushi-config.yaml, SUSHI will automatically attempt to extract the following information from an ImplementationGuide resource:
canonical
fhirVersion
version
dependencies
Jean Duteau (Oct 14 2020 at 23:12):
The following approach is used to find the ImplementationGuide resource:
Look for <root>/ig.ini, where <root> is the folder containing the fsh subdirectory. If the ig.ini file exists, it will have an ig property which gives the path to the ImplementationGuide resource, so SUSHI will use this path to find the resource.
If there is no ig.ini in the root folder, SUSHI will search the <root>/input folder for an ImplementationGuide resource, and if exactly one resource is found, SUSHI will extract the above properties from it.
Jose Costa Teixeira (Oct 14 2020 at 23:13):
thanks, but I'm trying to finish the integration between sushi and the ig, so I want to see what needs to be in the ig resource
Jean Duteau (Oct 14 2020 at 23:13):
right, and the documentation says that you need 'canonical', 'fhirVersion', 'version', and 'dependencies'.
Jose Costa Teixeira (Oct 14 2020 at 23:14):
no, the documentation says it will try to extract that.
Jose Costa Teixeira (Oct 14 2020 at 23:15):
there's no canonical in the IG resource, but I assume it gets it from the url.
Jose Costa Teixeira (Oct 14 2020 at 23:15):
I have version, I have fhirVersion, and I do not want to have dependencies
Jose Costa Teixeira (Oct 14 2020 at 23:15):
@Chris Moesel ?
Jose Costa Teixeira (Oct 14 2020 at 23:16):
(trying to get the miminum changes to an IG to start including sushi)
Jose Costa Teixeira (Oct 14 2020 at 23:39):
also, another one: you may want to ignore xlsx files in the BYOX box
Jose Costa Teixeira (Oct 14 2020 at 23:45):
I think these 2 issues are blocking. once they are fixed, i think we have an integration
Jean Duteau (Oct 14 2020 at 23:46):
Jose Costa Teixeira said:
no, the documentation says it will try to extract that.
it says that it extracts those properties from it. So they aren't there, I suspect that is why you get the error you're getting.
Jean Duteau (Oct 14 2020 at 23:47):
do you have 'url', 'version', fhirVersion'?
Jose Costa Teixeira (Oct 14 2020 at 23:55):
yes
Jose Costa Teixeira (Oct 14 2020 at 23:56):
it also does not mention the name and status, and I believe those are necessary (at least on the yaml they are)
Chris Moesel (Oct 15 2020 at 00:01):
@Jose Costa Teixeira -- do you have your IG posted on GitHub anywhere? I think it would be easiest to debug this if I could just reproduce it.
Chris Moesel (Oct 15 2020 at 00:02):
Jose Costa Teixeira said:
also, another one: you may want to ignore xlsx files in the BYOX box
Oh. Is SUSHI trying to read them like XML resources? (I'm not sure what you mean by "BYOX box")
Jose Costa Teixeira (Oct 15 2020 at 00:04):
I'm just adding some fsh to the sample-ig
Jose Costa Teixeira (Oct 15 2020 at 00:05):
Chris Moesel said:
Jose Costa Teixeira said:
also, another one: you may want to ignore xlsx files in the BYOX box
Oh. Is SUSHI trying to read them like XML resources? (I'm not sure what you mean by "BYOX box")
yes, sushi thinks those are xml resources
Jose Costa Teixeira (Oct 15 2020 at 00:06):
https://github.com/FHIR/sample-ig
Jose Costa Teixeira (Oct 15 2020 at 00:09):
and actually, i made a mistake: it's not to ignore xlsx
Jose Costa Teixeira (Oct 15 2020 at 00:10):
it's to ignore xml that are not a resource (should be at most an info, i guess - but no error)
Chris Moesel (Oct 15 2020 at 00:12):
OK. Yeah, that makes sense and you're right -- we're not doing anything to avoid that. Any suggestions for how we identify if something is a FHIR resource or not? Do you think it's sufficient just to see if the top-level flag has xmlns="http://hl7.org/fhir"
?
Jose Costa Teixeira (Oct 15 2020 at 00:30):
I guess so. @Grahame Grieve do all XML resources have that in common?
Chris Moesel (Oct 15 2020 at 00:30):
Nevermind. This is all wrong. I don't have time to fully debug, but I have a guess as to what is happening w/ trying to extract config from myig.xml
. Since it is XML, we convert it to JSON in order to process it (because TypeScript :heart: JSON). We use Lantana's excellent FHIR.js module to convert FHIR XML to JSON. The "FHIR tools" extension for VS Code also uses this same module for converting FHIR XML to JSON -- and I just noticed that if I attempt to convert myig.xml
to JSON using FHIR tools (and therefore FHIR.js), I get an empty myig.json
file. So... it would appear that the conversion from XML to JSON has gone awry.
Jose Costa Teixeira (Oct 15 2020 at 00:31):
Ok
Chris Moesel (Oct 15 2020 at 00:53):
I spoke too soon. It seems the issue with "FHIR tools" is a red herring (unrelated). I stepped through with a debugger and the bug is most definitely in the SUSHI code (not in the XML-to-JSON code). It's basically looking in the wrong path for the ig.ini
file. We'll have to fix this.
Chris Moesel (Oct 15 2020 at 01:02):
https://github.com/FHIR/sushi/issues/635
Last updated: Apr 12 2022 at 19:14 UTC