Stream: shorthand
Topic: sushi suddenly failing on cs/vs codes post upgrade
Kippi Bordowitz (Mar 07 2022 at 12:56):
I have updated sushi from version from 1.3.2
to 2.3.0
. Since then I am getting a new error and I can't quite figure it out.
I have the following ValueSet:
image.png
It calls for codes from the following CodeSystem (I have copied only the relevant part as it is much larger):
image.png
I am getting the following error(s) from sushi:
image.png
I have cut the printout down because it is basically repeating the error for all the codes seen in the first error message.
I can't find the problem. Would appreciate any assistance.
Chris Moesel (Mar 07 2022 at 14:38):
Thanks for reporting this, @Kippi Bordowitz. I've done a simple reproduction of the issue on FSH Online here: https://fshschool.org/FSHOnline/#/share/3vLYBUq
I agree that the above should work, BUT it is not the best practice (or common) approach to defining CodeSystems in FSH. Since you are using all ^
rules, it actually would work better as an Instance
. I've tried that and found that it does not produce any errors: https://fshschool.org/FSHOnline/#/share/3tEoGBY
That said, the BEST approach would be to use the new CodeSystem syntax introduced in FSH 2.0, which allows you to set metadata properties. This is much cleaner. Here is what that would look like: https://fshschool.org/FSHOnline/#/share/3pJ1uBm
CodeSystem: PayingEntityMoH
Id: paying-entity-moh
Title: "Some Title"
Description: "Some Description"
* ^language = #he-IL
* ^status = #draft
* ^url = $payer
* ^content = #complete
* #-888 "display 0" "definition 0"
* ^property.code = #status
* ^property.valueCode = #deprecated
* #-999 "display 1" "definition 1"
* ^property.code = #status
* ^property.valueCode = #deprecated
* #101 "display 2" "definition 2"
* #102 "display 3" "definition 3"
Also note that ^content
defaults to #complete
, so you don't need to explicitly state that rule if you don't want to. In addition, SUSHI will build default URLs for you too (using the IG canonical), so you only need to set ^url
if you want to override the default URL that SUSHI assigns.
We can look into why your original FSH doesn't work, but I would highly recommend converting to the latest syntax if possible. If that is too tedious and you have an existing formal CodeSystem declaration (in JSON), you could use GoFSH to help. It won't use the indent format, but it will still provide a much cleaner representation. (NOTE: you can use GOFSH on FSH Online by using the "Convert to FSH" button).
Kippi Bordowitz (Mar 07 2022 at 14:40):
@Chris Moesel Thanks!
I will first try converting to the new syntax. shouldn't be too tedious. Will update on status (resolved/not resolved) once am done.
Chris Moesel (Mar 07 2022 at 17:35):
I've filed SUSHI-1039 to track the bug related to SUSHI not working correctly when defining codes using ^concept
.
Kippi Bordowitz (Mar 07 2022 at 17:56):
Glad to report the new system does work. I really wish I could figure out an automatic way of converting the old files to the new format... It was more work than I had anticipated for just the one but we have several of those.
Chris Moesel (Mar 07 2022 at 19:07):
Hmmm... Round-tripping on FSH Online might be easier. Basically, copy over the existing CodeSystem FSH (and any aliases it uses), then click "Convert to JSON". This gets it into FHIR format on the right-hand-side. Then click "Convert to FSH", which overwrites the left-hand-side with the better FSH representation.
For example, try it w/ this link. Go here (https://fshschool.org/FSHOnline/#/share/3ITRlcD) then click "Convert to JSON" then "Convert to FSH" and you'll see what I mean.
Last updated: Apr 12 2022 at 19:14 UTC