[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-108039":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":14,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":15,"starSnapshotCount":15,"syncStatus":37,"lastSyncTime":38,"discoverSource":39},108039,"MEDUCID","anshk1234\u002FMEDUCID","anshk1234","MEDUCID is a web application that takes medical laboratory reports , presents them in clear, readable language. It displays the original document side-by-side with extracted measurements, checks whether values fall within their printed reference ranges, and explains what each biomarker measures in simple terms without providing medical diagnoses.","https:\u002F\u002Fmeducid.vercel.app",null,"TypeScript",73,3,1,0,29,45.21,"MIT License",false,"main",true,[23,24,25,26,27,28,29,30,31,32],"api","cloudflare-d1","extract","gemini-api","google-oauth","hackathon","medical","medical-report","medical-report-simplifier","nextjs","2026-11-21 11:19:25","2026-11-21 16:30:17","\u003Cp align=\"center\">\n  \u003Cimg src=\"public\u002Fmeducid-logo.png\" alt=\"MEDUCID Logo\" width=\"280\" \u002F>\n\u003C\u002Fp>\n\n# MEDUCID\n\n> **Understand your lab report in plain language.**\n\nMEDUCID is a web application that takes medical laboratory reports (such as blood tests, metabolic panels, and urinalysis) and presents them in clear, readable language. It displays the original document side-by-side with extracted measurements, checks whether values fall within their printed reference ranges, and explains what each biomarker measures in simple terms without providing medical diagnoses.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fmeducid-landing.png\" alt=\"MEDUCID Landing Page & Showcase\" width=\"100%\" \u002F>\n\u003C\u002Fp>\n\n---\n\n## What It Does\n\nWhen you receive a laboratory report, it is often filled with abbreviations, technical units, and dense tables. MEDUCID simplifies this information while keeping the source data intact:\n\n- **Extracts Laboratory Findings**: Reads tests, results, units, reference ranges, and flags from uploaded PDFs, images, text files, or pasted text.\n- **Side-by-Side Verification**: Displays the original document on the left and structured results on the right. Clicking or hovering a result highlights its matching text line in the original document.\n- **Reference Range Evaluation**: Compares each numeric value strictly against the printed range on the report to determine if it is within range, above range, or below range.\n- **Plain-Language Explanations**: Explains what each biomarker is in general terms (for example, *Eosinophils: A type of white blood cell*) without guessing causes or diagnosing illnesses.\n- **Neutral Clinician Questions**: Generates objective, factual questions you can take to your doctor or healthcare provider.\n- **User Correction Flow**: Allows you to edit any extracted value, unit, or range directly in the interface if needed.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Fmeducid-workspace.png\" alt=\"MEDUCID Interactive Split-Screen Workspace\" width=\"100%\" \u002F>\n\u003C\u002Fp>\n\n---\n\n## Data Flow & Architecture\n\n```mermaid\nflowchart TD\n    A[\"Uploaded Report (PDF, Image, TXT, DOCX)\"] --> B[\"Document Ingestion & Preprocessing\"]\n    B --> C{\"Text Layer Available?\"}\n    C -- \"Yes (Digital PDF \u002F TXT)\" --> D[\"Local Parser (PDF.js \u002F Coordinate Extractor)\"]\n    C -- \"No (Scanned \u002F Image)\" --> E[\"Gemini Vision API (Multimodal Extraction)\"]\n    D --> F[\"Unified Medical Finding Extractor\"]\n    E --> F\n    F --> G[\"Reference Range Interpreter\"]\n    G --> H[\"Factual Consistency & Verbatim Grounding Audit\"]\n    H --> I[\"Isolated Browser Session State (No Database)\"]\n    I --> J[\"Split-Screen Workspace (Document + Results)\"]\n```\n\n---\n\n## Core Principles & Safety Guardrails\n\n1. **Verbatim Preservation**: Test names, numerical values, measurement units, and reference ranges appear exactly as printed on the source document. MEDUCID never rounds numbers or reformats units.\n2. **Strict Range Comparisons**: \"Outside range\" means only that a value falls above or below the printed reference interval on that specific report. It never suggests causes, diseases, treatments, or dietary changes.\n3. **Non-Diagnostic Explanations**: Explanations describe what a test or cell type is in general biology. They never make claims about a patient's personal condition.\n4. **Three-Bucket Count Consistency**: Every extracted measurement is placed in exactly one of three mutually exclusive categories that sum to the total:\n   - Within printed numeric range\n   - Outside printed numeric range\n   - No numeric range printed (qualitative tests like *Negative* or tests without ranges)\n5. **No Database & Session Isolation**: MEDUCID does not store your files on a server or in a database. All active data is kept in the user's browser `sessionStorage`, ensuring different users never see or mix each other's files.\n6. **Synthetic \u002F De-Identified Data Only**: Built for educational understanding of de-identified or synthetic reports. Medical interpretation always belongs to a qualified healthcare professional.\n\n---\n\n## Technologies Used\n\n- **Framework**: [Next.js 16](https:\u002F\u002Fnextjs.org\u002F) (App Router, Turbopack)\n- **UI Library**: [React 19](https:\u002F\u002Freact.dev\u002F)\n- **Language**: [TypeScript 5](https:\u002F\u002Fwww.typescriptlang.org\u002F)\n- **Styling**: [Tailwind CSS v4](https:\u002F\u002Ftailwindcss.com\u002F)\n- **Icons**: [Lucide React](https:\u002F\u002Flucide.dev\u002F)\n- **Document Viewing**: [PDF.js](https:\u002F\u002Fmozilla.github.io\u002Fpdf.js\u002F) for in-browser canvas rendering and coordinate-based text layer synchronization\n- **AI Extraction & OCR**: Google Gemini API with automatic 10-key rotation and multi-model fallback (`gemini-3.5-flash`, `gemini-3.1-flash-lite`, `gemini-3.6-flash`, `gemini-3.7-flash`)\n- **Testing**: [Vitest](https:\u002F\u002Fvitest.dev\u002F) for unit and regression testing\n\n---\n\n## Project Structure\n\n```text\nMEDUCID\u002F\n├── src\u002F\n│   ├── app\u002F\n│   │   ├── api\u002F\n│   │   │   └── extract\u002F\n│   │   │       └── route.ts          # Stateless API route for AI extraction & model rotation\n│   │   ├── globals.css               # Global styling and Tailwind imports\n│   │   ├── layout.tsx                # App root layout and metadata\n│   │   └── page.tsx                  # Main app controller (Landing, Processing, Workspace)\n│   ├── components\u002F\n│   │   ├── AnnotatedExplanation.tsx  # Term definition tooltips for medical vocabulary\n│   │   ├── CompactRangeBar.tsx       # Visual range gauge (~100px) showing value within bounds\n│   │   ├── LandingScreen.tsx         # Upload dropzone, file validation, and sample reports menu\n│   │   ├── NoticeBanner.tsx          # Persistent educational notice banner\n│   │   ├── OriginalReportPane.tsx    # Left pane viewer (PDF canvas, image, extracted text)\n│   │   ├── PdfCanvasViewer.tsx       # PDF.js canvas renderer with interactive text highlighting\n│   │   ├── ProcessingStepper.tsx     # 3-step animated progress stepper\n│   │   ├── SimplifiedResultsPane.tsx # Right pane (Overview, All Results, Clinician Questions)\n│   │   └── SplitScreenWorkspace.tsx  # Draggable 50\u002F50 split-screen workspace\n│   ├── data\u002F\n│   │   ├── medicalTerms.ts           # Plain-language dictionary for clinical terminology\n│   │   └── syntheticReports.ts       # Synthetic test benchmarks (CMP, CBC, Lipid, Thyroid)\n│   ├── lib\u002F\n│   │   ├── consistencyChecker.ts     # Verbatim grounding audit & field-level verification\n│   │   ├── documentExtractor.ts      # Multi-section parsing (CBC, Biochemistry, Urinalysis)\n│   │   ├── fileProcessor.ts          # PDF\u002Fimage\u002Ftext file preparation & coordinate extraction\n│   │   ├── geminiRotation.ts         # Multi-key rotation and model fallback handler\n│   │   ├── rangeInterpreter.ts       # Numeric interval and qualitative reference range parser\n│   │   ├── sessionState.ts           # Isolated tab-scoped browser session storage\n│   │   └── simplificationEngine.ts   # Summary generation and clinician question builder\n│   └── types\u002F\n│       └── report.ts                 # TypeScript types (MedicalFinding, SimplifiedReport, etc.)\n├── tests\u002F\n│   ├── extractionCompleteness.test.ts # PDF vs TXT consistency & multi-section tests\n│   ├── factualConsistency.test.ts    # Factual grounding & 3-bucket sum tests\n│   └── sessionState.test.ts          # Multi-user session isolation tests\n├── package.json\n└── tsconfig.json\n```\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- [Node.js](https:\u002F\u002Fnodejs.org\u002F) (version 18 or newer)\n- npm or yarn\n\n### Installation\n\n1. Clone or download the repository:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fanshk1234\u002FMEDUCID.git\n   cd MEDUCID\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. (Optional) Configure Gemini API keys in `.env.local`:\n   ```bash\n   GEMINI_API_KEYS=\"key1,key2,key3...\"\n   ```\n   *Note: If no API keys are provided, MEDUCID automatically uses its local clinical parser for digital PDFs and text files.*\n\n### Running Locally\n\nTo start the development server accessible to your computer and devices on your local network:\n\n```bash\nnpm run dev\n```\n\nOpen your browser and navigate to:\n- On the host machine: `http:\u002F\u002Flocalhost:3000`\n- On other devices on your local network: `http:\u002F\u002F\u003Cyour-ip-address>:3000`\n\n### Building for Production\n\nTo create an optimized production build:\n\n```bash\nnpm run build\nnpm start\n```\n\n---\n\n## Running Tests\n\nMEDUCID includes an automated test suite covering document extraction, reference range boundaries, verbatim grounding, and session isolation:\n\n```bash\nnpm test\n```\n\nAll 46 unit and regression tests run using Vitest.\n\n---\n\n## Privacy & Security\n\n- MEDUCID operates without a persistent backend database.\n- Uploaded files are processed in-memory or directly inside the client browser.\n- Session information is saved only to the individual user's browser `sessionStorage` and is discarded when the session is closed or cleared.\n","MEDUCID 是一个面向患者的医疗检验报告解读工具，将血常规、生化、尿液分析等实验室报告转化为通俗易懂的语言。它支持 PDF、图片、文本等多种格式上传，通过本地解析（PDF.js）与 Gemini Vision API（处理扫描件）双路径提取检测项目、数值、单位及印刷版参考范围；采用侧边对比视图展示原文与结构化结果，严格按报告原文进行范围比对，并为每项生物标志物提供中立、无诊断倾向的简明解释和医患沟通建议问题。适用于患者自主理解检验结果、提升医患沟通效率，不替代临床诊疗。",2,"2026-11-24 04:33:23","CREATED_QUERY"]