FHIR / sushi

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).
Apache License 2.0
145 stars 44 forks source link

Value Set concept components have one code per line #1381

Closed mint-thompson closed 11 months ago

mint-thompson commented 11 months ago

Completes task CIMPL-1201.

A ValueSetConceptComponentRule may have more than one code. When producing FSH for the rule, each code needs to be written as a separate line of FSH. This is true regardless of whether there are any ValueSets associated with the rule.

mint-thompson commented 11 months ago

@cmoesel I completely agree that it is weird. This is a case where FSH allows it because FHIR allows it, and SUSHI allows it because FSH allows it. SUSHI requires a system when listing specific concepts, which is aligned with ValueSet invariant vsd-2, and at that point, the concept is uniquely identified. So, leaving this kind of thing out of examples in the documentation seems completely reasonable to me: this doesn't feel like it is ever useful or necessary in order to build a perfectly good ValueSet.

jafeltra commented 11 months ago

This PR was confusing to me when I first looked at it, and maybe this is why. I guess one question I have is, shouldn't GoFSH, and therefore the toFSH, produce FSH that we encourage people to use? But are we possibly losing information if we leave out the "from valueset" parts?

mint-thompson commented 11 months ago

We definitely want to preserve information. But, leaving out the value sets from the include/exclude concept rule doesn't really cause any loss of information, by my understanding of ValueSet definitions. It would mean that the round trip comparison will show a difference here, though. I'll take some more time to think about this.

cmoesel commented 11 months ago

Since the overall result is defined as the intersection between the concepts and the value sets, there is a difference if the value set does not have the concept. Again, it would be silly if anyone did that -- but removing the value set is not necessarily harmless.