Files
qingquan 5510342628 Add pathology report scraper and lymphoma data enrichment scripts
Scripts for batch-scraping pathology reports from the hospital PACS
system (by inpatient + outpatient number, across pathology and bone
marrow exam categories) and using the results to fill in blank fields
in a lymphoma patient dataset.
2026-08-30 21:27:35 +08:00

25 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# lymphoma-pathology-scraper
从内网病历/PACS系统批量抓取病理报告,并用抓取结果尽量补全淋巴瘤患者数据表格。
## 脚本说明
- **extract_pathology_reports.py** — 主抓取脚本。按病历号(住院号)+门诊号双重查询、按"病理"+"骨髓"两个检查类别搜索,去重合并后保存到 `患者报告/<病历号>/病理报告/`(一个汇总json+一个汇总txt+images目录)。抓取过程中把进度写入 `progress.json`,供 `watch_progress.py` 实时查看。
用法: `python extract_pathology_reports.py [患者数量上限,不填则跑全部]`
- **watch_progress.py** — 实时查看 `extract_pathology_reports.py` 的抓取进度(读 `progress.json`,定时刷新)。
用法: `python watch_progress.py [刷新间隔秒数,默认2]`
- **merge_pathology_json.py** — 把 `患者报告/<病历号>/病理报告/病理报告.json` 全部汇总成一个 `病理报告汇总.json`。
- **fill_lymphoma_excel.py** — 用 `病理报告汇总.json` 尽量补全淋巴瘤数据表格(IHC标志物、完整诊断、诊断日期、生发中心分型、骨髓侵犯、首发部位等),只填空白格子,不覆盖已有数据,并生成补全日志记录每个字段的来源报告。
## 依赖
- `http_scraper.py`(`HttpScaper` 类,位于 `all-codex - 副本` 目录)— 未包含在本仓库,需要单独放到 `sys.path` 能找到的位置。
- Python: `pandas`, `requests`, `openpyxl`
## 注意
本仓库只包含代码,不包含任何患者数据/Excel/JSON输出/日志(见 `.gitignore`)。脚本里的内网地址(病历系统、PACS系统等)仅在医院内网环境下可访问。