feat: FHIR Bulk Data $import and CLI backup/restore - #56
Merged
Merged
Conversation
Add async POST /$import (Prefer: respond-async) that reads Parameters
with inline NDJSON, upserts resources, and polls at /$import/status/{id}.
Wire the service in runtime. CLI backup writes per-type NDJSON plus a
manifest; restore reloads that directory with create-or-update.
Co-authored-by: Adegoke Adewoye <[email protected]>
Match CLI restore by clearing server-assigned meta before persist, require write authorization on kickoff instead of export-read, map client kickoff errors to 400, keep cancelled jobs from completing, parse Prefer respond-async comma form, and add GET $import/files for error artifacts. Co-authored-by: Adegoke Adewoye <[email protected]>
…oader Keep cancelled in-memory jobs from being overwritten by complete/in-progress updates. Authorize create/update on each input resource type at kickoff. Wire a default HTTP(S) URLLoader with timeout, size limit, and scheme checks. Co-authored-by: Adegoke Adewoye <[email protected]>
golangci-lint errcheck failed CI because Load deferred Close without reading the error. Ignore the close error after the body is consumed. Co-authored-by: Adegoke Adewoye <[email protected]>
degoke
marked this pull request as ready for review
September 21, 2026 12:21
Advertise $import through capabilityFlags/systemOperations alongside export instead of a separate marshalCapabilityStatement signature. Keep Patient $export and $import routes in HTTP docs. Co-authored-by: Adegoke Adewoye <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds FHIR Bulk Data
$importand CLIbackup/restore.Merged
mainafter #50–#53, #51, and #55. Conflicts were overlapping CapabilityStatement/docs edits:$importis now acapabilityFlags.BulkImportsystem operation next to$export, not a secondmarshalCapabilityStatementsignature.HTTP
$importPOST /fhir/$importwithPrefer: respond-async(also acceptsrespond-async, wait=…) and a Parameters bodyinputpart needstypeplus inline NDJSON (valueString) or aurlGET /fhir/$import/status/{jobId}; cancel withDELETEGET /fhir/$import/files/{jobId}/{file}meta.versionId/lastUpdated(same as CLI restore)BulkImportServiceis wiredCLI
Backup writes
{ResourceType}.ndjsonplusmanifest.json. Restore upserts those files and stripsmeta.versionIdso core assigns new versions.Runtime
pkg/runtimeregistersjobs.TypeImportBulk(export.import) alongside bulk export. Job/file stores remain in-memory (same as$export). Runtime wiresHTTPLoaderfor http(s)input.url(file/data schemes rejected; 60s timeout, 64MiB cap).Review follow-ups
Closeis checked for errcheck CI$importis advertised viacapabilityFlags.BulkImport/systemOperations