Faxed prescriptions checked before Rx review in CareTend
Reads each prescription faxed to a specialty pharmacy's Documo line with Textract, files signed, complete ones for Rx review in CareTend, and sends the rest to the intake pharmacist in Slack.
The prompt
When a fax comes in on our Documo line, read it with AWS Textract. Check for a signature and ask it for the patient's name and date of birth, the drug, strength, quantity, directions, refills, the prescriber and their NPI, the DEA number, the schedule, the prescriber's fax, the date written and dispense as written. If it's a prescription that is signed on its own page, has every required field, was read with confidence and shows no controlled substance schedule, file it in CareTend Incoming Documents on our Rx review path. Otherwise send it to our intake pharmacist in Slack with what is missing or unclear. Look the prescriber up in CareTend and offer to fax them a request for what's missing, to the fax number in CareTend or to the number the fax came from, showing both when they differ. Never offer to fax about a controlled substance. If the pharmacist sends the request, fax it with a copy of the prescription and file the prescription in CareTend on our held path with a note. The pharmacist can also send it on for Rx review or handle it themselves. Treat any schedule Textract finds, in any format, as a controlled substance. Never change or approve a prescription. If the fax can't be read or came with no file, tell the pharmacist.
FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.
The flow
Inside the loop: Wait for Textract to finish
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
- New fax on Documo Starts when Documo finishes receiving a fax, with its PDF saved. A fax that arrives with no PDF goes to the intake pharmacist in Slack with the reason.
- Start reading the prescription Textract reads every page for signatures and answers questions about the patient's name and birth date, the drug, strength, quantity, directions, refills, the prescriber, NPI, DEA number, schedule, the prescriber's fax, the date written and dispense as written. The flow checks back every 10 seconds for up to 15 minutes, and a fax Textract cannot read or returns an error on goes to the pharmacist.
- Check the prescription Lists every required field that is missing and every answer Textract read with less confidence than your floor. Signature detection only says a signature-like mark is there, so a signature counts only on the page that reads as the prescription. No signature there, an unclear one, or more than one prescription page is listed too, so the pharmacist checks each one. Any schedule answer from Textract, or a schedule printed as C-II, CII, Sched. II or Schedule: 2, marks it as a controlled substance. A fax with almost no readable text goes to the pharmacist, and one that is plainly not a prescription ends the run.
- File it for Rx review in CareTend A prescription that is signed on its own page, complete, read with confidence and shows no schedule goes into CareTend Incoming Documents on your Rx review path in the SPRx workflow group, with a note on what was checked.
- Find the prescriber in CareTend Anything else first looks up the prescriber by name in CareTend Search Persons. A fax number is taken only when exactly one person with that name has one.
- Ask the intake pharmacist The pharmacist gets the patient, drug, what is missing or unclear, everything Textract read and a link to the fax, with the request the flow would fax. The buttons send it for Rx review, fax the request to the number in CareTend or to the number the fax came from, or leave it to the pharmacist. A controlled substance gets no fax buttons, only a note to contact the prescriber directly.
- Wait for the pharmacist's answer The run waits for the click and takes a fresh copy of the fax from Documo. File it for Rx review sends it to your Rx review path. I'll handle it ends the run.
- Fax the prescriber what is missing Faxes the prescriber the request with a cover page and a copy of the prescription, then files the prescription in CareTend on your held path with a note of who was faxed, when and for what. If Documo or CareTend refuses a step, the pharmacist gets the reason 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.
- Enter your Documo API key, your CareTend Integration Hub client ID and secret, and an AWS access key, secret and region for Textract with a Staging S3 Bucket in that region, and connect your Slack account. The AWS key needs s3:PutObject and s3:GetObject on the bucket. Add a lifecycle rule that expires objects under flowrunner-textract/, because the staged faxes are not deleted.
- Set the flow settings: CareTend company ID to the company the prescriptions belong to, Rx review path and Held prescriptions path to the names of your CareTend Incoming Document Paths, Pharmacy name to the name the request fax is sent from, and Confidence floor to the Textract confidence, from 0 to 100, below which an answer goes to the pharmacist. It starts at 90.
- Copy the URL of the block Wait for the pharmacist's answer into the flow setting Answer link. The Slack buttons open it.
- Pick the intake pharmacist's channel in Ask the intake pharmacist, Tell the pharmacist: fax not read and Tell the pharmacist: not done. Pick your prescription fax number in New fax on Documo if the account has more than one.