Repository navigation
Conversation
- pyhealth/datasets/synthetic_ehr.py: parse custom CSV into Patient-Visit-Event structure, compatible with 1.x-style API - tests/core/test_synthetic_ehr.py: 7 pytest unit tests - examples/synthetic_ehr/: example data generator + synthetic_ehr.csv
Collaborator
|
/review |
Test CoverageWarning Tests failure; coverage may be incomplete. Total: 67.92% (16837 / 24791 lines)
|
This branch has not been deployed
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
为 PyHealth 添加一个轻量级自定义 CSV 病历数据 adapter,方便新手在不了解 PyHealth 完整架构的情况下快速上手并理解 Patient→Visit→Event 三层数据模型。
Changes
pyhealth/datasets/synthetic_ehr.py— 新的SyntheticEHRDataset类BaseDataset(2.x 架构),同时保留 1.x 风格的直观结构作为教学桥梁tests/core/test_synthetic_ehr.py— 7 个 pytest 单元测试test_load_normal_csv— 3 患者 × 2 就诊test_patient_metadata— 性别/年龄解析test_visit_timestamp_sorting— 就诊时间排序test_event_types_present— 四种事件类型test_lab_values— 实验室检查值test_empty_csv— 空 CSV 边界情况test_multiple_visits_same_patient— 同患者多次就诊examples/synthetic_ehr/generate_synthetic_ehr.py— 合成数据生成脚本Testing
所有 7 个测试在本机通过(Python 3.12.7)。
Notes