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

[Do Not Review] Implementing $includes operation with paging. #4810

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

Conversation

tarunmathew12
Copy link
Contributor

Description

This is the initial implementation of the $includes operation with paging.

Related issues

Addresses [issue #138967].
User Story 138967: Implement a new $include operation.

Testing

Manually tested. Automated tests being added.

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)

@tarunmathew12 tarunmathew12 added New Feature Label for a new feature in FHIR OSS Open source This change is only relevant to the OSS code or release. labels Feb 3, 2025
@tarunmathew12 tarunmathew12 added this to the 2Wk09 milestone Feb 3, 2025
@tarunmathew12 tarunmathew12 requested a review from a team as a code owner February 3, 2025 22:48
Comment on lines +371 to +391
if (address == null)
{
uriString = _linkGenerator.GetUriByRouteValues(
httpContext,
routeName,
routeValues,
scheme,
new HostString(host),
pathBase);
}
else
{
uriString = _linkGenerator.GetUriByAddress<RouteValuesAddress>(
httpContext,
address,
address.ExplicitValues,
address.AmbientValues,
scheme,
new HostString(host),
pathBase);
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +232 to +236
if (!isIncludesOperation)
{
// TODO: should this case be ignored or throw an exception? The Hl7 doc says, we should ignore it in general. (https://www.hl7.org/fhir/R4/search.html#errors)
// throw new BadRequestException(string.Format(Core.Resources.InvalidContinuationToken, query.Item2, SupportedTotalTypes));
}

Check warning

Code scanning / CodeQL

Futile conditional Warning

If-statement with an empty then-branch and no else-branch.
Comment on lines +1319 to +1321
(SqlExpressionRewriterWithInitialContext<object>)(_schemaInformation.Current >= SchemaVersionConstants.PartitionedTables
? StringOverflowRewriter.Instance
: LegacyStringOverflowRewriter.Instance))

Check warning

Code scanning / CodeQL

Useless upcast Warning

There is no need to upcast from
null
to
SqlExpressionRewriterWithInitialContext - the conversion can be done implicitly.
@tarunmathew12
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tarunmathew12
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why move this from API to Core?

<data name="UnsupportedIncludesOperation" xml:space="preserve">
<value>The '$includes' operation is not supported for CosmosDB data store.</value>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it should just be "The '$includes' operation is not supported". We don't tend to mention the DB type in our messages.

MatchResourceTypeId = tid;
MatchResourceSurrogateIdMin = sid0;
MatchResourceSurrogateIdMax = sid1;
initialized = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is an include CT valid without the two include values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature Label for a new feature in FHIR OSS Open source This change is only relevant to the OSS code or release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants