Give Extensions Package Highest Priority #1605
Open
+306
−137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: The current version of SUSHI loads all automatic dependencies first, which gives them lowest priority in resolution. Based on #1602 and this Zulip thread, however, the automatically loaded extensions package should have highest priority.
This PR updates the automatic dependency mechanism to support the notion of automatic dependency priority. Automatic dependencies with low priority (e.g.,
hl7.fhir.uv.tools,hl7.terminology) are loaded first so they have lowest priority for resolution. Automatic dependencies with high priority (e.g.,hl7.fhir.uv.extensions) are loaded last so they have highest priority for resolution.I've run a full regression on this code. Of 1000+ FSH projects, only 12 are affected by this change in package loading. Of the 12 projects, two projects are impacted negatively, one package is impacted very positively (fixes a bug), and the other nine projects are impacted in a neutral/positive way. Details:
CareTeam1FSH instance inlcudes the following rule:* extension[careteam-alias].valueString = "CareTeam1". The current SUSHI resolvescareteam-aliastohttp://hl7.org/fhir/us/directory-query/StructureDefinition/careteam-aliasfrom thehl7.fhir.us.directory-querypackage, but this updates causes it to resolve tohttp://hl7.org/fhir/StructureDefinition/careteam-aliasfrom thehl7.fhir.uv.extensionspackage. To fix this, the IG authors will need to update the FSH to refer to the desired extension by its canonical rather than its id.SoaActivity,SoaPlanDefinition, andSoaQuesstionnaireinclude the rule* extension contains replaces named replaces 0..1. The current SUSHI resolvesreplacestohttp://hl7.org/fhir/StructureDefinition/task-replaces, which is the wrong extension (because it is intended forTaskresources only). This update now resolvesreplacestohttp://hl7.org/fhir/StructureDefinition/replaces, which is the correct extension.can-bindextension to the StructureDefinition and changes to the declared extension context.can-bindextension has been added to the StructureDefinition.Testing Instructions:
npm run regression -- run -a gh:master -b local --repo HL7/fhir-directory-exchange#master HL7/fhir-directory-attestation#master alpivonka/FHIR-ClinicalTrial-Examples#master paciowg/functional-performance-fsh#master HL7/fhir-pacio-cognitive-status#master HL7/fhir-pacio-functional-status#master hl7-it/dossier-pharma#master hl7-it/lab-report#master hl7ch/ch-core#master HL7Chile/clcore_ig#master ansforge/IG-fhir-repertoire-offre-ressources-sante-me24#main hl7au/draft-diagnostic-orders#masterRelated Issue: Fixes #1602