Skip to content

Bulk-update #5022

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

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

Bulk-update #5022

wants to merge 20 commits into from

Conversation

apurvabhaleMS
Copy link
Contributor

@apurvabhaleMS apurvabhaleMS commented Jun 13, 2025

Description

Adds the $bulk-update operation. PATCH$bulk-update
This operation can be called at the system level or the resource type level.
As with our other async jobs it returned a Content-Location header showing the endpoint where the job record can be retrieved from. This endpoint can be used to get the current status of the job (GET) or to cancel it (DELETE).

This job is limited by the integer max value due to reporting the ids of deleted resources. This means that jobs should be limited to impact no more than ~2 billion resources, probably less than 500 million to be safe.

Added to capabilities statement.
Added notification on job competition.
Added unit tests.
Rest examples added

Supports the following parameters:

_isParallel: Flag for whether to run subjobs parallely. Default true.
: Any parameters used for a normal search operation can be added.

Related issues

Addresses AB146980.

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)

…update

# Conflicts:
#	src/Microsoft.Health.Fhir.Core/Features/Operations/JobRecordProperties.cs

namespace Microsoft.Health.Fhir.Core.Features.Operations
{
public class CustomFhirJsonSerializer<T> : ICustomFhirJsonSerializer<T>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this class needed instead of using the existing resource serializer and deserializer?

…update

# Conflicts:
#	src/Microsoft.Health.Fhir.Core/Resources.resx
#	src/Microsoft.Health.Fhir.Shared.Web/appsettings.json
@apurvabhaleMS apurvabhaleMS added this to the CY25Q3/2Wk07 milestone Jul 10, 2025
@apurvabhaleMS apurvabhaleMS added New Feature Label for a new feature in FHIR OSS Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs labels Jul 10, 2025
Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@apurvabhaleMS apurvabhaleMS marked this pull request as ready for review July 11, 2025 19:14
@apurvabhaleMS apurvabhaleMS requested a review from a team as a code owner July 11, 2025 19:14
Target = ResourceElement
.Select(Operation.Path)
.RequireOneOrMoreElements()
.RequireMultipleElementsInSameCollection()
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this line do that means we have to get the target a second time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked in new code. But this line will only allow multiple elements if they are a collection and are from the same collection

}
});
}
else if (definition.IsParallel)
Copy link
Contributor

Choose a reason for hiding this comment

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

This case isn't rerun safe. If the orchestrator job crashes in the middle of executing it may create multiple identical processing jobs.

…update

# Conflicts:
#	src/Microsoft.Health.Fhir.Core/Features/Operations/JobRecordProperties.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs New Feature Label for a new feature in FHIR OSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants