A Rule-Based Expert System developed in Prolog to assist small or rural clinics in determining whether a patient should be referred to a doctor or advised with home remedies based on their symptoms.
The system simulates clinical reasoning using IF–THEN rules, enabling non-medical staff to make quick and informed triage decisions.
This project presents a rule-based expert system designed to support small or rural healthcare clinics where access to doctors or diagnostic equipment may be limited.
It applies rule-based reasoning to mimic basic clinical decision-making by asking a series of yes/no questions about symptoms.
The system:
- Matches user responses to a knowledge base of rules.
- Determines possible illnesses, severity, and advice.
- Provides specialist referral information when necessary.
The Clinic Expert System is intended as a low-cost AI solution that empowers receptionists or community health workers to conduct quick assessments before referring patients to a doctor.
The simulated clinic is a small primary healthcare facility located in an urban residential area of Karachi, Pakistan.
It handles 50–100 patients daily, focusing on common illnesses such as:
- Cold
- Flu
- Allergy
- Food Poisoning
- Minor infections
Referrals are made to larger hospitals like Aga Khan University Hospital for specialized care.
When the program starts, it displays a menu with four options for user interaction where each option serves the following purpose:
- Diagnose a patient – Starts an interactive session where the user answers yes/no questions about symptoms.
- List available conditions – Displays a list of all illnesses defined in the knowledge base.
- List available symptoms – Shows all the symptoms recognized by the system.
- Exit – Ends the program gracefully.
| Component | Description |
|---|---|
| Language | Prolog |
| AI Technique | Rule-Based Reasoning |
| Platform | SWI-Prolog |
- Install SWI-Prolog
- Clone the repository
git clone https://github.com/RameenMughal/RuleBasedHealthAssistant.git
cd RuleBasedHealthAssistant
- Move the
main.plto the Prolog folder in Documents - Load the program in Prolog Platform
?- [main].
- Run the system
?- start.