Skip to content

fix: bound generated questionnaire and extraction resource IDs - #1102

Open
rob-reynolds wants to merge 1 commit into
codex/qr-coding-extractionfrom
codex/qr-extraction-fixes
Open

rob-reynolds wants to merge 1 commit into
codex/qr-coding-extractionfrom
codex/qr-extraction-fixes

Conversation

@rob-reynolds

Copy link
Copy Markdown

QuestionnaireResponse and extraction IDs are composed from several individually valid inputs, so the final ID can exceed FHIR's 64-character limit. On main, composing a response ID from a qualified/versioned Questionnaire ID can also append the subject suffix to the version component instead of creating a new logical response identity.

Normalize complete generated IDs at their final creation sites. Preserve already-valid IDs; otherwise use a sanitized, bounded stem plus 12 hexadecimal SHA-256 characters derived from the complete original input. Generate QuestionnaireResponse IDs from the Questionnaire's logical ID. Supplied IDs, subject references, canonicals and linkIds remain unchanged; generated references read the resulting resource identity.

Scope

QuestionnaireResponse, extracted resources, extraction Bundle and contained OperationOutcome IDs. The short digest is deterministic, not collision-proof. Existing id-less outcome suffix behavior is retained. This does not repair extraction transaction URLs or establish transaction persistence readiness.

Validation

  • 11 generated-ID/reference tests and one helper boundary test, including actual qualified/versioned ID parsing across supported FHIR versions.
  • On the combined branch: main CR + utility suites 3,626 passed / 24 skipped; pinned 4.7 suites 3,491 passed / 19 skipped; zero failures/errors.
  • The pinned-4.7 apply comparison confirms all generated IDs in the measured cases are legal and the extracted clinical content matches the Coding-only correction except for IDs.
  • Formatting, main-source Checkstyle and helper API compatibility checks passed. Runtime overlays rebuilt byte-identically from retained source/dependency snapshots.

This PR is stacked on codex/qr-coding-extraction so its diff contains only the ID correction. Merge the Coding PR first, then retarget this PR to main. A matching tested v4.7.0 backport is pushed on codex/qr-extraction-backport. No installed runtime or release was replaced.

Normalize complete generated composites to legal logical IDs of at most 64 characters, retaining legal IDs and deterministic full-input digests. Use the logical Questionnaire ID for generated responses. References read final resource identities; supplied IDs, subject references and linkIds remain unchanged. Transaction URLs and existing id-less outcome behavior remain separate limitations.
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Formatting check succeeded!

@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@barhodes barhodes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would like to look at adding this into the definition based population branch to avoid merge conflicts down the road.

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.

3 participants