raxtik-etl 0.1.0.dev1__tar.gz → 0.1.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/CHANGELOG.md +7 -0
- raxtik_etl-0.1.0.dev2/ER_DIAGRAM.md +105 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/PKG-INFO +18 -76
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/README.md +17 -75
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/pyproject.toml +1 -1
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sdk.py +4 -4
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.all-contributorsrc +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.github/renovate.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.github/workflows/ci.yml +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.github/workflows/release.yml +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.gitignore +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.pre-commit-config.yaml +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/.readthedocs.yaml +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/CONTRIBUTING.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/CONTRIBUTORS.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/LICENSE +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/Makefile +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/codecov.yml +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/data/intermediate/.gitkeep +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/data/output/.gitkeep +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/data/packages/.gitkeep +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/data/raw/.gitkeep +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/_static/.gitkeep +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/_templates/.gitkeep +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/api.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/architecture.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/changelog.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/cli_reference.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/conf.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/contributing.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/contributors.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/deduplication.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/fda_faers_official_data_dictionary.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/guides/2004q1_usage_guide.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/huggingface_dataset_card.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/index.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/quickstart.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/canonical_data_model.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/code_list_history.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/2004Q1.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/2012Q4.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/2014Q3.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/2024Q1.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/2026Q1.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/2026Q2.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/comparison.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/signatures/S1.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/signatures/S2.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/evidence/signatures/S3.json +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/field_mapping_matrix.csv +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/docs/schema/historical_schema_audit.md +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/requirements-dev.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/requirements-docs.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/requirements-lint.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/requirements-tests.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/cli.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/config.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/consolidation/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/consolidation/merger.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/distribution/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/distribution/huggingface.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/exporters/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/exporters/base.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/migrations/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/migrations/base.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/migrations/manager.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/packaging/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/packaging/builder.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/py.typed +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/reference/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/reference/codes.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/reference/semantics.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/base.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/canonical.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/case.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/drug.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/indication.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/outcome.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/reaction.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/report_source.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/therapy.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/registry.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/views.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/base.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/discovery.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/network.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/parser.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/protocol.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/registry.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/temporal.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/sources/validation.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/transformations/__init__.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/transformations/metadata.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/transformations/normalization.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/conftest.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/DEMO24Q1.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/DRUG24Q1.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/INDI24Q1.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/OUTC24Q1.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/REAC24Q1.txt +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/integration/test_pipeline_flow.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_builder_format_and_sha.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_case_resolution_ordering.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_consolidation.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_exporters.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_huggingface_distribution.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_migrations.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_normalization.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_package_2004q1_audit.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_schema.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/test_sdk_remote.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/unit/test_sources_registry.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/unit/test_sources_validation.py +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tox.ini +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/typos.toml +0 -0
- {raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/uv.lock +0 -0
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 0.1.0.dev2 - 2026-11-19
|
|
9
|
+
|
|
10
|
+
**Full Changelog**: https://github.com/raxtik-org/raxtik-etl/compare/v0.1.0.dev1...v0.1.0.dev2
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Hardened `BaseDataset` DuckDB cursor draining using `fetchall()` for out-of-the-box compatibility with DuckDB 2.0.0+.
|
|
14
|
+
|
|
8
15
|
## 0.1.0.dev1 - 2026-11-19
|
|
9
16
|
|
|
10
17
|
**Full Changelog**: https://github.com/raxtik-org/raxtik-etl/compare/v0.1.0.dev0...v0.1.0.dev1
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Canonical Entity-Relationship (ER) Diagram
|
|
2
|
+
|
|
3
|
+
Visual representation of the **7 canonical pharmacovigilance fact tables**, composite keys, and entity relationships in `raxtik-etl`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🏛️ Visual Schema Model
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
erDiagram
|
|
11
|
+
demo ||--o{ drug : "primary_id"
|
|
12
|
+
demo ||--o{ reac : "primary_id"
|
|
13
|
+
demo ||--o{ outc : "primary_id"
|
|
14
|
+
demo ||--o{ rpsr : "primary_id"
|
|
15
|
+
drug ||--o{ indi : "primary_id, drug_seq"
|
|
16
|
+
drug ||--o{ ther : "primary_id, drug_seq"
|
|
17
|
+
|
|
18
|
+
demo {
|
|
19
|
+
BIGINT primary_id PK "Unique submission report ID"
|
|
20
|
+
BIGINT case_id "Unique patient case identifier"
|
|
21
|
+
INTEGER case_version "Report version number"
|
|
22
|
+
VARCHAR event_country "Country where reaction occurred"
|
|
23
|
+
VARCHAR reporter_country_code "ISO 3166-1 alpha-2"
|
|
24
|
+
DATE fda_date "Receipt date at FDA"
|
|
25
|
+
VARCHAR age_group_code "ICH life stage classification"
|
|
26
|
+
DOUBLE standard_age_years "Normalized age in decimal years"
|
|
27
|
+
VARCHAR standard_sex_label "Male / Female / Unknown"
|
|
28
|
+
DOUBLE standard_weight_kg "Normalized patient weight in kg"
|
|
29
|
+
VARCHAR reporter_occupation_label "Physician, Pharmacist, Consumer..."
|
|
30
|
+
VARCHAR report_type_label "Expedited 15-day, Periodic, Direct..."
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
drug {
|
|
34
|
+
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
35
|
+
INTEGER drug_seq PK "Exposure sequence per report (Composite PK Part 2)"
|
|
36
|
+
VARCHAR role_code "Role: PS, SS, C, I"
|
|
37
|
+
VARCHAR standard_role_label "Primary Suspect, Concomitant..."
|
|
38
|
+
VARCHAR reported_drug_name "Reported medicinal trade/brand name"
|
|
39
|
+
VARCHAR active_ingredient "Normalized generic active substance"
|
|
40
|
+
VARCHAR route "Administration route (Oral, IV...)"
|
|
41
|
+
VARCHAR dose_form "Dosage formulation (Tablet, Solution...)"
|
|
42
|
+
DOUBLE cumulative_dose "Normalized cumulative amount"
|
|
43
|
+
VARCHAR cumulative_dose_unit_label "Metric dose unit (mg, mL...)"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
reac {
|
|
47
|
+
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
48
|
+
VARCHAR reported_reaction_term PK "MedDRA Preferred Term (Composite PK Part 2)"
|
|
49
|
+
BIGINT reaction_seq "Reaction sequence ordinal"
|
|
50
|
+
VARCHAR drug_reaction_action "Action taken with drug"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
outc {
|
|
54
|
+
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
55
|
+
VARCHAR outc_code PK "Seriousness criterion: DE, HO, LT, DS, CA, RI, OT (Composite PK Part 2)"
|
|
56
|
+
VARCHAR standard_outc_label "Death, Hospitalization, Life-threatening..."
|
|
57
|
+
BOOLEAN is_death "Flag for fatal outcome (DE)"
|
|
58
|
+
BOOLEAN is_serious "Flag for serious adverse event"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
indi {
|
|
62
|
+
BIGINT primary_id PK,FK "Composite PK Part 1 / References drug(primary_id, drug_seq)"
|
|
63
|
+
INTEGER indi_drug_seq PK,FK "Composite PK Part 2 / References drug(primary_id, drug_seq)"
|
|
64
|
+
VARCHAR reported_indication_term PK "MedDRA Indication Term (Composite PK Part 3)"
|
|
65
|
+
VARCHAR reported_indication "Reported condition / disease treated"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ther {
|
|
69
|
+
BIGINT primary_id PK,FK "Composite PK Part 1 / References drug(primary_id, drug_seq)"
|
|
70
|
+
INTEGER dsg_drug_seq PK,FK "Composite PK Part 2 / References drug(primary_id, drug_seq)"
|
|
71
|
+
DATE start_date "Therapy initiation date"
|
|
72
|
+
DATE end_date "Therapy cessation date"
|
|
73
|
+
DOUBLE duration_days "Standardized duration in days"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
rpsr {
|
|
77
|
+
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
78
|
+
VARCHAR rpsr_code PK "Report source classification code (Composite PK Part 2)"
|
|
79
|
+
VARCHAR standard_rpsr_label "Health Professional, Study, Consumer..."
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🔑 Composite Primary Keys & Relational Cardinality
|
|
86
|
+
|
|
87
|
+
| Table | Entity / Domain | Primary Key (Composite) | Foreign Key Relationship | Cardinality | Description |
|
|
88
|
+
| :--- | :--- | :--- | :--- | :--- | :--- |
|
|
89
|
+
| **`demo`** | Case Submissions & Demographics | `primary_id` | *(Root submission table)* | Root | Individual patient report submission with demographic covariates. |
|
|
90
|
+
| **`drug`** | Drug Exposures & Regimens | `(primary_id, drug_seq)` | `primary_id` → `demo.primary_id` | 1 : N | Reported medicinal products, active ingredients, dosage forms, and suspect roles. |
|
|
91
|
+
| **`reac`** | Adverse Reactions | `(primary_id, reported_reaction_term)` | `primary_id` → `demo.primary_id` | 1 : N | Adverse reaction terms coded with MedDRA Preferred Terms (`reported_reaction_term`). |
|
|
92
|
+
| **`outc`** | Patient Outcomes | `(primary_id, outc_code)` | `primary_id` → `demo.primary_id` | 1 : N | Clinical seriousness criteria (`DE`, `HO`, `LT`, `DS`, `CA`, `RI`, `OT`). |
|
|
93
|
+
| **`indi`** | Therapy Indications | `(primary_id, indi_drug_seq, reported_indication_term)` | `(primary_id, indi_drug_seq)` → `drug(primary_id, drug_seq)` | 1 : N | Medical conditions and clinical indications for which each drug was prescribed. |
|
|
94
|
+
| **`ther`** | Therapy Timelines | `(primary_id, dsg_drug_seq)` | `(primary_id, dsg_drug_seq)` → `drug(primary_id, drug_seq)` | 1 : N | Start dates, end dates, and standardized therapy durations in days. |
|
|
95
|
+
| **`rpsr`** | Report Sources | `(primary_id, rpsr_code)` | `primary_id` → `demo.primary_id` | 1 : N | Reporting source categories (Physician, Pharmacist, Consumer, Study). |
|
|
96
|
+
| **`cases`** | Authoritative Deduplicated View | `case_id` | Derived from `demo` | 1 : 1 | Precomputed view resolving multi-version follow-ups to latest report version. |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 📖 Related Documentation
|
|
101
|
+
|
|
102
|
+
- **[Architecture & Engine Design](docs/architecture.md)**
|
|
103
|
+
- **[Canonical Data Model Specification](docs/schema/canonical_data_model.md)**
|
|
104
|
+
- **[Coded Values Reference](docs/schema/code_list_history.md)**
|
|
105
|
+
- **[ReadTheDocs Interactive Documentation](https://raxtik-etl.readthedocs.io/en/latest/)**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: raxtik-etl
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev2
|
|
4
4
|
Summary: Adverse event ETL pipeline and canonical data platform for pharmacovigilance and safety data generation
|
|
5
5
|
Project-URL: Homepage, https://github.com/raxtik-org/raxtik-etl
|
|
6
6
|
Project-URL: Documentation, https://raxtik-etl.readthedocs.io
|
|
@@ -75,81 +75,23 @@ Every source connector projects raw records into an analytical star-schema archi
|
|
|
75
75
|
- **Authoritative Case View (`cases`)**: Deduplicates multi-version submissions across reporting periods (`case_id` / `canonical_case_version` / `fda_date`) and computes key safety flags (`has_serious_outcome`, `is_death`, `is_expedited`).
|
|
76
76
|
- **16 Reference Dimensions (`_code_*`)**: Embedded lookup tables mapping ISO country codes, ICH E2B(R2/R3) guidelines, and FDA clinical codelists.
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
DOUBLE standard_age_years "Normalized age in decimal years"
|
|
96
|
-
VARCHAR standard_sex_label "Male / Female / Unknown"
|
|
97
|
-
DOUBLE standard_weight_kg "Normalized patient weight in kg"
|
|
98
|
-
VARCHAR reporter_occupation_label "Physician, Pharmacist, Consumer..."
|
|
99
|
-
VARCHAR report_type_label "Expedited 15-day, Periodic, Direct..."
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
drug {
|
|
103
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
104
|
-
INTEGER drug_seq PK "Exposure sequence per report (Composite PK Part 2)"
|
|
105
|
-
VARCHAR role_code "Role: PS, SS, C, I"
|
|
106
|
-
VARCHAR standard_role_label "Primary Suspect, Concomitant..."
|
|
107
|
-
VARCHAR reported_drug_name "Reported medicinal trade/brand name"
|
|
108
|
-
VARCHAR active_ingredient "Normalized generic active substance"
|
|
109
|
-
VARCHAR route "Administration route (Oral, IV...)"
|
|
110
|
-
VARCHAR dose_form "Dosage formulation (Tablet, Solution...)"
|
|
111
|
-
DOUBLE cumulative_dose "Normalized cumulative amount"
|
|
112
|
-
VARCHAR cumulative_dose_unit_label "Metric dose unit (mg, mL...)"
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
reac {
|
|
116
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
117
|
-
VARCHAR reported_reaction_term PK "MedDRA Preferred Term (Composite PK Part 2)"
|
|
118
|
-
BIGINT reaction_seq "Reaction sequence ordinal"
|
|
119
|
-
VARCHAR drug_reaction_action "Action taken with drug"
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
outc {
|
|
123
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
124
|
-
VARCHAR outc_code PK "Seriousness criterion: DE, HO, LT, DS, CA, RI, OT (Composite PK Part 2)"
|
|
125
|
-
VARCHAR standard_outc_label "Death, Hospitalization, Life-threatening..."
|
|
126
|
-
BOOLEAN is_death "Flag for fatal outcome (DE)"
|
|
127
|
-
BOOLEAN is_serious "Flag for serious adverse event"
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
indi {
|
|
131
|
-
BIGINT primary_id PK,FK "Composite PK Part 1 / References drug(primary_id, drug_seq)"
|
|
132
|
-
INTEGER indi_drug_seq PK,FK "Composite PK Part 2 / References drug(primary_id, drug_seq)"
|
|
133
|
-
VARCHAR reported_indication_term PK "MedDRA Indication Term (Composite PK Part 3)"
|
|
134
|
-
VARCHAR reported_indication "Reported condition / disease treated"
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
ther {
|
|
138
|
-
BIGINT primary_id PK,FK "Composite PK Part 1 / References drug(primary_id, drug_seq)"
|
|
139
|
-
INTEGER dsg_drug_seq PK,FK "Composite PK Part 2 / References drug(primary_id, drug_seq)"
|
|
140
|
-
DATE start_date "Therapy initiation date"
|
|
141
|
-
DATE end_date "Therapy cessation date"
|
|
142
|
-
DOUBLE duration_days "Standardized duration in days"
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
rpsr {
|
|
146
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
147
|
-
VARCHAR rpsr_code PK "Report source classification code (Composite PK Part 2)"
|
|
148
|
-
VARCHAR standard_rpsr_label "Health Professional, Study, Consumer..."
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
👉 **Complete Specification**: See the full **[Canonical Data Model Specification](docs/schema/canonical_data_model.md)** and **[Coded Values Reference](docs/schema/code_list_history.md)**.
|
|
78
|
+
### Entity Relationships & Composite Keys
|
|
79
|
+
|
|
80
|
+
| Table | Entity / Domain | Primary Key (Composite) | Foreign Key Relationship | Description |
|
|
81
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
82
|
+
| **`demo`** | Case Submissions & Demographics | `primary_id` | *(Root submission table)* | Patient age in decimal years, weight in kg, sex, country, receipt date. |
|
|
83
|
+
| **`drug`** | Drug Products & Regimens | `(primary_id, drug_seq)` | `primary_id` → `demo.primary_id` | Reported brand name, active substance, route, form, role code (`PS`, `SS`, `C`, `I`). |
|
|
84
|
+
| **`reac`** | Adverse Reactions | `(primary_id, reported_reaction_term)` | `primary_id` → `demo.primary_id` | MedDRA Preferred Terms (PT) describing adverse events. |
|
|
85
|
+
| **`outc`** | Patient Outcomes | `(primary_id, outc_code)` | `primary_id` → `demo.primary_id` | Clinical outcomes: Death (`DE`), Hospitalization (`HO`), Disability (`DS`), etc. |
|
|
86
|
+
| **`indi`** | Therapy Indications | `(primary_id, indi_drug_seq, reported_indication_term)` | `(primary_id, indi_drug_seq)` → `drug(primary_id, drug_seq)` | Medical conditions for which medications were prescribed. |
|
|
87
|
+
| **`ther`** | Therapy Timelines | `(primary_id, dsg_drug_seq)` | `(primary_id, dsg_drug_seq)` → `drug(primary_id, drug_seq)` | Therapy start date, end date, and duration in days. |
|
|
88
|
+
| **`rpsr`** | Report Sources | `(primary_id, rpsr_code)` | `primary_id` → `demo.primary_id` | Reporting channel: Health Professional (`HP`), Consumer (`CSM`), Study (`SDY`), etc. |
|
|
89
|
+
| **`cases`** | Authoritative Deduplicated View | `case_id` | Derived from `demo` | Precomputed deterministic resolution to latest report version per `case_id`. |
|
|
90
|
+
|
|
91
|
+
📖 **Visual Entity-Relationship Diagram**:
|
|
92
|
+
- 📊 **[Full Interactive ER Diagram (Mermaid)](ER_DIAGRAM.md)**
|
|
93
|
+
- 🌐 **[ReadTheDocs: Canonical Data Model](https://raxtik-etl.readthedocs.io/en/latest/schema/canonical_data_model.html)**
|
|
94
|
+
- 📚 **[Coded Values Reference](docs/schema/code_list_history.md)**
|
|
153
95
|
|
|
154
96
|
---
|
|
155
97
|
|
|
@@ -22,81 +22,23 @@ Every source connector projects raw records into an analytical star-schema archi
|
|
|
22
22
|
- **Authoritative Case View (`cases`)**: Deduplicates multi-version submissions across reporting periods (`case_id` / `canonical_case_version` / `fda_date`) and computes key safety flags (`has_serious_outcome`, `is_death`, `is_expedited`).
|
|
23
23
|
- **16 Reference Dimensions (`_code_*`)**: Embedded lookup tables mapping ISO country codes, ICH E2B(R2/R3) guidelines, and FDA clinical codelists.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
DOUBLE standard_age_years "Normalized age in decimal years"
|
|
43
|
-
VARCHAR standard_sex_label "Male / Female / Unknown"
|
|
44
|
-
DOUBLE standard_weight_kg "Normalized patient weight in kg"
|
|
45
|
-
VARCHAR reporter_occupation_label "Physician, Pharmacist, Consumer..."
|
|
46
|
-
VARCHAR report_type_label "Expedited 15-day, Periodic, Direct..."
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
drug {
|
|
50
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
51
|
-
INTEGER drug_seq PK "Exposure sequence per report (Composite PK Part 2)"
|
|
52
|
-
VARCHAR role_code "Role: PS, SS, C, I"
|
|
53
|
-
VARCHAR standard_role_label "Primary Suspect, Concomitant..."
|
|
54
|
-
VARCHAR reported_drug_name "Reported medicinal trade/brand name"
|
|
55
|
-
VARCHAR active_ingredient "Normalized generic active substance"
|
|
56
|
-
VARCHAR route "Administration route (Oral, IV...)"
|
|
57
|
-
VARCHAR dose_form "Dosage formulation (Tablet, Solution...)"
|
|
58
|
-
DOUBLE cumulative_dose "Normalized cumulative amount"
|
|
59
|
-
VARCHAR cumulative_dose_unit_label "Metric dose unit (mg, mL...)"
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
reac {
|
|
63
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
64
|
-
VARCHAR reported_reaction_term PK "MedDRA Preferred Term (Composite PK Part 2)"
|
|
65
|
-
BIGINT reaction_seq "Reaction sequence ordinal"
|
|
66
|
-
VARCHAR drug_reaction_action "Action taken with drug"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
outc {
|
|
70
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
71
|
-
VARCHAR outc_code PK "Seriousness criterion: DE, HO, LT, DS, CA, RI, OT (Composite PK Part 2)"
|
|
72
|
-
VARCHAR standard_outc_label "Death, Hospitalization, Life-threatening..."
|
|
73
|
-
BOOLEAN is_death "Flag for fatal outcome (DE)"
|
|
74
|
-
BOOLEAN is_serious "Flag for serious adverse event"
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
indi {
|
|
78
|
-
BIGINT primary_id PK,FK "Composite PK Part 1 / References drug(primary_id, drug_seq)"
|
|
79
|
-
INTEGER indi_drug_seq PK,FK "Composite PK Part 2 / References drug(primary_id, drug_seq)"
|
|
80
|
-
VARCHAR reported_indication_term PK "MedDRA Indication Term (Composite PK Part 3)"
|
|
81
|
-
VARCHAR reported_indication "Reported condition / disease treated"
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
ther {
|
|
85
|
-
BIGINT primary_id PK,FK "Composite PK Part 1 / References drug(primary_id, drug_seq)"
|
|
86
|
-
INTEGER dsg_drug_seq PK,FK "Composite PK Part 2 / References drug(primary_id, drug_seq)"
|
|
87
|
-
DATE start_date "Therapy initiation date"
|
|
88
|
-
DATE end_date "Therapy cessation date"
|
|
89
|
-
DOUBLE duration_days "Standardized duration in days"
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
rpsr {
|
|
93
|
-
BIGINT primary_id PK,FK "References demo.primary_id (Composite PK Part 1)"
|
|
94
|
-
VARCHAR rpsr_code PK "Report source classification code (Composite PK Part 2)"
|
|
95
|
-
VARCHAR standard_rpsr_label "Health Professional, Study, Consumer..."
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
👉 **Complete Specification**: See the full **[Canonical Data Model Specification](docs/schema/canonical_data_model.md)** and **[Coded Values Reference](docs/schema/code_list_history.md)**.
|
|
25
|
+
### Entity Relationships & Composite Keys
|
|
26
|
+
|
|
27
|
+
| Table | Entity / Domain | Primary Key (Composite) | Foreign Key Relationship | Description |
|
|
28
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
29
|
+
| **`demo`** | Case Submissions & Demographics | `primary_id` | *(Root submission table)* | Patient age in decimal years, weight in kg, sex, country, receipt date. |
|
|
30
|
+
| **`drug`** | Drug Products & Regimens | `(primary_id, drug_seq)` | `primary_id` → `demo.primary_id` | Reported brand name, active substance, route, form, role code (`PS`, `SS`, `C`, `I`). |
|
|
31
|
+
| **`reac`** | Adverse Reactions | `(primary_id, reported_reaction_term)` | `primary_id` → `demo.primary_id` | MedDRA Preferred Terms (PT) describing adverse events. |
|
|
32
|
+
| **`outc`** | Patient Outcomes | `(primary_id, outc_code)` | `primary_id` → `demo.primary_id` | Clinical outcomes: Death (`DE`), Hospitalization (`HO`), Disability (`DS`), etc. |
|
|
33
|
+
| **`indi`** | Therapy Indications | `(primary_id, indi_drug_seq, reported_indication_term)` | `(primary_id, indi_drug_seq)` → `drug(primary_id, drug_seq)` | Medical conditions for which medications were prescribed. |
|
|
34
|
+
| **`ther`** | Therapy Timelines | `(primary_id, dsg_drug_seq)` | `(primary_id, dsg_drug_seq)` → `drug(primary_id, drug_seq)` | Therapy start date, end date, and duration in days. |
|
|
35
|
+
| **`rpsr`** | Report Sources | `(primary_id, rpsr_code)` | `primary_id` → `demo.primary_id` | Reporting channel: Health Professional (`HP`), Consumer (`CSM`), Study (`SDY`), etc. |
|
|
36
|
+
| **`cases`** | Authoritative Deduplicated View | `case_id` | Derived from `demo` | Precomputed deterministic resolution to latest report version per `case_id`. |
|
|
37
|
+
|
|
38
|
+
📖 **Visual Entity-Relationship Diagram**:
|
|
39
|
+
- 📊 **[Full Interactive ER Diagram (Mermaid)](ER_DIAGRAM.md)**
|
|
40
|
+
- 🌐 **[ReadTheDocs: Canonical Data Model](https://raxtik-etl.readthedocs.io/en/latest/schema/canonical_data_model.html)**
|
|
41
|
+
- 📚 **[Coded Values Reference](docs/schema/code_list_history.md)**
|
|
100
42
|
|
|
101
43
|
---
|
|
102
44
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "raxtik-etl"
|
|
7
|
-
version = "0.1.0.
|
|
7
|
+
version = "0.1.0.dev2"
|
|
8
8
|
description = "Adverse event ETL pipeline and canonical data platform for pharmacovigilance and safety data generation"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -221,11 +221,11 @@ class BaseDataset:
|
|
|
221
221
|
None
|
|
222
222
|
"""
|
|
223
223
|
try:
|
|
224
|
-
|
|
224
|
+
rows = self._con.execute(
|
|
225
225
|
"SELECT value FROM _metadata WHERE key = 'package_format_version'"
|
|
226
|
-
).
|
|
227
|
-
if
|
|
228
|
-
self.package_format_version =
|
|
226
|
+
).fetchall()
|
|
227
|
+
if rows:
|
|
228
|
+
self.package_format_version = rows[0][0]
|
|
229
229
|
else:
|
|
230
230
|
self.package_format_version = "1.0.0"
|
|
231
231
|
except Exception:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/schema/models/report_source.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/src/raxtik_etl/transformations/normalization.py
RENAMED
|
File without changes
|
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/DEMO24Q1.txt
RENAMED
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/DRUG24Q1.txt
RENAMED
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/INDI24Q1.txt
RENAMED
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/OUTC24Q1.txt
RENAMED
|
File without changes
|
{raxtik_etl-0.1.0.dev1 → raxtik_etl-0.1.0.dev2}/tests/fixtures/sample_faers_ascii/REAC24Q1.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|