Patient Service Agent
Agent Description:
This template streamlines the patient journey by extracting raw intake data, applying medical reasoning to assign severity scores, and dynamically routing profiles based on clinical urgency. By integrating with SQL databases for specialty mapping and real-time JSON availability feeds, the agent ensures that patients are matched with the right expertise at the earliest possible time.
- Purpose: This agent is designed to automate and optimize medical clinical
intake by processing patient appointment data, mapping symptoms to the correct
specialists, and coordinating doctor availability. It enables healthcare
providers to prioritize life-critical cases through automated triage while
maintaining a seamless scheduling experience for routine consultations.
The agent improves clinical workflow efficiency by:
-
Standardizing patient intake data (name, age, symptoms) from digital records.
-
Objectively triaging medical urgency using an urgency_factor (1–10 scale).
-
Automating the mapping of patient symptoms to specific medical specialties (for example, Cardiology, Orthopedics).
-
Synchronizing requested dates with real-time doctor availability slots.
-
Generating immediate "Urgent Care" reports for high-priority emergencies to ensure rapid arrival and intervention.
-
- Components:
-
Patient Appointment Reader: Extracts and normalizes patient intake fields from raw API data into a structured tabular format.
-
Severity Triage Node: A medical router that evaluates clinical urgency and directs patients to either priority or standard scheduling paths.
-
Specialist Assignment Agent: Manages routine bookings by querying specialty maps and matching available doctors to requested dates.
-
Priority Assignment Agent: An emergency scheduler that identifies life-critical specialties and finds the absolute earliest available appointment (ASAP).
-
-
Patient record retrieval via API and multi-field JSON normalization
-
Medical symptom analysis and severity scoring (1–10 scale)
-
Conditional workflow branching based on urgency_factor
-
SQL-based mapping of symptoms to medical departments
-
JSON parsing for real-time doctor availability and slot filtering
-
High-priority scheduling overrides for ASAP arrivals
-
Urgent care reporting with immediate arrival instructions
-
OPENAI GPT_4O_MINI for the parent coordinator and all specialized triage and assignment sub-agents.
Note: To learn more about the LLM and to modify its behavior, refer to the Configuring LLM settings section.
Sub-Agents
1. Patient Appointment Reader
- Role: Data Extractor.
-
Scope:Converts JSON patient records into human-readable tabular formats.
- Description:Extracts patient_name, age, symptoms, and appointment_date. Standardizes all date formats and normalizes clinical text before handing the patient table to the triage node.
2. Severity Triage Node
- Role: Medical Router
- Scope:Evaluates clinical urgency to determine the appropriate scheduling path.
- Description:Uses reasoning to assign an urgency_factor. Scores of 5–10 (Priority) are routed for immediate action, while 1–4 (Routine) are routed for standard specialist matching.
3. Specialist Assignment Agent
- Role:Data Reader/Standard Scheduler
- Scope:Assigns routine patients to specialists based on mapping rules and availability.
- Description:Queries the symptom_mapping SQL table to identify the specialty. It then fetches doctor JSON data to find a specialist whose available_slots match the patient's requested date.
4. Priority Assignment Agent
- Role:Emergency Scheduler
- Scope:Fast-tracks critical patients to the absolute earliest medical slot available.
- Description:Identifies life-critical specialties and searches for ASAP availability, potentially overriding requested dates for safety. Produces an "URGENT CARE" report with arrival instructions.
- GET Request Tool– Pulls the main patient intake batch and the real-time doctor_list_patient_service.json availability file.
- SQL Toolkit– Queries the symptom_patient_service.sql database to map specific patient symptoms to medical departments.
-
Ingestion: The Appointment Reader fetches new patient records and standardizes the data.
-
Triage: The Severity Triage Node scans the symptoms. A patient reporting "irregular heartbeat" is assigned an urgency_factor of 9.
-
Path Divergence:
-
Priority Path (Score >= 5): Sent to the Priority Assignment Agent for immediate (ASAP) booking.
-
Routine Path (Score < 5): Sent to the Specialist Assignment Agent to match a doctor for the requested date.
-
-
Final Output: A confirmed appointment report detailing the specialist, assigned doctor, and location.
-
Can you give me the details on the patient Ananya Mehra