Stream: shorthand
Topic: Issue with element order
Noemi Deppenwiese (Jan 20 2022 at 11:56):
I ran into an issue with SUSHI and the IG Publisher which i believe is caused by the element order in the differential generated by SUSHI.
So, the following FSH slices by target profile:
Profile: LuFuBefund
Parent: DiagnosticReport
Id: lufu-befund
Title: "Lungenfunktions-Befund"
Description: "Ein Befund, i.d.R. bestehend aus mehreren Messungen."
//Slice result
* result ^slicing.discriminator.type = #value
* result ^slicing.discriminator.path = "$this.resolve()"
* result ^slicing.rules = #open
* result contains gewicht 0..1 and groesse 0..1 and geschlecht-geburt 0..1 and lufu-messwerte 1..*
* result[gewicht] ^type.targetProfile = http://fhir.de/StructureDefinition/observation-de-vitalsign-koerpergewicht
* result[groesse] ^type.targetProfile = http://fhir.de/StructureDefinition/observation-de-vitalsign-koerpergroesse
* result[geschlecht-geburt] ^type.targetProfile = https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/sex-assigned-at-birth
* result[lufu-messwerte] ^type.targetProfile = https://fhir.miracum.org/uc2/StructureDefinition/lufu-observation
and is processed by SUSHI (v2.2.6) without errors but the IG Publisher (v ) fails with
java.lang.Exception: Error generating snapshot for Lungenfunktions-Befund(lufu-befund): Unable to generate snapshot for https://fhir.miracum.org/uc2/StructureDefinition/lufu-befund in C:\Users\deppenni\MII\miracum-igs\uc2\fsh-generated\resources\structuredefinition-lufu-befund
at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:4824)
at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:4108)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:947)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:798)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:9079)
Caused by: org.hl7.fhir.exceptions.FHIRException: Unable to generate snapshot for https://fhir.miracum.org/uc2/StructureDefinition/lufu-befund in C:\Users\deppenni\MII\miracum-igs\uc2\fsh-generated\resources\structuredefinition-lufu-befund
at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:4873)
at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:4822)
... 4 more
Caused by: org.hl7.fhir.exceptions.DefinitionException: Das Differential hat kein Slice: DiagnosticReport.result/ (b:21 von 31 / 1/ 5) im Profil https://fhir.miracum.org/uc2/StructureDefinition/lufu-befund
at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1459)
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:657)
at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:4871)
... 5 more
(Snapshot cannot be generated because DiagnosticReport.result has no slice)
If i look at the JSON generated by SUSHI, the element
{
"id": "DiagnosticReport.result",
"path": "DiagnosticReport.result",
"slicing": {
"discriminator": [
{
"type": "value",
"path": "$this.resolve()"
}
],
"rules": "open"
},
"min": 1
}
exists, however is it the last element in the differential, while the individual slice definitions are at the beginning. If I move the "DiagnosticReport.result" element to the to start of the element list and pass the JSON to the IG Publisher directly, the IG is build without errors. So I assume SUSHI is generating elements in the wrong order here?
Chris Moesel (Jan 20 2022 at 13:41):
Hi @Noemi Deppenwiese. SUSHI should put the elements in the right order. I took your FSH and tried it in FSH Online (which also uses SUSHI 2.2.6) and it produced the elements in the correct order. See: https://fshschool.org/FSHOnline/#/share/3Kw25z2
Was that the complete example, exactly as you tried it, or did you remove some lines to keep the example short? I'm just trying to understand why I cannot reproduce the problem.
Noemi Deppenwiese (Jan 20 2022 at 13:58):
Ok weird. Yes, thats exactly my file content. I also tried moving the FSH file to a new folder and run SUSHI with FSHOnly: true, same (wrong element order) result. Also tried uninstalling and reinstalling SUSHI, same result... Maybe something in my npm is broken, I'll try reinstalling that next. Still, thank you!
Chris Moesel (Jan 20 2022 at 15:01):
Hmmm... What operating system are you on? I was testing on Mac.
Chris Moesel (Jan 20 2022 at 15:04):
And when you go to my FSH Online link above, does it come out in the right order for you there?
Noemi Deppenwiese (Jan 20 2022 at 15:26):
Yes, FSHOnline works fine. I'm using Windows 10. Node.js un- and reinstall did nothing to fix it. I'll get a colleague to try it on their Windows machine to figure out whether it is Windows or just me....
Hank Lenzi (Jan 21 2022 at 12:19):
Noemi Deppenwiese
I tried it on a Linux machine, it build just fine. That's the result (picture)
You might want to review your Java installation, perhaps? I would use the Amazon Corretto (based on OpenJDK but goes through a certified testing process):
Noemi Deppenwiese (Jan 24 2022 at 16:10):
Ok, it is just me. My colleague got the correct order using the same node.js and sushi versions as I did. I still get the wrong order. No idea what else could be the cause. Seems like I have to reinstall my OS :sweat_smile: and switch to running the IG build in docker for now.
(My Java installation also seems to be ok (already using Amazon Coretto..))
Chris Moesel (Jan 27 2022 at 13:51):
Yeah, I am perplexed. I'd love to help you, but I have no idea how.
Last updated: Apr 12 2022 at 19:14 UTC