FlowRunner
Features Pricing
Theme
Start Free

Lab portal reports recorded on the Healthie chart

Staff save lab reports from lab portals to a Google Drive folder. Textract reads every page, the result is recorded on the right Healthie chart and the ordering provider gets a review task.

The prompt

When someone on our team saves a lab report from a lab portal into our lab results folder in Google Drive, read every page with AWS Textract: each test, result, units, the lab's printed range and the lab's flag, plus the patient's name and birth date, the ordering provider and the lab. Copy the values exactly and never decide what they mean. If the lab flagged a value, post it to our lab alerts channel in Slack right away. Find the patient in Healthie by name and birth date. With exactly one match, record the result on that chart with every value and give the ordering provider a review task that lists the flagged values, any value outside the lab's printed range with no flag, and any cell Textract wasn't sure of. If there are two matches, only a close match, or no match, ask our intake coordinator in Slack which chart it is and wait. Never create a patient from a lab result.

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

The flow

Yes No Yes No Yes No Yes No Yes Yes Yes No Repeats for each item Wait for Textract tofinish Action Not read yet Action Start readingevery page Action Download thereport Starts the flow New report in thelab results folder Condition PDF or image? Action Store the reportfor Textract Action Tell the resultsclerk it is not aresult Condition Lab result? AI agent Line up the results Code Check every value Condition Read every page? Code Gather what Textractread Action Tell the resultsclerk it was notread Asks a person Ask the intakecoordinator Condition One exact match? Condition Chart picked? Condition Any value the labflagged? Action Search by birthdate Code Settle on the chart Code Get the record ready Action Search by lastname Action Find the patient inHealthie Action Tell the providersnow Asks a person Wait for thecoordinator's answer Code Match on name andbirth date Code Write the question forthe coordinator Action Record the resultin Healthie Action Review task for theordering provider Condition Ordering providerknown? Action Tell the coordinatorit was not recorded Action Tell the resultsclerk it is not a PDF

Inside the loop: Wait for Textract to finish

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

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 report in the lab results folder Checks your Google Drive folder every 2 minutes and picks up each new PDF or image a member of staff saved from a lab portal. Any other file, such as a Word or web page export, goes to the results clerk in Slack with a link and the reason.
  2. 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 patient's name and birth date, the ordering provider, the lab and the dates. 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 results clerk in Slack with the reason.
  3. Line up the results An AI step lines up each row as test, result, units, range and the lab's flag, copied as printed, and never adds a flag or says what a value means. Check every value then matches each value back to the cells Textract read and lists the cells it was unsure of.
  4. Tell the providers now Any value the lab flagged goes to Slack at once, with the patient's name and birth date, the test, the value, the lab's range and flag, and a link to the report.
  5. Find the patient in Healthie Searches Healthie by name and birth date, then by birth date alone and by last name. Only a single chart with the same first name, last name and birth date counts as a match.
  6. Ask the intake coordinator Two matching charts, a close match or no match goes to the intake coordinator in Slack with the name and birth date on the report and a link to each chart that looks close. No patient is ever created from a result.
  7. Wait for the coordinator's answer The run waits for the click. Picking a chart records the result there. Not in Healthie leaves the report with the coordinator.
  8. Record the result in Healthie Record Lab Result files the report in your lab results folder and creates a lab order with the panel, the lab, the ordering provider and each value with its units, range and the lab's flag. Review task for the ordering provider then lists the flagged values, values outside the lab's printed range and the cells to check against the page. When no ordering provider can be found and no default is set, nothing is recorded and the coordinator gets the report in Slack.

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.

  • Connect your Google Drive and Slack accounts, enter your Healthie API key, and enter 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.
  • 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 uses the patient's own provider in Healthie, then default.
  • Copy the URL of the block Wait for the coordinator's answer into the flow setting Answer link. The Slack buttons open it.
  • Pick the shared folder in New report in the lab results folder, your Healthie lab results folder in Record the result in Healthie, the channel your providers and on-call clinician watch in Tell the providers now, and the intake coordinator's channel in Ask the intake coordinator, Tell the coordinator it was not recorded and the three Tell the results clerk steps.