notebooks/Synthea.ipynb: rewrite as a real synthlab tutorial - #5
Merged
Conversation
The notebook on main was byte-identical to bschilder/AoU's original
copy — it still imported AoU.phenome.synthea.* and never exercised any
synthlab code. Replaced with an end-to-end tutorial against the
synthlab public API:
1. SyntheaRunner() auto-downloads the Synthea JAR
2. SyntheaConfig(population_size=10, exporter_flags={"exporter.csv.export": "true",
"exporter.fhir.export": "false"}) to enable CSV output
3. runner.run() → 18 CSV files
4. convert_synthea_to_omop(cdm_version="5.4", output_format="parquet")
→ 10 OMOP tables (person, condition_occurrence, drug_exposure, …)
5. pandas previews of the resulting OMOP frames
Rendered end-to-end (6 of 6 code cells, 0 errors); the person table
preview shows 14 real synthetic patients. Closes the migration
described in the AoU notebook deprecation pointer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`convert_synthea_to_omop` returns a `dict[str, str]` keyed by OMOP table name; the cell was iterating the dict directly (which yields keys), then calling `Path(path).stat()` on the table name, which always returns 0. Switched to `omop_files.items()` and now print both the table name and the actual file size. Cosmetic only — the conversion itself was already correct. Caught by PR review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
The Synthea notebook on `main` was byte-identical to `bschilder/AoU/notebooks/Synthea.ipynb` — it still imported `AoU.phenome.synthea.*` and never exercised any synthlab code. This PR replaces it with an end-to-end tutorial against synthlab's public API.
Walks through:
Render status
Notes for reviewer
Test plan
🤖 Generated with Claude Code