What is the same in both plans? The investigation is provider-first (e.g. DHD). Claimants are not the target — they are conduits. Billing (~1M lines, ~4k providers) gives the claim list. Documents are added per claim for pattern work (boilerplate narratives, treatment intervals) plus fee checks and opinion letters.

What is different? Left: investigator pastes text in the web app (OCR outside our system). Right: files live on Google Drive; our script does OCR, builds JSON per claim, outputs a report — less database/UI work, faster pilot.

What we never do: Ask for documents for all 4,000 providers. Invent providers. Guess a wrong claim link and analyze as if it were correct.

Left — Original plan

Web app investigation · paste document text per claim

In one sentence: PDFs are grouped by claim → investigator opens each claim in our app → pastes OCR text → we run analysis inside the product.

flowchart TB
    classDef box fill:#ffffff,stroke:#000,stroke-width:2px
    classDef soft fill:#f5f5f5,stroke:#000,stroke-width:2px
    classDef out fill:#fff,stroke:#000,stroke-width:3px
    classDef note fill:#eee,stroke:#666,stroke-width:1px

    A["① Billing in DB"]:::box
    B["② Pick provider DHD"]:::soft
    C["③ Claims from billing"]:::soft
    D["④ Docs per claim grouped"]:::box
    E["⑤ Paste in web app"]:::soft
    F["⑥ AI analysis"]:::soft
    G["⑦ Findings in UI"]:::out
    A --> B --> C --> D --> E --> F --> G
    N["Doc→claim link known BEFORE paste"]:::note
    N -.-> D
        

Who does what

StepPrepUs (ManningKass)
Billing CSV / bulk book ingested Store lines, providers, claim case IDs
Pick target Investigation target e.g. DHD Filter billing to that Tax ID / provider
Documents Files grouped by claim; OCR may run externally Show claim list; accept paste per claim
Analysis Review flags & export Run patterns, fees, opinion letters in app

Every step explained

Step 1 — Billing already in the system

~1 million billing lines, ~4,000 providers. Each row has: Tax ID, ClaimNumber, Claim Case (e.g. 1040386-01), service dates, CPT codes, amounts.

Note: Billing does not include patient names in a reliable way for matching files. Use claim case ID as the join key.

Step 2 — Open an investigation on one provider

Example: DHD (already identified as suspect). Investigator selects provider from the book — not all 4k providers at once.

UI shows: list of claims + billing lines + fee flags already computed.

Step 3 — Claim files arrive (grouped by claim)

PDFs arrive already tied to a claim — folder, zip, or filename with claim case ID.

DHD/
  1040386-01/
    1040386-01 - CALVIN WRIGHT - MV104.pdf
    1040386-01 - CALVIN WRIGHT - Initial.pdf
  1045746-01/
    ...

Doc types needed for patterns: initial report, follow-up, MV-104/police, MRI/PT where billed — not only NF-3.

Step 4 — Paste into the web app (no in-app OCR yet)

For each claim, for each document:

  • Choose type (Initial report, MV-104, MRI, …)
  • Enter title
  • Paste full text (from external OCR tool or copy from PDF)
  • Save on that claim

Demo mock: /ui/mock1 Flow A step 3.

Step 5 — Analysis & output

One run per provider investigation: document patterns across claims + fee schedule + opinion letters matched to service type.

Output: flags table, narrative summary, CSV export, links to source text in app.

Key rule: We do not take 5,000 random PDFs and figure out which claim each belongs to. Folder names (or grouping) establish that link first.

What we built toward this

Right — Proposed pilot

Google Drive · OCR script · JSON per claim · report

In one sentence: Folder tree under providers/DHD/claimants/ → script reads PDFs/DOCs → structured text + JSON per claim → analyze all claims for that provider → report.

Open sample folder on Google Drive manningkass_sample_folder · providers / DHD / claimants / …
flowchart TB
    classDef box fill:#ffffff,stroke:#000,stroke-width:2px
    classDef soft fill:#f5f5f5,stroke:#000,stroke-width:2px
    classDef out fill:#fff,stroke:#000,stroke-width:3px
    classDef note fill:#eee,stroke:#666,stroke-width:1px

    A["① Billing in DB"]:::box
    B["② Pick provider DHD"]:::soft
    C["③ Drive: providers/DHD/claimants"]:::box
    D["④ Script: OCR+AI"]:::soft
    E["⑤ JSON per claim"]:::soft
    F["⑥ Analyze all JSONs"]:::soft
    G["⑦ Report + Drive links"]:::out
    A --> B --> C --> D --> E --> F --> G
    U["unclassified_claimant_documents<br/>→ AI sort later"]:::note
    U -.-> C
        

Pilot flow in plain English

Part A — Folder structure must exist first

  • providers/ → one folder per provider (e.g. DHD/)
  • providers/DHD/claimants/ → one folder per claim case ID from billing (e.g. 1040386-01/)
  • Claim PDFs/DOCs inside that claimant folder (MV-104, initial report, MRI.doc, etc.)
  • providers/DHD/claimants/unclassified_claimant_documents/ → files not linked to a claim yet; AI sorting into claimant folders happens later (before analysis on those files)

