Closed mint-thompson closed 6 months ago
The reason for this behavior comes from ElementDefinition.assignFshCode
. When an element's type is code, uri, or string, the FshCode's code property is assigned. So, you are correct in observing that this isn't really helpful for the scenario in the zulip thread. Setting CodeSystem.property.uri
to a specific code within a system appears to be the typical usage, in that FHIR uses it in the CodeSystem that defines some common concept properties. So, it would be useful for this to be easy to do in FSH. If uri elements were assigned with system#code
instead of just code
, that would let us do it. That seems reasonable, so I'll see if that causes any unfortunate regressions.
Good observation, @jafeltra, and good investigation, @mint-thompson! I agree -- given that setting the URI to {system}#{code}
is apparently common, I think it makes sense to look into this. It's a little outside of spec, because the spec says this format can be assigned to code, Coding, CodeableConcept, and CodeableReference (and does not mention uri) -- but we're already allowing the assignment in SUSHI anyway; so we might as well make it useful I guess. Of course this all depends on whether or not @mint-thompson's regression finds any reasonable use cases for doing it the other way.
I ran a regression that assigned system#code
to uri-type elements, and it showed some undesirable regressions. So, I don't think we can make that change as part of this PR. But, it's probably still worth thinking about how to try to handle this situation in the future.
Completes task CIMPL-1211.
The
replaceReferences
function is now used byCodeSystemExporter
in a similar manner to how it is used byStructureDefinitionExporter
. CodeSystems only need this for caret rules.