Spaces:
Runtime error
Runtime error
| """ | |
| Medical Assistant domain template. | |
| """ | |
| from typing import List | |
| from .base_domain import BaseDomain | |
| class MedicalAssistantDomain(BaseDomain): | |
| """ | |
| Medical assistant domain for health information, | |
| symptom assessment, and medical education. | |
| """ | |
| def __init__(self): | |
| super().__init__() | |
| self._name = "Medical Assistant" | |
| self._description = "Medical information assistant for health education, symptom understanding, medication information, and wellness guidance. NOT a replacement for professional medical advice." | |
| self._icon = "+" | |
| def get_topics(self) -> List[str]: | |
| """Get medical assistant topics""" | |
| return [ | |
| "Common Symptoms and Conditions", | |
| "Medication Information", | |
| "Preventive Care", | |
| "Nutrition and Diet", | |
| "Exercise and Fitness", | |
| "Mental Health", | |
| "Sleep Hygiene", | |
| "Chronic Disease Management", | |
| "First Aid", | |
| "Women's Health", | |
| "Men's Health", | |
| "Pediatric Health", | |
| "Senior Health", | |
| "Vaccination Information", | |
| "Lab Test Interpretation", | |
| "Vital Signs Understanding", | |
| "Disease Prevention", | |
| "Health Screening Guidelines", | |
| "Medication Side Effects", | |
| "Drug Interactions", | |
| "Allergy Management", | |
| "Pain Management", | |
| "Wound Care", | |
| "Diabetes Management", | |
| "Heart Health", | |
| "Respiratory Health", | |
| "Digestive Health", | |
| "Kidney Health", | |
| "Liver Health", | |
| "Bone and Joint Health", | |
| "Skin Conditions", | |
| "Eye Health", | |
| "Dental Health", | |
| "Infectious Diseases", | |
| "Cancer Prevention and Screening", | |
| "Stress Management", | |
| "Substance Abuse", | |
| "Sexual Health", | |
| "Pregnancy and Childbirth", | |
| "Post-operative Care", | |
| "Medical Terminology" | |
| ] | |
| def get_system_prompt(self) -> str: | |
| """Get medical assistant system prompt""" | |
| return """You are a knowledgeable medical information assistant with expertise in: | |
| - General health and wellness | |
| - Common medical conditions and symptoms | |
| - Medication information and interactions | |
| - Preventive care and health screening | |
| - Chronic disease management | |
| - Mental health and wellness | |
| - Nutrition and exercise | |
| - Medical terminology and lab results | |
| Your role is to: | |
| 1. Provide accurate, evidence-based health information | |
| 2. Explain medical concepts in clear, accessible language | |
| 3. Help users understand symptoms, conditions, and treatments | |
| 4. Offer general wellness and preventive care guidance | |
| 5. Explain medication purposes, dosing, and potential side effects | |
| 6. Clarify medical terminology and test results | |
| CRITICAL LIMITATIONS: | |
| - You are NOT a licensed medical professional | |
| - You do NOT diagnose medical conditions | |
| - You do NOT prescribe medications or treatments | |
| - You do NOT provide emergency medical advice | |
| - You ALWAYS recommend consulting healthcare professionals for medical decisions | |
| Guidelines: | |
| - Be informative but never diagnostic | |
| - Emphasize the importance of professional medical care | |
| - For urgent symptoms, recommend immediate medical attention | |
| - Explain when to seek emergency care (911/ER) | |
| - Acknowledge uncertainty and limitations of general information | |
| - Encourage regular check-ups and preventive care | |
| - Respect patient privacy and confidentiality | |
| EMERGENCY DISCLAIMER: For any medical emergency, life-threatening symptoms, or urgent medical concerns, immediately call 911 or go to the nearest emergency room. This assistant provides general health information only and is not a substitute for professional medical advice, diagnosis, or treatment.""" | |
| def get_example_questions(self) -> List[str]: | |
| """Get example medical questions""" | |
| return [ | |
| "What are the common side effects of ibuprofen?", | |
| "How much sleep should adults get each night?", | |
| "What are the warning signs of a heart attack?", | |
| "How can I lower my blood pressure naturally?", | |
| "What vaccines do adults need?", | |
| "What does a high cholesterol reading mean?", | |
| "How do I know if I should go to the ER or urgent care?", | |
| "What are healthy blood sugar levels?", | |
| "How can I manage stress and anxiety?", | |
| "What foods should I eat for better heart health?" | |
| ] | |
| def get_specialized_tools(self) -> List[dict]: | |
| """Get medical assistant tools""" | |
| return [ | |
| { | |
| "name": "lookup_medication_info", | |
| "description": "Get detailed information about medications", | |
| "parameters": { | |
| "medication_name": "string", | |
| "info_type": "string (uses, dosage, side_effects, interactions)" | |
| }, | |
| "returns": "Medication information object" | |
| }, | |
| { | |
| "name": "check_drug_interactions", | |
| "description": "Check for interactions between medications", | |
| "parameters": { | |
| "medications": "list of medication names" | |
| }, | |
| "returns": "List of potential interactions and severity" | |
| }, | |
| { | |
| "name": "interpret_vital_signs", | |
| "description": "Interpret vital sign measurements", | |
| "parameters": { | |
| "vital_type": "string (blood_pressure, heart_rate, temperature, etc.)", | |
| "value": "string or float", | |
| "age": "int", | |
| "context": "string (at_rest, after_exercise, etc.)" | |
| }, | |
| "returns": "Interpretation with normal ranges" | |
| }, | |
| { | |
| "name": "get_symptom_guidance", | |
| "description": "Get guidance on symptom severity and when to seek care", | |
| "parameters": { | |
| "symptoms": "list of symptoms", | |
| "duration": "string", | |
| "severity": "string (mild, moderate, severe)" | |
| }, | |
| "returns": "Care recommendations (self-care, urgent care, ER, etc.)" | |
| }, | |
| { | |
| "name": "calculate_bmi", | |
| "description": "Calculate Body Mass Index", | |
| "parameters": { | |
| "weight_lbs": "float", | |
| "height_inches": "float" | |
| }, | |
| "returns": "BMI value and category" | |
| }, | |
| { | |
| "name": "get_vaccination_schedule", | |
| "description": "Get recommended vaccination schedule", | |
| "parameters": { | |
| "age": "int", | |
| "health_conditions": "list of conditions (optional)" | |
| }, | |
| "returns": "Recommended vaccinations" | |
| } | |
| ] | |