- •Содержание
- •4. Описание реализации прототипа «Мониторинг и диагностика состояния человека, находящегося в коме»
- •4.1 Используемые рабочие пространства
- •4.2. Примеры правил на языке представления знаний g2
- •4.2.1. Мониторинг и диагностика состояния здоровья человека
- •4.2.2. Процедура движения молотка (при проверке реакции человека на боль).
4. Описание реализации прототипа «Мониторинг и диагностика состояния человека, находящегося в коме»
4.1 Используемые рабочие пространства
Используемы рабочие пространства:
CLASSES - рабочее пространство, содержащее объявление объектов и классов.
MESSAGE_BOARD - рабочее пространство, содержащее выводимые системой сообщения.
RULESSS – рабочее пространство, содержащее процедуры, правила.
MODEL – рабочее пространство, где отображается вся динамика процесса работы.
УПРАВЛЕНИЕ – рабочее пространство, содержащее элементы управления процессом работы.
Классы:
MAN_CLASS - класс, содержащий параметры состояния здоровья человека.
BODY_PARAMS_CLASS - класс, содержащий параметры двигательной функции.
EYES_PARAMS_CLASS - класс, содержащий параметры реакции откравания глаз.
VOICE_PARAMS_CLASS - класс, содержащий параметры речевой функции.
ACTIONS_PARAMS_CLASS – класс содержащий все возможные методы лечения человека
COMPUTER_CLASS – класс, соответствующий всему электронному медецинскому оборудованию.
4.2. Примеры правил на языке представления знаний g2
4.2.1. Мониторинг и диагностика состояния здоровья человека
Естественный язык:
Когда давление, температура, глюкоза или пульс получат непустые значения, дать заключение по состоянию здоровья человека
G2:
whenever the pressurei of computer receives a value or the pulsei of computer receives a value or the glucosei of computer receives a value or the tempi of computer receives a value and when the pressurei of computer /= "" and the glucosei of computer /= "" and the tempi of computer /= "" and the pulsei of computer /= "" then start giveConclusionStateMan2 (the phasekoma of man, the pressureint1 of computer, the pressureint2 of computer, the glucoseint of computer, the pulseint of computer, the tempint of computer).
Естественный язык:
Когда атрибут sum у объекта man получит ненулевое значение, дать первичное заключение о состоянии здоровья человека и начать вторичный осмотр.
G2:
whenever the summ of man receives a value and when the eyei of man /= "" and the voicei of man /= "" and the bodyi of man /= "" then start giveConclusionStateMan1 (the summ of man) and start startInspection2().
Процедура лечения человека:
Описание:
В зависимости от заключения совершает лечебное действие.
На языке G2:
startadvicebleaction ()
action: sequence = the action of message;
i: integer = 0;
f: float;
begin
repeat
exit if action[i] = "";
f = action[i+1];
case (action[i]) of
"Глюкоза":
begin
call replacemes("Вводим [f]мл 40% раствора глюкозы");
call goshpric ();
conclude that the glucoseint of computer = the glucoseint of computer - 0.5;
conclude that the glucosei of computer = "Уровень глюкозы: [the glucoseint of computer]";
call replacemes("Уровень глюкозы понизился на 0.5");
end;
"Женьшень":
begin
call replacemes("Даем пациенту [f]капель настойки женшеня");
call gobanochka ();
conclude that the pressureint1 of computer = the pressureint1 of computer + 15;
conclude that the pressureint2 of computer = the pressureint2 of computer + 15;
conclude that the pressurei of computer = "Артериальное давление: [the pressureint1 of computer]/[the pressureint2 of computer]";
call replacemes("");
end;
"Горчичник":
begin
call replacemes("Накладываем пациенту горчичник на правую сторону груди");
call gobanochka ();
conclude that the pulseint of computer = the pulseint of computer - 15;
conclude that the pulsei of computer = "Пульс: [the pulseint of computer] уд/мин";
call replacemes("");
end;
"Шиповник":
begin
call replacemes("Даем пациенту [f]мл настойки шиповника");
call gobanochka ();
conclude that the pressureint1 of computer = the pressureint1 of computer+ 15;
conclude that the pressureint2 of computer = the pressureint2 of computer + 15;
conclude that the pressurei of computer = "Артериальное давление: [the pressureint1 of computer]/[the pressureint2 of computer]";
conclude that the pulseint of computer = the pulseint of computer - 15;
conclude that the pulsei of computer = "Пульс: [the pulseint of computer] уд/мин";
call replacemes("");
call replacemes("");
end;
"Кофе":
begin
call replacemes("Даем пациенту [f] ст. л. кофейных зерен");
call gobanochka ();
conclude that the pressureint1 of computer = the pressureint1 of computer + 15;
conclude that the pressureint2 of computer = the pressureint2 of computer + 15;
conclude that the pressurei of computer = "Артериальное давление: [the pressureint1 of computer]/[the pressureint2 of computer]";
conclude that the pulseint of computer = the pulseint of computer + 20;
conclude that the pulsei of computer = "Пульс: [the pulseint of computer] уд/мин";
conclude that the tempint of computer = the tempint of computer + 1;
conclude that the tempi of computer = "Температура: [the tempint of computer] градусов";
call replacemes("");
end;
"Глицин":
begin
call replacemes("Даем пациенту [f] таблетку глицина");
call gotabletka ();
call replacemes("");
end;
"Пирогенал":
begin
call replacemes("Вводим пациенту [f]мпд пирогенала");
call goshpric ();
conclude that the tempint of computer = the tempint of computer + 0.7;
conclude that the tempi of computer = "Температура: [the tempint of computer] градусов";
conclude that the pressureint1 of computer = the pressureint1 of computer - 15;
conclude that the pressureint2 of computer = the pressureint2 of computer - 15;
conclude that the pressurei of computer = "Артериальное давление: [the pressureint1 of computer]/[the pressureint2 of computer]";
call replacemes("");
end;
"Кокарбоксилаза":
begin
call replacemes("Вводим пациенту [f]мг кокарбоксилазы");
call goshpric ();
conclude that the pressureint1 of computer = the pressureint1 of computer +15;
conclude that the pressureint2 of computer = the pressureint2 of computer +15;
conclude that the pressurei of computer = "Артериальное давление: [the pressureint1 of computer]/[the pressureint2 of computer]";
call replacemes("");
end;
"Аденозин":
begin
call replacemes("Вводим пациенту [f]мг аденозина");
call goshpric ();
conclude that the pulseint of computer = the pulseint of computer - 15;
conclude that the pulsei of computer = "Пульс: [the pulseint of computer] уд/мин";
call replacemes("");
end;
"Адреналин":
begin
call replacemes("Вводим пациенту [f]мг адреналина");
call goshpric ();
conclude that the pressureint1 of computer = the pressureint1 of computer +25;
conclude that the pressureint2 of computer = the pressureint2 of computer +25;
conclude that the pressurei of computer = "Артериальное давление: [the pressureint1 of computer]/[the pressureint2 of computer]";
conclude that the glucoseint of computer = the glucoseint of computer - 1.5;
conclude that the glucosei of computer = "Уровень глюкозы: [the glucoseint of computer]";
conclude that the pulseint of computer = the pulseint of computer - 20;
conclude that the pulsei of computer = "Пульс: [the pulseint of computer] уд/мин";
conclude that the tempint of computer = the tempint of computer + 8;
conclude that the tempi of computer = "Температура: [the tempint of computer] градусов";
call replacemes("");
end;
"Аскорбиновая кислота" :
begin
call replacemes("Даем пациенту [f]мл раствора 5% аскорбиновой кислоты ");
call gobanochka ();
call replacemes("");
end;
"":
begin
end;
end;
i = i + 2;
wait for 1 second;
end;
end