Medical AI

Matching patients to the right specialist faster

Wrong referrals waste a patient’s weeks and a specialist’s slot. How to match on subspecialty, insurance and location before the referral is sent.

Huzaifa Tahir
7 min read

Getting a referral to the right specialist is harder than it should be. A doctor referring a patient with suspected inflammatory bowel disease has to find a gastroenterologist who ticks five boxes. Takes the patient's insurance. Is accepting new patients. Has a slot soon enough. Has real IBD experience, not just general gastroenterology. And is close enough for the patient to get to.

That search takes time a doctor does not have, so patients often do it themselves. They call around, hit full appointment books, and wait weeks or months to see the right specialist.

OpenClaw lets a referral network offer that matching over WhatsApp or Telegram, which gives both doctors and patients a fast, accurate route to the right specialist.

Setting up OpenClaw for a referral network

curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon

Connect WhatsApp Business for the patient-facing channel and Slack for the network coordinator team. Maintain a structured specialist database (JSON, CSV, or API from the network's scheduling system) that OpenClaw can query.

The patient-facing matching skill

Skill: specialist-match-patient
Trigger: incoming WhatsApp message to the referral network number
Prompt: "A patient (or their primary care doctor's receptionist) is looking for a specialist referral. Collect the following information conversationally:
1. 'What type of specialist are you looking for?' (or what condition, or what the referral letter says)
2. 'What suburb or area are you located in?'
3. 'What health insurance do you have, or are you self-paying?'
4. 'How urgent is this referral. Routine (within 3 months), semi-urgent (within 4 weeks), or urgent (within 1 week)?'
5. 'Is there anything else specific about what you are looking for. For example, a female doctor, telehealth option, or experience with a particular condition?'

Then search the specialist database for matches. Return the top 3 matches with: specialist name, clinic name, address, phone number, earliest available appointment, and a direct booking link if available. Format clearly for WhatsApp reading. If no match within their criteria, widen the radius and note this.

End with: 'Would you like me to send your referral details to the specialist's booking team so they can contact you directly?'"

The referral tool for primary care staff

Primary care doctors and their staff can send referral queries via a dedicated Slack integration:

Skill: gp-referral-query
Trigger: message in Slack #referral-requests channel
Format: [Condition] | [Location] | [Insurance] | [Urgency] | [Special requirements]
Example: "Suspected celiac disease | Patient in Mesa AZ | Blue Cross Blue Shield | Semi-urgent | Pediatric patient age 8, needs pediatric gastro"
Prompt: "Search the specialist database for the referring doctor's requirements. Return top 3 matches with full details. If urgency is urgent (within 1 week), also send an email alert directly to the specialist's office flagging an urgent referral incoming. Log the referral query with timestamp and referring practice name."

Waitlist management

When a patient's preferred specialist has no immediate availability, OpenClaw manages the waitlist:

Skill: waitlist-manager
Trigger: patient added to specialist waitlist
Prompt: "Confirm to the patient via WhatsApp that they have been added to [Specialist Name]'s waitlist for an appointment. Send them an estimated wait time and the next available date. Set a check-in reminder at 2 weeks: 'Hi [Name], just checking in on your referral to [Specialist Name]. Your current estimated wait is [X] weeks. If your situation has become more urgent, reply URGENT and we will review options. If you no longer need this appointment, reply CANCEL so we can offer the spot to another patient.'"

Referral confirmation and reminder

Once a specialist appointment is booked, OpenClaw sends the patient a confirmation and reminder:

Skill: referral-confirmation
Trigger: appointment booked in specialist scheduling system (webhook)
Prompt: "Send the patient a WhatsApp confirmation: 'Your appointment with [Specialist Name] is confirmed for [Date] at [Time] at [Clinic Name, Address]. Please bring: your referral letter (we have sent a copy to the specialist), your health insurance card, a list of your current medications, and any relevant test results or scans. Arrive 10 minutes early for paperwork. Reply HELP if you need to reschedule.' Send a 48-hour reminder before the appointment."

What referral networks gain

Referral networks using OpenClaw for patient matching report:

  • Significant reduction in "phone tag" between primary care practices and specialist offices
  • Fewer patients lost in the referral process (a common and underrecognized problem)
  • Better matching, because patients see specialists with the right sub-specialty experience
  • Improved urgent referral pathways with automated escalation

The coordination expertise of the network team is unchanged. OpenClaw handles the information gathering and matching logistics so the team can focus on complex cases that need human judgment.

Share this article

Related Articles