Feature/oncology ngs mappings - #30
Open
anothernoise wants to merge 11 commits into
Open
Conversation
…astatic Site Linkage mapping to OMOP fact_relationship - Upgraded fact_id_1/2 in DDL & DB to bigint to avoid surrogate key integer overflow - Extracted primary_condition_ref from FHIR condition-related extension URL - Project primary_condition_ref in condition resolve pass - Added Condition__fact_relationship edge to ETL plan - Seeded primary/metastatic relationship vocabulary concepts - Created Condition__fact_relationship Stage-2 join query for bidirectional mapping - Added and verified metastatic linkage test case in oncology pack - Updated run script arguments and pack documentation
- Supported tissue preservation methods (FFPE vs. Frozen) mapping - Mapped anatomical site structures for solid tumor biopsies - Added SNOMED tissue specimen concepts to vocabulary seed - Handled vocabulary duplicate relationships using DISTINCT ON (v.id) - Added new oncology-tumor-biopsy test cases to verify mappings - Updated pack documentation (TODO, README, samples)
…r staging - Extracted variant codes, HGVS strings, and panel linkages from Observation - Mapped somatic variants to observation using LOINC 48018-6 - Mapped quantitative biomarkers (TMB, MSI) to measurement - Mapped TNM Stage Group panels to sub-observations via fact_relationship - Added observation--measurement--genomics-staging test cases - Updated pack documentation (GAPS, README, TODO, pack.json)
…ed therapy mappings
…SI Oncology targets
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.
What's in this PR
This PR implements the new Oncology NGS Biomarker Specialty Pack (
packs/specialty/oncology-ngs-biomarker/) to support oncology samples with diagnoses, genomic reporting, specimen preservation methods, and targeted therapy mappings into standard OMOP CDM v5.4 tables.Problem Statement & Business Case
The Problem
Precision oncology clinical trials and Real-World Evidence (RWE) studies require linking a patient's primary cancer diagnosis with metastatic sites, specific somatic genomic variants (e.g., EGFR, ALK, KRAS mutations), tumor specimen collection/preservation parameters (solid/liquid biopsy, FFPE vs. Frozen), and subsequent targeted therapies (TKIs, Immunotherapies).
Standard FHIR-to-OMOP pipelines lack the specialized relational logic (e.g.,
fact_relationshipparent-child mapping, component extraction, and domain routing) required to represent these oncology-specific linkages, resulting in data loss or fragmented records.Business Value
This specialty pack standardizes the ingestion and transformation of oncology datasets under OHDSI Oncology conventions, enabling:
Why
Oncology clinical and genomic data require specialty mappings (such as metastatic site linkages via
fact_relationship, biomarker routing tomeasurement/observationdomains, and targeted therapy drug exposures) that are not fully captured by core pipelines. This pack standardizes these clinical flows using standard OHDSI conventions.Sample Cases & Clinical Scenarios
The specialty pack contains 5 distinct golden test cases representing a realistic longitudinal patient journey (modeled around patient Jane Doe, a 50-year-old female):
condition--condition-occurrence--oncology-diagnosis.json)condition_occurrencerows (concepts4115276and436659) and two bidirectionalfact_relationshiprecords ("Primary of" / "Metastasis of") preserving their hierarchy.specimen--specimen--oncology-tumor-biopsy.json)specimentable with collection anatomy, quantities, and preservation-specific concepts (e.g. concepts4001225,4264660,4264661).observation--measurement--genomics-staging.json)observation.value_as_string(LOINC48018-6); TMB/MSI map tomeasurement; TNM Stage Group and T, N, M category sub-members map toobservationand are linked viafact_relationship("Has panel member" / "Panel member of").diagnosticreport--note--oncology-ngs.json)notetable to support clinical NLP queries.medicationrequest--drug-exposure--targeted-therapy.json)drug_exposurerecords using RxNorm concepts (concepts1716277and1547548).Changes
Added pack management - for enabling safety engine
Specialty Pack (oncology-ngs-biomarker) Directory Tree
mapspec/views/...regenerated (bun script/gen-views.ts)Condition__condition_occurrence.view.json(extracted primary condition references)Observation__measurement.view.json(extracted nested somatic variant and staging components)Specimen__specimen.view.json(extracted preservation processing procedures)mapspec/<R>/<t>.md)packs/specialty/oncology-ngs-biomarker/README.mdpacks/specialty/oncology-ngs-biomarker/analysis.md(detailed RWD/RWE capabilities)packs/specialty/oncology-ngs-biomarker/GAPS.mdandTODO.mdpacks/specialty/oncology-ngs-biomarker/real-world-oncology-protocol.mdmapspec/etl/Condition__fact_relationship.sqlmapspec/etl/Observation__fact_relationship.sqlmapspec/etl/Observation__observation.sql,Specimen__specimen.sql,_resolve_condition.sql, and_resolve_observation.sqlscript/run-cases.tsandscript/etl-plan.tsto support specialty packspacks/specialty/oncology-ngs-biomarker/_vocab_seed.sqlcases/condition--condition-occurrence--oncology-diagnosis.jsoncases/diagnosticreport--note--oncology-ngs.jsoncases/medicationrequest--drug-exposure--targeted-therapy.jsoncases/observation--measurement--genomics-staging.jsoncases/specimen--specimen--oncology-tumor-biopsy.jsonValidation
How to Run & Validate
Run Cases and Load Vocabulary Seed Pack
To run the specialty pack cases and dynamically load the pack's custom vocabulary seed (_vocab_seed.sql) into the test database vocab schema:
bun script/run-cases.ts seed oncology-ngs-biomarkerRun Pack-Specific Tests (Without Re-seeding)
If the vocabulary schema is already seeded, you can filter case execution to only run this pack's cases:
bun script/run-cases.ts oncology-ngs-biomarkerRun the Full Test Suite (With Seed Loading)
To load all specialty pack seeds and run all 173 cases across the entire project:
bun script/run-cases.ts seedRun Unit and Snapshot Tests
bun testOthers
bun script/repl.ts 'await ctx.fns.repl.load(ctx, { name: "profiles" })'succeedsAffected
/mapspec/...and/profiles/...URLs return 200 and render correctlybunx tsc --noEmitcleanbun testclean (All 19 tests and snapshots updated and passed)bun script/run-cases.tsclean (All 173 case tests passed successfully)bun script/run-cases.ts --pack oncology-ngs-biomarker
Citations