{
  "version": "1.2.0",
  "last_updated": "2026-01-14",
  "authority": "Medical AI Platform",

  "safety_rules": {
    "ai_role": "clinical_decision_support",
    "ai_must_not": [
      "provide diagnosis",
      "prescribe medication",
      "override safety rules",
      "dismiss emergency symptoms",
      "claim certainty"
    ],
    "mandatory_disclaimer": "This system provides AI-assisted information and is not a medical diagnosis.",
    "confidence_thresholds": {
      "minimum_confidence_to_respond": 0.65,
      "below_threshold_action": "ask_more_questions",
      "critical_uncertainty_action": "escalate_to_doctor"
    },
    "red_flag_categories": [
      {
        "category": "cardiac",
        "priority": "critical",
        "symptoms": [
          "Chest Pain",
          "Left Arm Pain",
          "Cold Sweating",
          "Shortness of Breath"
        ],
        "action": "emergency_escalation",
        "message": "Your symptoms may indicate a medical emergency. Please seek immediate medical attention."
      },
      {
        "category": "neurological",
        "priority": "critical",
        "symptoms": [
          "Slurred Speech",
          "Dizziness",
          "Sudden Weakness",
          "Facial Drooping"
        ],
        "action": "emergency_escalation",
        "message": "These symptoms may indicate a neurological emergency. Call emergency services immediately."
      },
      {
        "category": "mental_health",
        "priority": "critical",
        "symptoms": [
          "Suicidal Ideation"
        ],
        "action": "immediate_human_intervention",
        "message": "You are not alone. Please contact local emergency services or a mental health professional immediately."
      }
    ],
    "output_controls": {
      "forbidden_phrases": [
        "you definitely have",
        "this confirms",
        "no need to see a doctor",
        "this is harmless",
        "you will be fine"
      ],
      "required_language": [
        "may be",
        "could indicate",
        "based on available information",
        "requires professional evaluation"
      ]
    },
    "escalation_paths": {
      "emergency_escalation": {
        "stop_ai_response": true,
        "notify_doctor": true,
        "show_emergency_ui": true
      },
      "urgent_doctor_review": {
        "stop_ai_response": false,
        "notify_doctor": true,
        "show_warning_ui": true
      },
      "immediate_human_intervention": {
        "stop_ai_response": true,
        "lock_conversation": true,
        "notify_emergency_contact": true
      }
    },
    "audit_requirements": {
      "log_triggered_rules": true,
      "log_confidence_scores": true,
      "log_escalation_decisions": true,
      "retain_logs_days": 365
    }
  },

  "symptom_normalization": [
    {
  "user_input": ["chest pain", "chest discomfort", "pressure in chest", "tight chest"],
  "normalized_symptom": "Chest Pain",
  "icd10_code": "R07.9",
  "snomed_ct": "29857009",

  "questions": [
    { "content": "When did your chest pain start?" },
    { "content": "Is the pain sharp, dull, or pressure-like?" }
  ],

  "followup_questions_by_condition": {
    "Myocardial Infarction": [
      "Does the pain spread to your left arm, jaw, or back?",
      "Do you feel sweating or nausea with the pain?",
      "Does physical activity make it worse?"
    ],
    "GERD": [
      "Does the pain worsen after eating?",
      "Do you feel burning in your chest?",
      "Does lying down increase the pain?"
    ],
    "Anxiety": [
      "Do you feel palpitations during the episode?",
      "Do symptoms appear during stress?",
      "Does breathing exercises help?"
    ]
  }
},
    {
  "user_input": ["shortness of breath", "difficulty breathing", "trouble breathing", "can't breathe"],
  "normalized_symptom": "Dyspnea",
  "icd10_code": "R06.0",
  "snomed_ct": "267036007",

  "questions": [
    { "content": "When did your breathing difficulty start?" },
    { "content": "Does it occur at rest or during activity?" }
  ],

  "followup_questions_by_condition": {
    "Pneumonia": [
      "Do you have fever or cough with sputum?",
      "Is breathing worse at night?",
      "Do you feel fatigue or chills?"
    ],
    "Asthma": [
      "Do you hear wheezing sounds?",
      "Do symptoms worsen at night or early morning?",
      "Do inhalers help?"
    ],
    "Heart Failure": [
      "Do you feel worse when lying flat?",
      "Do you wake up breathless at night?",
      "Do you have swelling in legs?"
    ]
  }
},
    {
  "user_input": ["headache", "head hurts", "migraine pain", "pain in head","stroke"],
  "normalized_symptom": "Headache",
  "icd10_code": "R51",
  "snomed_ct": "25064002",

  "questions": [
    { "content": "Where is the pain located?" },
    { "content": "Is it pulsating or constant?" }
  ],

  "followup_questions_by_condition": {
    "Migraine": [
      "Do you see visual flashes or aura?",
      "Is there sensitivity to light or sound?",
      "Do you feel nausea with the headache?"
    ],
    "Tension Headache": [
      "Do you feel pressure around the head?",
      "Is stress a trigger?",
      "Does it improve with rest?"
    ],
    "Stroke": [
      "Do you have weakness or speech difficulty?",
      "Did it start suddenly within minutes?",
      "Is there facial drooping?"
    ],
    "headache": [
      "Do you have weakness or speech difficulty?",
      "Did it start suddenly within minutes?",
      "Is there facial drooping?"
    ]
  }
},
    {
      "user_input": [ "fever", "high temperature", "hot body", "elevated temp" ],
      "normalized_symptom": "Fever",
      "icd10_code": "R50.9",
      "snomed_ct": "386661006",
      "questions": [
    { "content": "When did your fever start?" },
    { "content": "How often does it occur?" },
    { "content": "When do you feel the most fever?" },
    { "content": "Where does it occur?" },
    { "content": "What other symptoms do you feel during the fever?" }
  ]
    },
    {
      "user_input": [ "nausea", "feeling sick", "want to vomit", "queasy" ],
      "normalized_symptom": "Nausea",
      "icd10_code": "R11",
      "snomed_ct": "422400008",
      "questions": [
    { "content": "When did your nausea start?" },
    { "content": "Was it sudden or gradual?" },
    { "content": "What events have accompanied it?" },
    { "content": "How often does it occur?" },
    { "content": "When do you feel the most nausea?" }
  
  ]
    },
    {
      "user_input": [ "vomiting", "throwing up", "puking" ],
      "normalized_symptom": "Vomiting",
      "icd10_code": "R11.10",
      "snomed_ct": "422400008",
      "questions": [
    { "content": "When did your vomiting start?" },
    { "content": "Was it sudden or gradual?" },
     { "content": "What other symptoms do you feel during the vomiting?" },
    { "content": "What helps your symptoms?" },
    { "content": "How has your thought process been?" }   
  ]
    },
    {
  "user_input": ["dizziness", "lightheaded", "fainting feeling", "vertigo"],
  "normalized_symptom": "Dizziness",
  "icd10_code": "R42",
  "snomed_ct": "404640003",

  "questions": [
    { "content": "Do you feel spinning or lightheadedness?" },
    { "content": "When does it occur (standing, lying, sudden movement)?" }
  ],

  "followup_questions_by_condition": {
    "Stroke": [
      "Do you have slurred speech or weakness?",
      "Did symptoms start suddenly?",
      "Do you have facial drooping?"
    ],
    "Vertigo (BPPV)": [
      "Does head movement trigger dizziness?",
      "Do you feel spinning sensation?",
      "Does it last seconds or minutes?"
    ],
    "Dehydration": [
      "Have you been drinking enough fluids?",
      "Do you feel dry mouth or fatigue?",
      "Does standing up worsen symptoms?"
    ]
  }
},
    {
      "user_input": [ "slurred speech", "can't speak properly", "mumbled words" ],
      "normalized_symptom": "Slurred Speech",
      "icd10_code": "R47.1",
      "snomed_ct": "419891008",
      "questions": [
    { "content": "When did your slurred speech start?" },
    { "content": "Was it sudden or gradual?" },
    { "content": "What events have accompanied it?" },
    { "content": "How often does it occur?" },
    { "content": "When do you feel the most slurred speech?" }   
  ]
    },
    {
      "user_input": [ "left arm pain", "arm hurts", "pain in left arm" ],
      "normalized_symptom": "Left Arm Pain",
      "icd10_code": "M79.602",
      "snomed_ct": "367336001",
      "questions": [
    { "content": "When did your pain start?" },
    { "content": "Was it sudden or gradual?" },
    { "content": "What events have accompanied it?" },
    { "content": "How often does it occur?" },
    { "content": "When do you feel the most pain?" }
   
  ]
    },
    {
      "user_input": [ "suicidal thoughts", "want to die", "self-harm thoughts", "suicide ideation" ],
      "normalized_symptom": "Suicidal Ideation",
      "icd10_code": "R45.851",
      "snomed_ct": "442587001",
      "questions": [
    { "content": "When did your suicidal start?" },
    { "content": "Was it sudden or gradual?" },
    { "content": "What events have accompanied it?" },
    { "content": "How often does it occur?" },
    { "content": "When do you feel the most suicidal?" }
  ]
    },
    {
  "user_input": ["abdominal pain", "stomach hurts", "pain in stomach"],
  "normalized_symptom": "Abdominal Pain",
  "icd10_code": "R10.9",
  "snomed_ct": "21522001",

  "questions": [
    { "content": "Where exactly is the pain located?" },
    { "content": "Is it sharp, cramping, or burning?" }
  ],

  "followup_questions_by_condition": {
    "Gastroenteritis": [
      "Do you have vomiting or diarrhea?",
      "Did you eat anything unusual recently?",
      "Do you have fever?"
    ],
    "Appendicitis": [
      "Did pain start near belly button and move to right side?",
      "Is pain worsening over time?",
      "Do you feel loss of appetite?"
    ],
    "Acid Reflux": [
      "Does pain worsen after meals?",
      "Do you feel burning sensation?",
      "Does antacid help?"
    ]
  }
},
    {
      "user_input": [ "cough", "persistent cough", "dry cough", "wet cough" ],
      "normalized_symptom": "Cough",
      "icd10_code": "R05",
      "snomed_ct": "49727002",
      "questions": [
    { "content": "When did your cough start?" },
    { "content": "Was it sudden or gradual?" },
    { "content": "What events have accompanied it?" },    
    { "content": "How has your thought process been?" },
    { "content": "How have you been sleeping?" }
    
  ]
    },
    {
      "user_input": [ "fatigue", "tired", "exhausted", "no energy" ],
      "normalized_symptom": "Fatigue",
      "icd10_code": "R53.83",
      "snomed_ct": "84229001",
      "questions": [
    { "content": "When did your exhausted start?" },
    { "content": "Was it sudden or gradual?" }    
  ]
    },
    {
      "user_input": [ "back pain", "lower back hurts", "upper back pain" ],
      "normalized_symptom": "Back Pain",
      "icd10_code": "M54.9",
      "snomed_ct": "279039007",
      "questions": [
    { "content": "When did your pain start?" },
    { "content": "Was it sudden or gradual?" },
    { "content": "What events have accompanied it?" },
    { "content": "How often does it occur?" },
    { "content": "When do you feel the most pain?" }    
  ]
    }
  ],

  "clinical_reasoning": {
    "conditions": [
      {
        "condition_name": "Myocardial Infarction",
        "icd10_code": "I21.9",
        "snomed_ct": "22298006",
        "associated_symptoms": [ "Chest Pain", "Dyspnea", "Sweating", "Nausea" ],
        "severity_score": 10,
        "risk_category": "critical",
        "action": "emergency_escalation",
        "explanation_template": "Symptoms like {symptoms_detected} may indicate a heart attack. Immediate medical attention is required."
      },
      {
        "condition_name": "Stroke",
        "icd10_code": "I63.9",
        "snomed_ct": "230690007",
        "associated_symptoms": [ "Slurred Speech", "Dizziness", "Sudden Weakness", "Facial Drooping" ],
        "severity_score": 10,
        "risk_category": "critical",
        "action": "emergency_escalation",
        "explanation_template": "Detected symptoms {symptoms_detected} may indicate a stroke. Call emergency services immediately."
      },
      {
        "condition_name": "Pneumonia",
        "icd10_code": "J18.9",
        "snomed_ct": "233604007",
        "associated_symptoms": [ "Cough", "Fever", "Shortness of Breath", "Fatigue" ],
        "severity_score": 7,
        "risk_category": "high",
        "action": "urgent_doctor_review",
        "explanation_template": "Symptoms {symptoms_detected} suggest possible pneumonia. Prompt medical evaluation is recommended."
      },
      {
        "condition_name": "Migraine",
        "icd10_code": "G43.9",
        "snomed_ct": "37796009",
        "associated_symptoms": [ "Headache", "Nausea", "Vomiting" ],
        "severity_score": 4,
        "risk_category": "moderate",
        "action": "normal_review",
        "explanation_template": "Symptoms {symptoms_detected} are consistent with migraine. Professional review recommended if persistent."
      },
      {
        "condition_name": "Gastroenteritis",
        "icd10_code": "K52.9",
        "snomed_ct": "62315008",
        "associated_symptoms": [ "Abdominal Pain", "Nausea", "Vomiting", "Fever" ],
        "severity_score": 5,
        "risk_category": "moderate",
        "action": "normal_review",
        "explanation_template": "Symptoms {symptoms_detected} may indicate gastrointestinal infection. Monitor and consult a doctor if severe."
      },
      {
        "condition_name": "Depression with Suicidal Ideation",
        "icd10_code": "F32.3",
        "snomed_ct": "442587001",
        "associated_symptoms": [ "Suicidal Ideation", "Fatigue", "Depressed Mood" ],
        "severity_score": 10,
        "risk_category": "critical",
        "action": "immediate_human_intervention",
        "explanation_template": "Symptoms {symptoms_detected} indicate severe mental health risk. Immediate human intervention required."
      },
      {
        "condition_name": "Common Cold",
        "icd10_code": "J00",
        "snomed_ct": "82272006",
        "associated_symptoms": [ "Cough", "Fatigue", "Mild Fever" ],
        "severity_score": 2,
        "risk_category": "low",
        "action": "normal_review",
        "explanation_template": "Symptoms {symptoms_detected} suggest a common cold. Usually self-limiting; consult a doctor if worsening."
      }
    ],
    "scoring_rules": {
      "severity_scale": {
        "low": [ 1, 3 ],
        "moderate": [ 4, 6 ],
        "high": [ 7, 8 ],
        "critical": [ 9, 10 ]
      },
      "risk_actions": {
        "low": "normal_review",
        "moderate": "normal_review",
        "high": "urgent_doctor_review",
        "critical": "emergency_escalation"
      },
      "matching_algorithm": {
        "type": "weighted_count",
        "weight_per_symptom": 1,
        "score_normalization": true,
        "thresholds": {
          "emergency": 8,
          "urgent": 5,
          "normal": 2
        }
      }
    }
  },

  "medications": [
    {
      "condition_name": "Migraine",
      "informational_drugs": [
        {
          "name": "Acetaminophen",
          "class": "Analgesic",
          "common_dosage": "500-1000 mg every 6-8 hours",
          "usage_notes": "For educational purposes only. Consult a healthcare professional before use.",
          "contraindications": [ "Liver disease" ],
          "source": "https://www.drugs.com/acetaminophen.html"
        },
        {
          "name": "Ibuprofen",
          "class": "NSAID",
          "common_dosage": "200-400 mg every 6-8 hours",
          "usage_notes": "For educational purposes only. Take with food to reduce stomach irritation. Consult a doctor.",
          "contraindications": [ "Peptic ulcer", "Kidney disease" ],
          "source": "https://www.drugs.com/ibuprofen.html"
        }
      ]
    },
    {
      "condition_name": "Fever",
      "informational_drugs": [
        {
          "name": "Acetaminophen",
          "class": "Analgesic",
          "common_dosage": "500-1000 mg every 6-8 hours for adults and 250-500 mg every 6-8 hours for kids",
          "usage_notes": "For educational purposes only. Consult a healthcare professional before use.",
          "contraindications": [ "Liver disease" ],
          "source": "https://www.drugs.com/acetaminophen.html"
        },
        {
          "name": "Ibuprofen",
          "class": "NSAID",
          "common_dosage": "200-400 mg every 6-8 hours",
          "usage_notes": "For educational purposes only. Take with food to reduce stomach irritation. Consult a doctor.",
          "contraindications": [ "Peptic ulcer", "Kidney disease" ],
          "source": "https://www.drugs.com/ibuprofen.html"
        }
      ]
    },
    {
      "condition_name": "Common Cold",
      "condition_code": "J00",
      "informational_drugs": [
        {
          "name": "Pseudoephedrine",
          "class": "Decongestant",
          "common_dosage": "60 mg every 4-6 hours",
          "usage_notes": "Educational use only.",
          "contraindications": [ "Hypertension" ],
          "source": "https://www.drugs.com/pseudoephedrine.html"
        }
      ]
    },
    {
      "condition_name": "Pneumonia",
      "condition_code": "J18.9",
      "informational_drugs": [
        {
          "name": "Amoxicillin",
          "class": "Antibiotic",
          "common_dosage": "500 mg every 8 hours",
          "usage_notes": "Informational only. Only use under physician guidance.",
          "contraindications": [ "Penicillin allergy" ],
          "source": "https://www.drugs.com/amoxicillin.html"
        },
        {
          "name": "Azithromycin",
          "class": "Macrolide Antibiotic",
          "common_dosage": "500 mg on day 1, then 250 mg daily for 4 days",
          "usage_notes": "Informational only. Only use under physician guidance.",
          "contraindications": [ "Macrolide allergy" ],
          "source": "https://www.drugs.com/azithromycin.html"
        }
      ]
    }
  ]
}
