FirelyTeam / firely-net-sdk

The official Firely .NET SDK for HL7 FHIR
Other
829 stars 345 forks source link

Invalid snapshot is produced by inheriting slicing on choice type #2065

Closed alexzautke closed 2 years ago

alexzautke commented 2 years ago

Describe the bug The attached profile contains an invalid snapshot on Specimen.processing:lagerprozess.time[x]. On that element the slicing contains no "rules" element. The main issue is that the slicing is inherited from Specimen.processing:time[x] ("All Slices" for Specimen.processing). Here we have an open slicing as we further constrain Specimen.processing:time[x].period (setting MS flags on .start and .end). According to https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Type.5Bx.5D.2C.20Slices.2C.20open.2Fclosed/near/188924523 the open slicing is expected here as we don't limit the choice types. However, the lagerprozess limits time[x] to only period. Therefore, it should either be a closed slicing or just have an implicit discriminator.

Expected behavior No slicing element is present on Specimen.processing:lagerprozess.time[x] in the snapshot.

Version used:

alexzautke commented 2 years ago

ProfileSpecimenBioprobeCore.json.zip

alexzautke commented 2 years ago

See https://firelyteam.slack.com/archives/C011XD1TKL0/p1651517052925909 for internal discussion

mmsmits commented 2 years ago

also related: https://github.com/FirelyTeam/firely-validator-api/issues/308

mmsmits commented 2 years ago

I recreated the profile for testing, and encountered that the element paths are incorrect. This should be the correct format: https://simplifier.net/snippet/martensmits/9, which also works with our snapshotgenerator

alexzautke commented 2 years ago

These path were generated by SUSHI. The project team managing the profiles will re-try with the latest version of SUSHI to see if this was changed. Otherwise we need to talk to them about this behaviour.

mmsmits commented 2 years ago

Alright, I'll close this issue for now. Please re-open it if we still need to fix something.

alexzautke commented 2 years ago

Feedback: These paths are still generated by SUSHI as of version v2.6.0. Original FSH file: https://github.com/medizininformatik-initiative/kerndatensatzmodul-biobank/blob/main/input/fsh/Modul_Biobank.fsh

alexzautke commented 2 years ago

Re-opened the issue because I think that our tooling should work with the generated profiles from SUSHI.

mmsmits commented 2 years ago

I think Sushi needs to fix the paths: https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Choice.20Type.20Renaming

alexzautke commented 2 years ago

Will be solved in SUSHI.