Skip to content

BDMS-611: Implement Radionuclides backfill job and BDD step definitions #558

Description

@kbighorse

Summary

The feature spec tests/features/nma-chemistry-radionuclides-refactor.feature defines 7 scenarios for refactoring legacy NMA_Radionuclides rows into the Ocotillo Observation schema via a backfill job.

Current State

PR #573 (558-radionuclides-backfill) implements the full backfill job and BDD step definitions. Remaining work is resolving the local test DB setup (#585) and final review.

Completed

  • Fix test harness — seed lexicon_term with required terms in before_all
  • Implement step definitions — tests/features/steps/chemistry-backfill.py covering all 7 scenarios
  • Implement backfill job — transfers/backfill/chemistry_backfill.py
    • Maps NMA_Radionuclides rows → Observation records keyed on nma_pk_chemistryresults (GlobalID)
    • Creates/reuses Parameter records by (parameter_name, matrix="water")
    • Sets detect_flag=false when Symbol = "<"
    • Stores Volume/VolumeUnit on the parent Sample (first-write-wins with conflict warnings)
    • Creates Notes records linked to observations
    • Preserves AnalysisMethod as-is (no lexicon mapping)
    • Skips orphan records (missing Sample linkage) and reports count
    • Is idempotent (re-run safe)
    • Deterministic row processing via ORDER BY NMA_Radionuclides.id
  • Register in backfill orchestrator — wired into transfers/backfill/backfill.py
  • CLI arg rejection — explicit error on removed --batch-size flag
  • AnalysisMethod test cleanup scoped to test-created IDs (closes AnalysisMethod test cleanup should be scoped to test-created IDs #567)
  • Chemistry backfill test cleanup handles errors gracefully (closes Chemistry backfill test cleanup should handle errors gracefully #566)

Remaining

Linked

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions