Skip to content

feat: import-amber command - #55

Merged
ymarcon merged 3 commits into
masterfrom
feat/import-amber
Oct 21, 2026
Merged

ymarcon merged 3 commits into
masterfrom
feat/import-amber

Conversation

@ymarcon

@ymarcon ymarcon commented Oct 21, 2026

Copy link
Copy Markdown
Member

Adds an import-amber command, and its ImportAmberCommand class, to import the case reports or the interviews collected by Amber, with their files, using the Opal built-in Amber importer (obiba/opal#4224).

Options

  • --amber/-am: the Amber API URL.
  • --key/-ak: an Amber API key giving access to the study (feat: API keys for data extraction, audit view, export fixes for Opal import amber#47).
  • --study/-st: the study name.
  • --crf/-cr or --design/-ds: a case report form, to import its case reports, or an interview design, to import its interviews. Exactly one is required.
  • --campaign/-ca: interviews only, the campaign name.
  • --state/-sta: completed by default, all for no state filter.
  • --from/-fr, --to/-to: last update dates (YYYY-MM-DD, whole days in UTC).
  • --type/-ty: the entity type, defined by Amber by default.
  • The usual import options: destination, tables, incremental, limit, identifiers, policy, merge.

Available in both the opal and opal-legacy command lines.

Checks

  • ruff format and lint, unit tests.
  • With the Opal request stubbed, the Amber import settings match the ones sent by the Opal UI, for case reports and interviews. Invalid combinations are refused: both or neither of --crf/--design, a campaign without a design.
  • Not run against a live Opal and Amber.

Documentation: obiba/opal-doc (Python user guide, import-amber page).

@ymarcon
ymarcon merged commit ea0b611 into master Oct 21, 2026
8 checks passed
@ymarcon
ymarcon deleted the feat/import-amber branch October 21, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant