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

Set version based on sushi-config.yaml in FSHOnly projects #1456

Closed jafeltra closed 6 months ago

jafeltra commented 6 months ago

Fixes #1380

This PR adds back support for using the version specified in sushi-config.yaml in Structure Definitions, Value Sets, and Code Systems as a default value in FSH Only projects. If the version is set with a rule, that will overwrite the version from the config file. This is only done in the case where FSHOnly is set to true in the config file because the IG Publisher will set the version when it is used.

Because status is already set using the value in sushi-config.yaml as a default in all projects, this should restore the functionality that was removed in SUSHI 3.x. As a reference, I was looking at PR #1143, which removed this functionality originally.

jafeltra commented 6 months ago

We auto set the url in these cases now, so it might make sense to auto-set status and version -- but I can't decide for sure. What do you think?

Oh I think I like that idea, especially since status is usually (always?) required. Defaulting status might make sense to do for all projects for consistency with the other exports, but version might be best for FSHOnly projects.

I was trying things out and happened to make an instance of a CapabilityStatement, which also has fhirVersion with cardinality 1..1. I wonder if we should try to include that from the configuration if there's a fhirVersion element.

jafeltra commented 6 months ago

I created #1457 to separately consider adding defaults for other values.