Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for duplicate search parameters #3790

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

feordin
Copy link
Contributor

@feordin feordin commented Mar 29, 2024

Description

There are published IG's with Search Parameters that have identical code values and expression as existing Search Parameters. We want to allow these parameters without causing any reindexing or ambiguous behaviors when searching using the duplicated code values.

This PR also blocks the addition of any Search Parameter resource with a conflicting code value that has a different expression. As this is a bug that currently puts the service into an unstable state.

Related issues

Addresses [issue AB#117004].

Testing

Unit tests are added.
Manual testing using UploadFIG with USCore is done, and all SearchParameters succeeded.
Still TBD: E2E test to check reindex impact.

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.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

@feordin feordin changed the title [DRAFT] Allow for "duplicate" search parameters Allow for "duplicate" search parameters Apr 5, 2024
@feordin feordin marked this pull request as ready for review April 5, 2024 18:56
@feordin feordin requested a review from a team as a code owner April 5, 2024 18:56
@feordin feordin force-pushed the personal/jaerwin/search-params branch from 8d40931 to 5ed7eb5 Compare April 5, 2024 18:58
@feordin feordin added Bug Bug bug bug. Area-Search Area related to search. KI-Breaking This is a known issue that causes a breaking change labels Apr 5, 2024
@feordin feordin added this to the S138 milestone Apr 5, 2024
@feordin feordin removed the Bug Bug bug bug. label Apr 5, 2024
@feordin feordin changed the title Allow for "duplicate" search parameters Allow for duplicate search parameters Apr 5, 2024
@feordin feordin added 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. labels Apr 5, 2024
Comment on lines +162 to +175
catch (Exception exp)
{
_output.WriteLine($"Attempt {retryCount} of {MaxRetryCount}: CustomSearchParameter test experienced issue attempted to clean up SearchParameter {searchParam.Url}. The exception is {exp}");
if (exp is FhirClientException fhirException && fhirException.OperationOutcome?.Issue != null)
{
foreach (OperationOutcome.IssueComponent issueComponent in fhirException.OperationOutcome.Issue)
{
_output.WriteLine("FhirException OperationOutome message from trying to delete SearchParameter is CustomSearchParam test: {0}", issueComponent.Diagnostics);
}
}

success = false;
await Task.Delay(TimeSpan.FromSeconds(10));
}

Check notice

Code scanning / CodeQL

Generic catch clause Note test

Generic catch clause.
// for the search parameter/reindex updates to propagate to all instances. Hence we are
// adding some retries below to account for that delay.
int retryCount = 0;
bool success = true;

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning test

This assignment to
success
is useless, since its value is never read.
@mikaelweave mikaelweave removed this from the S138 milestone Jun 18, 2024
}
if (!supportedResult.Supported)
{
throw new SearchParameterNotSupportedException(searchParameterInfo.Url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Customer sees this message "The search parameter with definition URL '{0}' is not supported.". I know this change is not related to this PR but in this scenario, error is thrown if definition has any issues. Do you think we can use better error message to indicate customer that something is wrong with the definition they have sent?

await _searchParameterStatusManager.AddSearchParameterStatusAsync(
new List<string> { searchParameterWrapper.Url },
cancellationToken,
duplicateSearchParameter ? SearchParameterStatus.Duplicate : SearchParameterStatus.Supported);
Copy link
Contributor

Choose a reason for hiding this comment

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

We are introducing a new status Duplicate here. How is it going to impact reindex and $status operation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Search Area related to search. 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. KI-Breaking This is a known issue that causes a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants