Skip to content

Made sure we do not overwrite data when correcting type references#610

Merged
ewoutkramer merged 1 commit intodevelopfrom
feature/avoid-overriding-data-in-element-id-correction
Oct 30, 2025
Merged

Made sure we do not overwrite data when correcting type references#610
ewoutkramer merged 1 commit intodevelopfrom
feature/avoid-overriding-data-in-element-id-correction

Conversation

@Kasdejong
Copy link
Copy Markdown
Member

Description

Modified the structureDefCorrectionsResolver to no longer overwrite profile references and other information from the typeRefComponent when correcting the type code.

Related issues

closes #583

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the correctIdElement method to simplify the logic for correcting ID element type references in FHIR structure definitions. The change replaces a multi-step validation and replacement pattern with a more concise pattern matching approach.

  • Replaced explicit count checks and element recreation with pattern matching and direct property modification
  • Changed from creating a new Type collection to modifying the existing TypeRefComponent's Code property in-place

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexzautke
Copy link
Copy Markdown
Member

@Kasdejong Did you find an answer to the http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type question in the ticket?

@ewoutkramer ewoutkramer merged commit a1519f3 into develop Oct 30, 2025
8 checks passed
@ewoutkramer ewoutkramer deleted the feature/avoid-overriding-data-in-element-id-correction branch October 30, 2025 17:42
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.

correctIdElement in StructureDefinitionCorrectionsResolver always removes constraints of original type

4 participants