hoangsonww/SymptomSync-Health-App

Prescription Label OCR + Human-Verification Flow for Medication Autofill

開放

#47 建立於 2026年2月17日

 (0 則留言) (0 個反應) (1 位負責人)TypeScript (8 個分叉)auto 404
bugcodexdocumentationenhancementgood first issuehelp wantedquestion

倉庫指標

星標
 (30 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Summary

Add a medication-label OCR flow so users can snap or upload a prescription label image and prefill medication reminder fields when barcode/QR data is unavailable.

Motivation

SymptomSync already supports barcode scanning, but many labels are damaged, missing, or not machine-readable. OCR-based autofill would reduce manual typing and lower data-entry friction while still keeping users in control.

Proposed scope (MVP)

  1. Label capture/input
  • Allow image upload and camera capture from the medication creation/edit flow.
  1. OCR extraction
  • Extract structured candidates for:
    • medication name
    • strength
    • dosage instructions
    • frequency text
    • optional NDC / Rx number if present
  1. Parsing + confidence scoring
  • Normalize OCR text into medication form fields.
  • Return per-field confidence (high, medium, low) to drive UX.
  1. Human verification step (required)
  • Show extracted values in editable form fields before save.
  • Require explicit user confirmation; never auto-save to database directly from OCR output.
  1. Provenance + observability
  • Store extraction metadata (source=ocr_label, timestamp, confidence summary) for debugging and quality tracking.

Suggested technical approach

  • Frontend:
    • Add "Scan Label" CTA in medication form.
    • Reuse existing medication form validation, but prefill values from OCR response.
  • Backend:
    • Add /api/med/ocr endpoint that accepts image input and returns normalized fields + confidence.
    • Use a pluggable OCR service layer so provider changes do not affect UI contracts.
  • Data:
    • Add optional metadata columns (or side table) for OCR provenance and confidence snapshots.

Acceptance criteria

  • User can upload/capture a medication label image from medication form.
  • OCR response prefills medication fields in editable state.
  • User must review and confirm before medication is created/updated.
  • Low-confidence fields are visibly flagged for manual review.
  • OCR failures return actionable messages without blocking manual entry.
  • Unit/integration tests cover OCR parsing, confidence mapping, and confirmation gating.

Out of scope (later)

  • Full handwriting recognition for cursive notes.
  • Direct pharmacy integrations/e-prescription import.

Suggested labels

enhancement, help wanted

貢獻者指南