Prescription AI

A photographed prescription becomes a catalog-checked medicine list

Most physicians in Bangladesh still write prescriptions by hand, mixing English drug names, Bangla instructions, and more than one numeral system. OPD claims need that prescription. The model is not allowed to invent a medicine.

Production pipeline

  1. 1
    Upload

    The original image is stored unchanged, with a UUID and a SHA-256 hash.

  2. 2
    Preprocess

    The service corrects orientation, resizes to a working range, crops, deskews, denoises, and adjusts contrast.

  3. 3
    Transcribe

    A vision-language model returns strict JSON. Local English-only OCR engines exist in the codebase and are off by default, so Bangla reading depends on the vision model.

  4. 4
    Match the catalog

    RapidFuzz scores candidates against the live medicines table: 21,361 rows, on brand, generic, strength, and package.

  5. 5
    Normalise

    Bangla and English dosage, instruction, and duration are parsed into shared codes. A pattern such as morning–afternoon–night is one of those codes.

  6. 6
    Confidence gate

    A result completes automatically only when the overall score is at least 90 and every line matches the catalog. Otherwise it needs a person, or it fails.

The catalog is the source of truth

Prescription AI and IMP use the same medicines table. They do not keep two formularies that can drift apart.

Matching normalises Unicode, maps Bengali digits to Arabic digits, and strips punctuation. A small alias table corrects known reading mistakes. Strength is extracted from units such as mg, ml, and IU. Candidates are scored with a bonus when strength agrees.

A line binds automatically only above the high threshold. Anything below the review threshold is sent to a person. The original model output is kept when a reviewer corrects a line, so both versions remain for audit.

A clinic or pharmacy can use it today. It is not yet a step inside the mobile claim form. Connecting the two is proposed work.

What is live, partial, or still research

Status labels follow the implementation matrix in the system overview.
CapabilityStatus
Image upload, preprocessing, and AI transcriptionImplemented
Catalog-constrained medicine matchingImplemented
Bangla and English dosage and instruction normalisationImplemented
Human verification APIImplemented
Full verification workbench for operatorsPartial
Local Bengali OCRPartial
Formal confidence calibrationProposed
Wired into the mobile OPD claim formProposed
Dedicated layout detection and a national annotated benchmarkFuture / Research