FlowRunner
Features Pricing
Theme
Start Free

Healthie lab result PDFs read for provider review

Reads every page of each lab result PDF filed in your Healthie lab results folder with Textract and gives the provider one review task, with lab-flagged values first and cells to check.

The prompt

When a document is filed in the lab results folder on a patient's Healthie chart, wait a couple of minutes, then skip it if it's already on one of the patient's lab orders, so nothing is done twice. Otherwise read every page with AWS Textract: each test, result, units, the lab's printed range and the lab's flag, plus the name and birth date on the report. Copy the values exactly and never decide what they mean. Give the ordering provider, or the patient's own provider in Healthie, one review task that lists the values the lab flagged, any value outside the lab's printed range with no flag, and any cell Textract wasn't sure of, so they can check it against the page. If the lab flagged a value, post it to our lab alerts channel in Slack right away. If the name or birth date on the report doesn't match the chart, tell intake in Slack so they can check it's on the right chart.

FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.

The flow

Yes Yes No Yes No No Yes Repeats for each item Wait for Textract tofinish Action Check the patient'slab orders Action Store the reportfor Textract Action Look in the labresults folder Code Decide whether toread it Starts the flow New document ona chart Action Start readingevery page Action Download thereport Action Give other steps timeto save Condition New lab report toread? Action Not read yet Condition Read every page? Code Check every value AI agent Line up the results Action Tell the care teamit is not a result Action Tell the care teamit was not read Code Gather what Textractread Condition Lab result? Action Review task forthe provider Action Tell intake tocheck the chart Action Tell the providernow Code Compare the reportwith the chart Condition Report matches thechart? Action Get the patient'schart Condition Any value the labflagged?

Inside the loop: Wait for Textract to finish

No Condition Still reading? Action Done reading Action Keep what Textractread Action Give Textract amoment Action Check the reading

Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. How importing works

What each step does

  1. New document on a chart Starts as soon as a document is uploaded to a patient's chart in Healthie.
  2. Decide whether to read it After two minutes, so another flow has time to finish recording a result, the document is read only if it sits in your lab results folder, is a PDF or an image, and is not already on one of the patient's lab orders. Nothing is filed again.
  3. Start reading every page The report is stored in your S3 bucket so Textract can read every page, for the result tables and for the name, birth date, ordering provider and lab on the report. The flow checks back every 10 seconds for up to 15 minutes. A report Textract cannot read, or does not finish in that time, goes to the care team in Slack with the reason.
  4. Line up the results An AI step lines up each row as test, result, units, range and the lab's flag, copied as printed. Check every value then matches each value back to the cells Textract read and lists the cells it was unsure of, with their page.
  5. Tell the provider now Any value the lab flagged goes to Slack at once, with the patient, the test, the value, the lab's range and flag, and a link to the chart.
  6. Compare the report with the chart Checks the name and birth date on the report against the chart, and picks who gets the task: the ordering provider from your list, otherwise the patient's own provider in Healthie.
  7. Review task for the provider One task on the chart lists the values the lab flagged, values outside the lab's printed range with no flag, cells to check against the page, and every value on the report. It is high priority when the lab flagged anything.
  8. Tell intake to check the chart When the name or birth date on the report differs from the chart, intake gets a Slack message with both and a link to the chart.

Before you turn it on

This flow assumes every service in it, FlowRunner included, has signed a business associate agreement (BAA) with you. Its messages to your staff include the patient details they need to decide.

  • Enter your Healthie API key, and an AWS access key and secret for Textract and for S3 with the same region in both. The key needs permission to write to your bucket and to run Textract on it. Connect your Slack account.
  • Add your Anthropic key in the flow setting Anthropic key. Set S3 bucket to a bucket in the same AWS region as Textract, and Confidence floor to the Textract confidence, from 0 to 100, below which a cell goes on the check list. It starts at 90.
  • Fill the flow setting Ordering providers with Healthie provider IDs keyed by each ordering provider's last name as printed on reports. A name not on the list sends the task to the patient's own provider, then to default.
  • Pick your lab results folder in Look in the lab results folder. Left empty, every new chart document is read.
  • Pick the channel your providers and on-call clinician watch in Tell the provider now, and the intake or care team channel in Tell intake to check the chart, Tell the care team it was not read and Tell the care team it is not a result.