Part B — Our script runs on those folders

  • Extract: each PDF → structured text (label + value, our format)
  • Bundle: billing lines for that claim case ID + all doc texts → one .json per claim
  • Analyze: load every JSON under the provider → run fixed patterns → output report + CSV

Part C — Optional (not built in pilot UI)

  • Extra ad-hoc questions can be asked against the exported text files using external AI tools

v1: analysis runs on claimant folders with a known claim case ID. Unclassified folder = sorted by AI first, then included.

Google Drive layout (sample)

View live sample → Google Drive
providers/
└── DHD/                              ← provider under investigation
    └── claimants/
        ├── 1040386-01/               ← claim case ID (matches billing)
        │   ├── MV104.pdf
        │   ├── Initial_report.pdf
        │   ├── MRI.doc
        │   └── Follow_up.pdf
        ├── 1045746-01/
        │   ├── Police_report.pdf
        │   └── PT_notes.pdf
        └── unclassified_claimant_documents/
            ├── scan_unknown_01.pdf   ← claim not known yet
            └── misc_document.doc     → AI sorts into claimant folder later

Every step explained

Step 1–2 — Same as left: billing + pick provider

We still use the ingested billing book. Investigator / script targets one provider (e.g. DHD). Claim case IDs from billing for that Tax ID are used as folder names.

Step 3 — Folders populated with claim PDFs

PDFs and DOCs are placed under providers/DHD/claimants/{claim_case_id}/. Folder name must match billing claim case ID. Filenames can include patient name for readability.

Files with unknown claim → unclassified_claimant_documents/ until AI (or manual) sort moves them into the right claimant folder.

Step 4 — Our script: OCR + normalize text

For each PDF, script produces our text format (not a copy of their form layout):

document_type: Initial report
claim_case_id: 1040386-01
provider_name: DHD
patient_name: CALVIN C. WRIGHT
accident_date: 10/03/2018
chief_complaint: Neck and back pain after MVA...
plan: PT, acupuncture, MRI if persistent...
(full extracted body below)

Handwriting & messy scans = lower confidence; may need human check. Text saved on Drive (pay OCR cost once per file).

Step 5 — One JSON file per claim case

Script pulls billing lines for 1040386-01 from CSV/DB + attaches all doc texts from that folder:

1040386-01.json
{
  "provider": "DHD",
  "tax_id": "...",
  "claim_case_id": "1040386-01",
  "claim_number": "1040386",
  "billing_lines": [ { "cpt": "99203", "amount": "...", ... } ],
  "documents": [
    { "file": "MV104.pdf", "type": "MV-104", "text": "..." },
    { "file": "Initial_report.pdf", "type": "Initial report", "text": "..." }
  ]
}
Step 6 — Analyze the whole provider “family”

Load all JSON files under providers/DHD/claimants/ (each claim case folder) — not one claim in isolation for cross-claim fraud patterns:

  • Compare initial reports across claimants (boilerplate? <5% variance?)
  • Treatment protocol: PT + chiro + acupuncture same day?
  • Intervals: MRI within ~14 days of first visit?
  • MV-104 facts: refused EMS? vehicle towed? low impact?
  • Fee overbilling vs schedule on billing lines in each JSON
  • Opinion letters auto-matched to service type (e.g. PT for DHD)
Step 7 — Deliver report

PDF/CSV + table of flags. Each finding links back to: claim case ID, JSON, original Drive PDF, billing line IDs.

Pilot UI: simple page — pick provider folder → run script → download report. No heavy DB ingest of every doc required.

Interactive walkthrough (sample data): /ui/mock2 (also /pilot-mock). Live providers + report: /ui/mock4 (also /pilot-live).

Phase 2 (later) AI reads unclassified_claimant_documents/ → sorts into the correct claimant folder → then same extract + JSON + analysis. Also supports starting from one big unsorted drop.

5-week rough plan (proposed)

WeekFocus
1providers/DHD/claimants/ sample on Drive; OCR script on 5–10 PDFs/DOCs
2JSON builder + billing join by claim case ID; quality check text
3Document pattern analysis across JSONs
4Fee flags + opinion letter matching in report
5End-to-end pilot on DHD batch + handoff doc

Standard analysis — same goals in BOTH plans (Aug 25 call)

Fixed scope for pilot. Anything outside this list = future phase or optional AI Q&A on exported text.

TrackWhat we look forExample output
Documents Boilerplate initial/follow-up narratives across claimants; same diagnoses; treatment protocol (PT+acu+chiro same day); MRI referral timing; MV-104 low-impact facts “Initial reports across claims 1040386, 1045746 — <5% wording variance”
Billing / fees Overbilling vs WC/DME fee schedule; service before accident; missing schedule codes; volume per provider “47 lines over schedule · est. $18,420 discrepancy”
Opinion letters Auto-match letter to service type (PT letters for PT billing); flag possible violations — not manual pick per letter “3 PT-related opinion hits for review”
Provider context Addresses, physicians on records, OPMC/license (where data exists) — storyline support Provider snapshot in report header

Quick comparison