Skip to content

Conversation

@brendankowitz
Copy link
Member

@brendankowitz brendankowitz commented Nov 3, 2025

Description

This pull request adds comprehensive unit tests for the ProfileValidator class and updates its implementation to correctly handle the cid-0 constraint based on the FHIR version. The changes improve validation accuracy for different FHIR specifications and ensure that the validator's behavior is thoroughly tested.

Unit test coverage for validation logic:

  • Added a new test class ProfileValidatorTests in ProfileValidatorTests.cs to verify that the cid-0 constraint is ignored for FHIR R4 and later, but not for STU3, and that the constraint is preserved across validator refreshes.

Validation logic improvements:

  • Updated the constructor of ProfileValidator in ProfileValidator.cs to accept an IModelInfoProvider parameter, enabling version-specific logic for FHIR validation.
  • Modified the internal validator creation to append cid-0 to the ConstraintsToIgnore list for FHIR R4 and later, addressing a known spec error.
  • Minor code cleanup in value set expander settings initialization for clarity.

Related issues

Addresses Bug 175473

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@brendankowitz brendankowitz marked this pull request as ready for review November 10, 2025 22:52
@brendankowitz brendankowitz requested a review from a team as a code owner November 10, 2025 22:52
@brendankowitz brendankowitz force-pushed the personal/bkowitz/ignore-cid-0 branch from 99d3568 to 8ec2829 Compare November 11, 2025 01:21
@LTA-Thinking
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@LTA-Thinking LTA-Thinking added Bug Bug bug bug. Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels Nov 14, 2025
@LTA-Thinking LTA-Thinking added this to the CY25Q4/2Wk03 milestone Nov 14, 2025
@LTA-Thinking
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@brendankowitz brendankowitz merged commit 81eafa1 into main Nov 19, 2025
50 of 54 checks passed
@brendankowitz brendankowitz deleted the personal/bkowitz/ignore-cid-0 branch November 19, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants