AI Test-Script Generation from Clinical Workflow Diagrams
Vision-LLM Diagram Understanding for Oracle Health QA
My Role
- Choose the vision model by cross-cloud benchmark
- Sharpen images; drop grayscale and edge detection
- RAG over historical workflow–test-script pairs
Approach at a Glance
Details- 1Cross-Cloud Model Benchmark
- 2Image Preprocessing Study
- 3Workflow Graph Extraction
- 4Workflow-to-Test-Script Matching
- 5Admin Panel and Historical Pairs
- 6RAG over Past Cases
Executive Summary
An AI system for a healthcare IT consultancy that tests hospital processes running on the Oracle Health EHR. The consultancy's QA engineers work from a large library of clinical workflow diagrams, Visio-style PDFs describing hospital processes, and write test scripts that cover every step and every decision branch.
The system automates that work in two phases:
- Phase 1 (Feb – May 2025): a vision LLM reads each diagram and turns it into a structured graph of steps, decisions and Yes/No branches, which is then matched against existing test scripts. We benchmarked models across OpenAI, AWS Bedrock and Google Cloud, and tested image preprocessing methods. The best combination, GPT-4.5 on sharpened images, reached 95%+ extraction accuracy.
- Phase 2 (Aug 2025 – Feb 2026): an admin panel and a retrieval layer over historical workflow–test-script pairs let the LLM generate and check test scripts for new workflows, learning from the ones already written.
Together this cut manual test-script authoring by 70%. I was the architect and tech lead, advising a team of up to 5 people.
Client Profile
The client is a healthcare IT consultancy that implements and tests hospital workflows in the Oracle Health EHR. Every clinical process is documented as a flowchart, and every flowchart needs test scripts that walk through each path, including every decision and its alternatives.
The consultancy faced four problems:
- Manual authoring: QA engineers wrote every test script by hand from the diagrams.
- Coverage gaps: with many branches per diagram, steps and paths were easy to miss.
- Diagrams are just images: Visio-style PDFs with numbered boxes and arrows, but no machine-readable structure.
- Volume: a large number of workflows across many hospital modules.
Reading the diagrams correctly is harder than it looks. Arrows are uneven, broken, unlabeled or cross each other; step numbers are small; and decisions branch into Yes and No paths that can loop back or jump to other pages.
Technical Approach
Phase 1 – Diagram Understanding
-
Cross-Cloud Model Benchmark – We tested vision-capable models from OpenAI, AWS Bedrock and Google Cloud on the client's workflow diagrams. Each model had to output the full list of edges (step → step), with the correct step numbers and Yes/No labels on decision branches. GPT-4.5 performed best: little to no hallucination, and solid reasoning on hard cases such as uneven, broken, unlabeled or crossing arrows.
-
Image Preprocessing Study – We measured how preprocessing affects diagram reading. Sharpening, or sharpening plus splitting the image in half, gave the best results. Grayscale and edge detection, often assumed to help, actually hurt: they made the model misread step numbers and invent connections that don't exist, so we dropped them.
-
Workflow Graph Extraction – Each diagram becomes a structured graph in JSON: steps, decisions, Yes/No branches, loops and off-page references. Test scripts from Word and PDF documents are converted into the same structured form, so workflows and tests can be compared step by step.
-
Workflow-to-Test-Script Matching – The extracted graph is aligned with the existing test scripts, which shows which steps and branches are covered and which aren't.
Phase 2 – Retrieval-Based Test-Script Generation
-
Admin Panel and Historical Pairs – QA leads upload aligned workflow–test-script pairs through an admin panel. These pairs become the system's memory of how the consultancy writes tests.
-
RAG over Past Cases – The pairs are indexed in Qdrant. When a new workflow is processed, the system retrieves the most similar historical cases and sends them, together with the new workflow, to the OpenAI LLM. The LLM then generates or checks the test script in the same style and structure as the team's existing ones.
Business Outcome
The consultancy turned clinical workflow diagrams, which were only images, into structured graphs its QA process could work with. Diagrams were extracted with 95%+ accuracy, and coverage gaps between workflows and test scripts became visible automatically. With the second phase, new test scripts are drafted from the team's own historical examples, which cut manual test-script authoring by 70%.
The project also showed something useful about vision LLMs on technical diagrams: choosing the model by benchmark and using simple preprocessing matters more than heavy image processing. Edge detection, a common instinct, made results worse.
Technologies
Planning something similar?
Tell me about it on a short call. New projects can start within 2 weeks