Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % simptopmi
- symptom(flu, fever).
- symptom(flu, cough).
- symptom(flu, sore_throat).
- symptom(cold, runny_nose).
- symptom(cold, sneezing).
- symptom(pneumonia, chest_pain).
- symptom(pneumonia, difficulty_breathing).
- symptom(pneumonia, persistent_cough).
- symptom(diabetes, increased_thirst).
- symptom(diabetes, blurry_vision).
- symptom(heart_disease, chest_discomfort).
- symptom(heart_disease, shortness_of_breath).
- % info za pacienti i riskovi faktori
- patient(john, fever).
- patient(john, cough).
- patient(john, sore_throat).
- patient(peter, increased_thirst).
- patient(peter, blurry_vision).
- patient(alice, fever).
- patient(alice, cough).
- patient(alice, sore_throat).
- patient(bob, chest_pain).
- patient(bob, difficulty_breathing).
- patient(bob, persistent_cough).
- patient(eva, chest_discomfort).
- patient(eva, shortness_of_breath).
- patient(tom, increased_thirst).
- patient(tom, blurry_vision).
- patient(mary, none). % bez simptomi
- % hroni4ni zabolqvaniq
- has_chronic_condition(john, heart_disease).
- has_chronic_condition(mary, none).
- has_chronic_condition(peter, diabetes).
- has_chronic_condition(alice, none).
- has_chronic_condition(bob, none).
- has_chronic_condition(eva, heart_disease).
- has_chronic_condition(tom, diabetes).
- % nasledstveni
- family_history(john, diabetes).
- family_history(peter, heart_disease).
- family_history(alice, none).
- family_history(bob, none).
- family_history(eva, none).
- family_history(tom, none).
- % le4eniq na zabolqvaniq
- treatment(flu, rest).
- treatment(cold, rest).
- treatment(pneumonia, antibiotics).
- treatment(diabetes, insulin).
- treatment(heart_disease, surgery).
- age_group(john, adult).
- age_group(mary, child).
- age_group(peter, senior).
- age_group(alice, adult).
- age_group(bob, adult).
- age_group(eva, senior).
- age_group(tom, adult).
- %proverka za simp pri pacienti
- has_disease(Patient, Disease) :-
- patient(Patient, Symptom),
- symptom(Disease, Symptom).
- % proverka za riskovi faktori
- has_risk_factor(Patient, heart_disease) :-
- has_chronic_condition(Patient, heart_disease).
- has_risk_factor(Patient, heart_disease) :-
- age_group(Patient, senior).
- has_risk_factor(Patient, Disease) :-
- family_history(Patient, Disease).
- has_risk_factor(Patient, Disease) :-
- has_chronic_condition(Patient, Disease).
- diagnose(Patient, pneumonia) :-
- has_disease(Patient, pneumonia),
- ( patient(Patient, chest_pain) ; patient(Patient, difficulty_breathing) ; patient(Patient, persistent_cough) ),
- format("Пациентът ~w има болест pneumonia и има рискови фактори.\n", [Patient]),
- !.
- diagnose(Patient, heart_disease) :-
- has_disease(Patient, heart_disease),
- ( patient(Patient, chest_discomfort) ; patient(Patient, shortness_of_breath) ),
- format("Пациентът ~w има болест heart_disease и има рискови фактори.\n", [Patient]),
- !.
- diagnose(Patient, flu) :-
- has_disease(Patient, flu),
- format("Пациентът ~w има болест flu и има рискови фактори.\n", [Patient]),
- !.
- diagnose(Patient, diabetes) :-
- has_disease(Patient, diabetes),
- format("Пациентът ~w има болест diabetes и има рискови фактори.\n", [Patient]),
- !.
- recommend_treatment(Patient) :-
- has_chronic_condition(Patient, heart_disease),
- treatment(heart_disease, Treatment),
- format("Препоръчва се лечение с: ~w за заболяването heart_disease\n", [Treatment]),
- !.
- recommend_treatment(Patient) :-
- has_disease(Patient, pneumonia),
- treatment(pneumonia, Treatment),
- format("Препоръчва се лечение с: ~w за заболяването pneumonia\n", [Treatment]),
- !.
- recommend_treatment(Patient) :-
- has_disease(Patient, flu),
- treatment(flu, Treatment),
- format("Препоръчва се лечение с: ~w за заболяването flu\n", [Treatment]),
- !.
- recommend_treatment(Patient) :-
- has_disease(Patient, diabetes),
- treatment(diabetes, Treatment),
- format("Препоръчва се лечение с: ~w за заболяването diabetes\n", [Treatment]).
- recommend_treatment(mary) :-
- format("Препоръчва се общо лечение като превенция за здравето на пациента ~w.\n", [mary]).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement