parse_prescription
Extract structured data from prescription PDFs using a local Ollama model, including patient, doctor, medications, and notes.
Instructions
Parse a downloaded prescription PDF with a local Ollama model.
Extracts text from the PDF and sends it to a local Ollama model for structured extraction. Falls back to vision-mode (image rendering) for image-based PDFs.
Args: file_path: Path to the prescription PDF (from download_document). model: Ollama model ID to use (default: "llama3.2"; use a vision model like "llava" if the PDF is image-based).
Returns structured dict with: patient, date, doctor, specialty, medications (list with name/dci/strength/form/quantity/posology/duration), prescription_number, notes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | llama3.2 | |
| file_path | Yes |