Do not inherit ED extensions that should not be inherited #1604
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: SUSHI already supported removing uninheritable SD extensions. Now we apply similar logic to remove uninheritable extensions from EDs.
I've run a full regression on this code. Of 1000+ FSH projects, only 28 are affected by this change. Here is a summary of the changes:
structuredefinition-explicit-type-nameextension in their FSH now have it properly reflected in their differentials. Prior to this change, if a profile specified astructuredefinition-explicit-type-nameon an element that matched one from the parent's element, SUSHI suppressed it from the differential. Since it is marked as an uninherited extension now, however, SUSHI puts it in the differential. This change was found in the following projects: HL7-cz/img, hl7-eu/dcc, hl7-eu/xpandh-ps, HL7-cz/img-order, gatekeeper-project/poc-ai-gk, HL7-cz/lab-order, hl7-eu/xpandh-hdr, hl7-eu/x-ehealth, gatekeeper-project/gk-fhir-ig, HL7-cz/ps, HL7-cz/cz-ems, hl7-eu/eps, HL7-cz/DIGOVO, HL7-cz/hdr, hl7-eu/pcsp, hl7-it/dgc, HL7/fhir-us-ph-library, IHE/PCC.mAPS, hl7-eu/hdr, HL7/fhir-health-care-surveys-reporting-ig, HL7/livd, IHE/PCC.RIPT.structuredefinition-standards-statusextension if it matched an extension in the same element on the parent. Sincestructuredefinition-standards-statusis marked as an uninherited extension, however, SUSHI will now put it in the differential if the child has specified it. The change was found in one project: BIH-CEI/UTN.structuredefinition-explicit-type-nameextension on it, thatstructuredefinition-explicit-type-namewould be put into the differential. Since it is now marked as an extension that should not be inherited, however, SUSHI no longer puts it into the differential if it is specified only in the parent. This change was found in the following projects: HL7-cz/img, hl7au/au-fhir-erequesting, HL7-cz/cz-lab, HL7-cz/hdr, hl7-eu/hdr, HL7/fhir-ips, HL7Austria/ELGA-MOPED-R5structuredefinition-standards-statusextension from the parent would be put into the differential of a child profile. This no longer happens sincestructuredefinition-standards-statusis marked as an uninherited extension. This change was found in the following projects: HL7-cz/img, HL7-cz/cz-lab, IKNL/PZP-FHIR-R4.structuredefinition-normative-versionextension from the parent would be put into the differential of a child profile. This no longer happens sincestructuredefinition-normative-versionis marked as an uninherited extension. This change was found in ony one project: IKNL/PZP-FHIR-R4.structuredefinition-explicit-type-nameextension by index 0 (e.g.,* ^extension[0].url = "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"). This used to overwrite thestructuredefinition-explicit-type-nameinherited from the parent, but since that extension is no longer inherited, it now overwrites a different (obligation) extension -- causing an invalid extension. This can (and should) be fixed by using the special extension path syntax (e.g.,* ^extension[$explicit-type-name].valueString = "Section", assuming$explicit-type-nameis an alias forhttp://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name).Testing Instructions: The unit tests prove that this is working, but if you want to try it manually, make a SUSHI project with FSH like this:
Run the currently released SUSHI against this project using snapshot mode (e.g.,
sushi build --snapshot /path/to/fsh/project). When you do:CodeableConcept.textelement in the snapshot.CodeableConcept.textelement in the snapshot.Observation.code.textelement in the snapshot.Now run this PR version of SUSHI agains the same project (e.g.,
ts-node src/app.ts build --snapshot /path/to/fsh/project). When you do:CodeableConcept.textelement in the snapshot because it is the original.CodeableConcept.textelement in the snapshot because there is one extension (structuredefinition-standards-status) that was not inherited.Observation.code.textelement in the snapshot because it did not inherit the structuredefinition-standards-status extension.If you would like to run a regression on only the projects that have changed, you may use this command:
npm run regression -- run -a gh:master -b local --repo BIH-CEI/UTN#main HL7-cz/img#master hl7au/au-fhir-erequesting#master HL7-cz/cz-lab#master hl7-eu/dcc#master hl7-eu/xpandh-ps#master HL7-cz/img-order#master gatekeeper-project/poc-ai-gk#master HL7-cz/lab-order#master hl7-eu/xpandh-hdr#master hl7-eu/x-ehealth#master gatekeeper-project/gk-fhir-ig#master HL7-cz/ps#master HL7-cz/cz-ems#master hl7-eu/eps#master IKNL/PZP-FHIR-R4#main HL7-cz/DIGOVO#master HL7-cz/hdr#main hl7-eu/pcsp#master hl7-it/dgc#master HL7/fhir-us-ph-library#master IHE/PCC.mAPS#master hl7-eu/hdr#master HL7/fhir-health-care-surveys-reporting-ig#master HL7/fhir-ips#master HL7/livd#master HL7Austria/ELGA-MOPED-R5#main IHE/PCC.RIPT#masterRelated Issue: N/A