Skip to content

Support meta history in bulk update#5370

Merged
LTA-Thinking merged 4 commits intomainfrom
personal/rojo/bulk-update-meta-history
Feb 6, 2026
Merged

Support meta history in bulk update#5370
LTA-Thinking merged 4 commits intomainfrom
personal/rojo/bulk-update-meta-history

Conversation

@LTA-Thinking
Copy link
Contributor

Description

Allows for support of the _meta-history parameter in $bulk-update requests.

Related issues

Addresses User Story 180713

Testing

New E2E test and manual testing

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)

@LTA-Thinking LTA-Thinking added this to the FY26\Q3\2Wk\2Wk16 milestone Feb 4, 2026
@LTA-Thinking LTA-Thinking requested a review from a team as a code owner February 4, 2026 19:01
@LTA-Thinking LTA-Thinking added Enhancement Enhancement on existing functionality. Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs No-PaaS-breaking-change No-ADR ADR not needed labels Feb 4, 2026
Copy link
Contributor

@rajithaalurims rajithaalurims left a comment

Choose a reason for hiding this comment

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

RB is going to add another E2E in a follow up PR

@LTA-Thinking LTA-Thinking merged commit b0bfd3f into main Feb 6, 2026
65 checks passed
@LTA-Thinking LTA-Thinking deleted the personal/rojo/bulk-update-meta-history branch February 6, 2026 17:43
[ServiceFilter(typeof(ValidateAsyncRequestFilterAttribute))]
[AuditEventType(AuditEventSubType.BulkUpdate)]
public async Task<IActionResult> BulkUpdate([FromBody] Parameters paramsResource, [FromQuery(Name = KnownQueryParameterNames.IsParallel)] bool? isParallel = null, [FromQuery(Name = KnownQueryParameterNames.MaxCount)] uint maxCount = 0)
public async Task<IActionResult> BulkUpdate([FromBody] Parameters paramsResource, [FromQuery(Name = KnownQueryParameterNames.IsParallel)] bool? isParallel = null, [FromQuery(Name = KnownQueryParameterNames.MaxCount)] uint maxCount = 0, [FromQuery(Name =KnownQueryParameterNames.MetaHistory)] bool metaHistory = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Missing space after =

}

[SkippableFact]
public async Task GivenBulkUpdateWithMetaHistoryDisabled_WhenCompleted_ThenNoHistoricalVersionWasCreated()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a test _meta-history=true to verify that history is created when _meta-history=true (default) to ensure the parameter works both ways.

var substituteResults = new BulkUpdateResult();
substituteResults.ResourcesUpdated["Patient"] = 3;
_updater.UpdateMultipleAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<bool>(), 0, Arg.Any<bool>(), Arg.Any<IReadOnlyList<Tuple<string, string>>>(), Arg.Any<BundleResourceContext>(), Arg.Any<CancellationToken>())
_updater.UpdateMultipleAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<bool>(), 0, Arg.Any<bool>(), Arg.Any<IReadOnlyList<Tuple<string, string>>>(), Arg.Any<BundleResourceContext>(), Arg.Any<bool>(), Arg.Any<CancellationToken>())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add/update a unit test to verify metaHistory(true) is passed passed as default?

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 Enhancement Enhancement on existing functionality. No-ADR ADR not needed No-PaaS-breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants