Skip to content

Add a snapshot case for a slice group that ends the snapshot - #292

Open
AltangerelG wants to merge 1 commit into
FHIR:masterfrom
AltangerelG:test-cases/trailing-slice-group
Open

AltangerelG wants to merge 1 commit into
FHIR:masterfrom
AltangerelG:test-cases/trailing-slice-group

Conversation

@AltangerelG

Copy link
Copy Markdown

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

Covers hapifhir/org.hl7.fhir.core#2587,
fixed by PR #2661.

Patient.link is the last top-level element of Patient, so nothing of shallower-or-equal
depth follows its subtree and the counter is never flushed.

Getting the effect into the snapshot took a little care: of the three things the sum check
does, only raising an auto-added slicing entry's min changes the output — the other two
emit INFORMATION messages, which the harness does not surface. So the base profile sets up
the slicing and the derived profile adds the named slices without repeating the slicing
entry, which is what makes the generated entry auto-added.

Expected Patient.link min is 2. Core master leaves it at 0, in r5 and r6.

@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 slice sum check opens a counter on a sliced element and flushes it
when a later element of shallower-or-equal depth appears. Counters still
open when the elements run out were abandoned.

Patient.link is the last top-level element of Patient, so nothing of
shallower-or-equal depth follows its subtree. The base profile sets up
the slicing and the derived profile adds two named slices of min 1
without repeating the slicing entry, which makes the generated slicing
entry an auto-added one, so the effect is visible in the snapshot rather
than only in a message.

Expected Patient.link min is 2; org.hl7.fhir.core master leaves it at 0
in r5 and in r6. Passes with hapifhir/org.hl7.fhir.core#2661.

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

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AltangerelG
AltangerelG force-pushed the test-cases/trailing-slice-group branch from 4772e81 to 8f1a3cf 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