dahutapea's picture
Initial release: SATUSEHAT market intelligence dashboard, digitization pipeline scaffold, and presentation
c61cfd2
Raw
History Blame Contribute Delete
810 Bytes
"""Parsing stage: raw OCR text -> structured record.
Run in ocr_env. Input: data/ocr/*.json Output: data/records/<form_id>.json
Field strategies:
- dates, blood pressure, weight, id numbers: regex with tolerant patterns
(OCR confuses 0/O, 1/l, 5/S - normalize before matching)
- diagnosis: rapidfuzz fuzzy match against an ICD-10 code list CSV
(data/icd10.csv - code, description; add Indonesian aliases as needed)
- every field carries a confidence; below a threshold -> needs_review: true
Output record shape is FHIR-flavored on purpose (Patient / Encounter /
Condition sections) - the same shape SATUSEHAT integration expects.
TODO: implement parse(ocr_json) and main(); thresholds live at the top of
the file so the review-queue tradeoff is easy to demo.
"""
raise NotImplementedError("phase 2")