Skip to content

Add a snapshot case for a mapping identity collision - #289

Open
AltangerelG wants to merge 1 commit into
FHIR:masterfrom
AltangerelG:test-cases/profile-mapping-identity
Open

AltangerelG wants to merge 1 commit into
FHIR:masterfrom
AltangerelG:test-cases/profile-mapping-identity

Conversation

@AltangerelG

Copy link
Copy Markdown

Split out of #288, one case per fix as @grahamegrieve asked.

Covers hapifhir/org.hl7.fhir.core#2603,
fixed by PR #2659.

The derived profile re-declares the base's mapping identity map1 for a different URI under
a different name, so the base's declaration has to be renamed to map11.

On core master the snapshot comes out with map11 used on elements and declared nowhere:

declarations:            map1, w5, rim, interface, cda, v2, loinc
used but not declared:   map11

With #2659 the declaration survives and nothing is orphaned.

Verified both ways in r5 and r6 — fails on core master, passes with the fix. The expected
files were generated by the fixed code and then checked against master.

@grahamegrieve grahamegrieve left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update so that not every line of the manifest is changed

The derived profile re-declares the base profile's mapping identity for
a different URI under a different name, so the base's declaration has to
be renamed out of the way.

On org.hl7.fhir.core master the elements end up using map11 while
nothing declares it: the rename is written into name rather than
identity, and update() then drops the renamed declaration because it
looks the identity up in the base profile's own declarations, where a
renamed identity never appears.

Expected here is map11 declared with the base's uri, and no identity
used on an element that is not declared. Verified in r5 and in r6:
fails on master, passes with hapifhir/org.hl7.fhir.core#2659.

For hapifhir/org.hl7.fhir.core#2603.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AltangerelG
AltangerelG force-pushed the test-cases/profile-mapping-identity branch from bc36963 to f90ece5 Compare September 28, 2026 17:38
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.

2 participants