Troubleshooting
SOURCE_TYPE is invalid
Symptom:
- startup fails or prints that
SOURCE_TYPEmust be one ofcsv,mysql, orjson
Fix:
- check
.env - check one-off environment overrides
- check the
--source-typeCLI flag
CSV run says SOURCE_DIR does not exist
Symptom:
run.pyprints an error aboutSOURCE_DIR
Fix:
- verify the path exists
- pass
--source-dir /actual/pathorSOURCE_DIR=/actual/pathfor a one-off run - ensure the directory contains
.csvfiles
MySQL run connects but no useful tables appear in SQLite
Symptom:
- MySQL connection succeeds, but downstream tables are missing
Fix:
- inspect the source database directly to confirm the expected tables exist
- confirm
MYSQL_DATABASEpoints at the source schema you intend to copy - remember that this code runs
SHOW TABLESand thenSELECT *per discovered table
JSON run finishes but expected source tables are missing
Symptom:
- you only see
CALCULATED_*tables after a JSON run
Explanation:
- this is expected
- JSON mode does not recreate imported source tables
JSON run imports fewer rows than expected
Common causes:
- some records are missing
PatientID - the payload does not contain a top-level
patientslist - duplicate
PatientIDvalues are being upserted into one row per patient
Checks:
sqlite3 output/databases/individual/omop.sqlite3 "SELECT COUNT(*) FROM CALCULATED_PATIENT_DATA;"
sqlite3 output/databases/individual/omop.sqlite3 "SELECT COUNT(*) FROM CALCULATED_DX_DATA;"
Dates are missing in JSON mode
Symptom:
DATE_OF_BIRTHisNULLfor some imported patients
Explanation:
- JSON mode only normalizes recognized date formats
- supported values currently include
MM-DD-YYYYandYYYY-MM-DD - invalid values are set to
NULL
Cancer values are missing in JSON mode
Symptom:
CANCERisNULL
Explanation:
- only recognized values map cleanly today:
BreastCancer->BOvarianCancer->OMelanoma->M
- unrecognized values are stored as
NULL
Missing tables during reporting/export
Symptom:
- exports or reports fail because calculated tables do not exist
Fix:
- confirm you ran the correct source mode first
- confirm you are pointing at the correct
SQLITE_DB_PATH - inspect the destination DB with
.tables
The repo is hard to re-understand after time away
Recommended order:
README.mddocs/importer/architecture.mddocs/importer/config-reference.mdomop_importer/run.pyomop_importer/source/config_processor.py