Skip to content

Use the right default url for ValueSet and CodeSystem instances - #1648

Open
drlalithapranathi wants to merge 2 commits into
FHIR:masterfrom
drlalithapranathi:gh-1647-instance-url
Open

drlalithapranathi wants to merge 2 commits into
FHIR:masterfrom
drlalithapranathi:gh-1647-instance-url

Conversation

@drlalithapranathi

Copy link
Copy Markdown
Contributor

Description:

Fixes #1647. getUrlFromFshDefinition fell back to a StructureDefinition url for every Instance. That's wrong for Instances of ValueSet and CodeSystem, which InstanceExporter exports with {canonical}/ValueSet/{id} and {canonical}/CodeSystem/{id}. The fallback now uses instanceOf as the type for those two.

The callers are covered in my comment on the issue. Short version: the two ValueSet/CodeSystem instance matchers in FSHTank.internalFish are the only place the wrong default was reachable.

One open question from that comment: those matchers also accept Usage: #inline, and InstanceExporter only assigns a default url for #definition. This PR doesn't change that. Happy to, if you'd rather inline instances not match on a default url at all.

Testing Instructions:

npm run check. New tests are in test/import/FSHTank.test.ts. Four cover the ValueSet and CodeSystem instances, and one checks that StructureDefinition instances still match on their default url.

Regression: no changes detected on the 8 repos in regression/repos-select.txt. None of those define a ValueSet or CodeSystem as an Instance though, so I also ran these six, which do, without a url rule: HL7/fhir-us-ndh, hl7-eu/unicom-ig, HL7/sdc, HL7/aitransparency-ig, openhie/case-reporting, EUVABECO/VCDS. No changes detected there either.

Related Issue:

#1647

getUrlFromFshDefinition fell back to a StructureDefinition url for any
Instance, so the tank matched ValueSet and CodeSystem instances on the
wrong url. InstanceExporter gives them {canonical}/ValueSet/{id} and
{canonical}/CodeSystem/{id}, so the fallback uses that now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getUrlFromFshDefinition produces wrong URL for Instances without a url rule

1 participant