Skip to content

Refactor Search Parameter Info Management#5400

Merged
jestradaMS merged 4 commits intomainfrom
users/jestrada/searchparameterlookupfixV2
Feb 20, 2026
Merged

Refactor Search Parameter Info Management#5400
jestradaMS merged 4 commits intomainfrom
users/jestrada/searchparameterlookupfixV2

Conversation

@jestradaMS
Copy link
Contributor

@jestradaMS jestradaMS commented Feb 19, 2026

Description

As suggested by Sergey in #5386 (comment)

  • Updated SearchParameterDefinitionBuilder to use ConcurrentDictionary<string, ConcurrentQueue> for resource type lookups.
  • Modified methods to ensure consistent handling of search parameter URLs, including updates to GetOrCreateSearchParameterInfo and validation methods.
  • Enhanced SearchParameterDefinitionManager to support new dictionary structure and improve search parameter retrieval logic.
  • Added unit tests to verify behavior of search parameter resolution, including case sensitivity and overwriting of static definitions.
  • Adjusted SearchParameterInfo to ensure GetHashCode is consistent with Equals implementation.

Related issues

Addresses AB#183574.

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)

- Updated SearchParameterDefinitionBuilder to use ConcurrentDictionary<string, ConcurrentQueue<string>> for resource type lookups.
- Modified methods to ensure consistent handling of search parameter URLs, including updates to GetOrCreateSearchParameterInfo and validation methods.
- Enhanced SearchParameterDefinitionManager to support new dictionary structure and improve search parameter retrieval logic.
- Added unit tests to verify behavior of search parameter resolution, including case sensitivity and overwriting of static definitions.
- Adjusted SearchParameterInfo to ensure GetHashCode is consistent with Equals implementation.
- Improved overall code readability and maintainability by reducing redundancy and clarifying method responsibilities.
@jestradaMS jestradaMS requested a review from a team as a code owner February 19, 2026 14:42
@jestradaMS jestradaMS added this to the FY26\Q3\2Wk\2Wk17 milestone Feb 19, 2026
@jestradaMS jestradaMS added Bug-Reliability Reliability related bugs. 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 ADR-Included ADR Included in the PR Schema Version unchanged No-PaaS-breaking-change labels Feb 19, 2026
feordin
feordin previously approved these changes Feb 19, 2026
LTA-Thinking
LTA-Thinking previously approved these changes Feb 19, 2026
@SergeyGaluzo
Copy link
Contributor

SergeyGaluzo commented Feb 20, 2026

"Updated SearchParameterDefinitionBuilder to use ConcurrentDictionary<string, ConcurrentQueue> for resource type lookups."
I agree that it does not hurt, but I am not convinced that it is needed.
I see main problem in allowing concurrent writes to multiple dictionaries (and even worse multiple entries in a single dictionary) without locks. This inherently leads to problems. There are multiple ways to solve this, but having concurrent dictionary is not enough.

@jestradaMS
Copy link
Contributor Author

jestradaMS commented Feb 20, 2026

"Updated SearchParameterDefinitionBuilder to use ConcurrentDictionary<string, ConcurrentQueue> for resource type lookups." I agree that it does not hurt, but I am not convinced that it is needed. I see main problem in allowing concurrent writes to multiple dictionaries (and even worse multiple entries in a single dictionary) without locks. This inherently leads to problems. There are multiple ways to solve this, but having concurrent dictionary is not enough.

This would be phase 1 which resolves the underlying issue of multiple objects being used and diverging. For the allowing concurrent writes, this would be next phase were we are addressing responsibility of cache updates to be performed solely by Background Refresh service. Additionally, we do currently have locks on search parameter updates at app and db layers.

@SergeyGaluzo
Copy link
Contributor

Should we update UrlLookup to UriLookup?

@jestradaMS jestradaMS dismissed stale reviews from LTA-Thinking and feordin via 3544d7b February 20, 2026 21:10
@jestradaMS jestradaMS enabled auto-merge (squash) February 20, 2026 21:10
@jestradaMS
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jestradaMS jestradaMS merged commit 4493ae1 into main Feb 20, 2026
61 checks passed
@jestradaMS jestradaMS deleted the users/jestrada/searchparameterlookupfixV2 branch February 20, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADR-Included ADR Included in the PR 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-Reliability Reliability related bugs. No-PaaS-breaking-change Schema Version unchanged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants