Medical Expert System for Telemedicine
Medical Expert System for Telemedicine
Currently, hospitals and medical practices have a large amount of unstructured information,
gathered in time at each ward or practice by physicians in a wide range of medical branches.
The data requires processing in order to be able to extract relevant information, which can be
used to improve the medical system. It is useful for a physician to have access to a patient's
entire medical history when he or she is in an emergency situation, as relevant information can
be found about the patient's problems such as: allergies to various medications, personal history,
or hereditary collateral conditions etc. If the information exists in a structured form, the
detection of diseases based on specific symptoms is much easier, faster and with a higher degree
of accuracy. Thus, physicians may investigate certain pathological profiles and conduct cohort
clinical trials, including comparing the profile of a particular patient with other similar profiles
that already have a confirmed diagnosis. Involving information technology in this field will
change so the time which the physicians should spend in front of the computer into a much
more beneficial one, providing them with the possibility for more interaction with the patient
while listening to the patient’s needs. The expert system, described in the paper, is an
application for medical diagnostic of the most frequently met conditions, based on logical
programming and on the theory of probabilities. The system rationale is a search item in the
field basic knowledge on the condition. The web application described in the paper is
implemented for the ward of pathological anatomy of a hospital in Romania. It aims to ease the
healthcare staff’s work, to create a connection of communication at one click between the
necessary wards and to reduce the time lost with bureaucratic proceedings. The software (made
in PHP programming language, by writing directly in the source code) is developed in order to
ease the healthcare staff’s activity, being created in a simpler and as elegant way as possible.
Keywords: - expert system; database; algorithms; statistics; efficiency; flexibility.
1. Introduction
Telemedicine consists of the remote communication of healthcare services, based on the use
of information and communication technology, in cases where the healthcare professional and
the patient (two or more healthcare professionals) are in different locations. Using the digital
transformation of the gathered medical information, as described in the paper, the specified
technology allows decoding in necessary formats (image, text, sound) on the patient's condition,
diagnosis and treatment, and tracking its evolution. These services of consultation, monitoring,
digital transmission of information for the purpose of specialized interpretation of symptoms are
basically telemedicine. In the context of the strategic approach to pandemics (social distancing)
this technology is crucial due to the safety and efficiency of data communication, recommended
by the World Health Organization and taken over in Romanian legislation on strengthening the
health system in the pandemic context triggered by COVID-19.
It is recommended to use a dedicated application for medical practice (so that data can be
recorded simultaneously in both the file and the registry) or a dedicated platform for
telemedicine that can ensure the registration, for a period of time, both for the patient and for the
physician of the content of the consultation and data security.
Expert systems based on production rules use a knowledge called expertise from human experts
in a field, healthcare experts in this case, and the process of obtaining this information is called
the acquisition of knowledge. In other words, expert systems multiply and make explicit the
professional experience of human experts [1, 2]. The reasoning of the system is based on the
search for disease in the space of basic knowledge. In order to build the knowledge database,
more interviews with the medical expert are needed [3,4]. Over time, a multitude of expert
systems in the medical field have been implemented (the best known being MYCIN (backward
chaining expert system that used artificial intelligence to identify bacteria causing severe
infections, such as bacteraemia and meningitis – diagnostic of the bacterial infections [5]),
however each having its set of rules. The processing power of these systems consists in the
inferential engine and the explanation system they have. The basic activity of the expert system
is the diagnosis and refers to the establishment of a correlation between characteristics or
symptoms and typical situations.
One benefit of medical databases in electronic format is that data can be kept secure without
deteriorating over time [6,7]. Also, extracting the information is much easier, the user having
access to all the information without wasting time searching through the patients' files. Medical
databases show various problems that arise and can affect the accuracy of reports. These need to
be solved quickly, so that physicians can use the application correctly to help them keep track of
patients, so that the reports they have to issue are accurate and error-free. Because the database
is used by multiple people, the used terms differ from person to person, so this issue needs to be
addressed [8].
The software developed in the paper is based on the management of medical records for at
least two wards and comprises the following characteristics [9]: adding in the database the
patients who were sent to the related wards, entering the personal and medical data of the
patients in the database, viewing the patients registered in the database, modifying the personal
and medical data of the patients, creating the forms for printing (medical bulletins) along with
all personal and medical information, searching the patients’ database by name, date or a certain
period of time, managing the access accounts of healthcare professionals, backing up the
database with a single direct click from the web application, manipulating the access level of
healthcare professionals in the web application.
All the above features are managed extremely easily, in a simple and compact way, with the
help of the web application. The web application uses a MySQL database and is run on an
Apache server. Programming is done with the programming language PHP [10], the code which
the Apache server generates, being HTML (HyperText Markup Language) alongside with the
following programming languages CSS (Cascading Style Sheets) and JavaScript [11]. The
commands line writing was carried out with Adobe Dreamweaver CS4, and the code viewing
can be achieved with any text editor (Notepad, Wordpad). The application was developed with
the help of CodeIgniter [12] framework, being an open source that required considerably to the
creation of the application for fast development. The application was run on most browsers:
Google Chrome, Mozilla Firefox, Internet Explorer, Safari and Opera. It behaved exemplary on
all of them and did not suffer changes in appearance, deficiencies on the part of CSS being
nonexistent. The application was made and also tested on a computer with the Microsoft
Windows operating system.
Telemedicine can help improve the quality of life of people, both patients and healthcare
professionals, by providing the opportunity to respond to the challenges facing the health
system. This facilitates access to specialized treatment in areas where there are not enough
specialists or where access to healthcare services is difficult. Telemedicine cannot replace a
classic medical examination, but it can play the role of a preliminary medical consultation,
having multiple benefits for both the patient and the health professionals.
Figure 2. “Enter_diseases” Form. Legend: Numele bolii – Disease name, Probabilitatea initiala
– Initial Probability, Gripa – Flu, Raceala – Cold/ Influenza, Sanatos – Healthy, Adauga in lista
– Add in the list, Sterge – Delete.
The initial probabilities are calculated with the relation:
Ei
P(Ei ) , (1) n
where P(Ei) represents the initial probability of the disease, n represents the total number of
patients who have come to the consultation so far, and Ei (|Ei| ) is the number of patients having
the Ei, disease.
The form "Enter_symptoms" allows you to enter and delete symptoms relevant to diseases
introduced by the form "Enter_diseases” (Fig.3).
P(S j / Ei ) Ei , (2)
where P(Sj/Ei) represents the probability of the symptom Sj occurring related to the disease Ei,
event, and Ei S j is the number of patients who, have the disease Ei event, showed the Sj
symptom.
Gathering knowledge in the knowledge database is performed in two ways: manually - through
the menu "Add diseases&symptoms" and automatically - by recalculating the initial probability
after the end of the diagnostic operation (learning process or "experience"). The fact base
represents the auxiliary memory that contains all the user data (the symptoms that the patient
has when he presents to the consultation) and the intermediate results (probable diseases after
the first interrogation) produced by the course of reasoning. The inferential engine uses both the
knowledge database and the facts database and using Bayes theory calculates the posterior
(conditioned) probabilities when new symptoms are known. The relation implemented in the
program relies on the statistic independent of the Sj symptoms for an Ei given disease:
Figure 5. Tables fields and relations between tables. Legend: cod boala- disease code, boala –
disease, cod_simptoma – code_symptom
The database work was carried out using activeX (ADO) data objects, which is an extension of
active server page programming, supported by Microsoft's Internet Information Server (IIS) for
database connectivity. ADOConnection is the object through which the connection to the
database was made using "Jet OLEDB4" drivers. TADOTable is used to access a database table
using ADO. TADOTable allows direct access to each record and field in the attached table.
TDataSource achieves the interface between the dataset component and the data controls on the
form. TDataSet introduces the basic properties, events, and methods for working with data. The
expert system allows the creation of a report that will include the date of the examination, the
patient's name, the diagnosis, a report that can be printed. The TRvProject class allows access to
the visual report created with Rave. Rave Reports is an application built into the Delphi software
development environment (visual programming in Pascal) that allows you to create reports.
Delphi is a RAD (Rapid Application Development) and at the same time a database-oriented
application development environment for Microsoft Windows operating systems. It contains
simple design visual tools for creating from the simplest to the most complex highly customized
reports.
In other words, although it provides extremely important information, the expert system,
depending on the good delimitation of the accused symptoms (presented by the patient), may
have an ascending efficiency in the case of diagnosis of influenza (cold) vs. Covid19 or other
type of respiratory virus.
Both the physician and the patient must ensure data protection and patients must be informed
about the limits of remote consultation and the need to call the practice or 112, a unique
emergency number, in case of change or worsening of symptoms.
The probabilities of symptoms in the above diseases were
obtained using the information from the physician (expert)
E1S1 (covid_19)(cough)31patients
P(cough / cov id _19) 0.(93) .
The knowledge base was loaded with the four relevant diseases and thirteen symptoms [19]:
cough, headache, sore throat, chest pain (thoracic pain or pressure), itchy skin (skin irritation),
eye pain and tearing (conjunctivitis), muscle aches, dry throat, loss of taste or smell, stuffy nose,
fever, strong cough and well felt, associated with disease. The probabilities of these symptoms
occurrence in the disease were also introduced. Thus, the diagnosis process could be started.
The symptoms claimed by the patient (based on the facts) were introduced with the option "Ask
the patient": "headache", "chest pain", "eye pain and tearing" and the request for diagnosis was
launched (Fig.6).
Figure 6. Diagnosis with the option “Ask the patient”. Legend: Alegeti simptoma – Choose the
symptom, Febra – fever, Durere in piept – Chest pain, Durere ocular si lacrimare – Eye pain and
tearing, Tipul consultatiei – Type of consultation, Intreaba pacientul – Ask the patient,
Automata – Automatic, Cele mai probabile boli – Most probable diseases, Gripa – Flu, Raceala
obisnuita – Common influenza (cold), Sanatos - Healthy
For a more accurate diagnosis, continue the process using the automatic option. It offers two
symptoms: "strong cough" and "itchy skin". After a consultation, it was found that the patient
has symptoms of "strong cough", but no symptoms of "skin irritation" (the result of the
diagnosis - see Fig.7). It is observed that, after the addition of symptoms, the difference in
probability between the flu and the other diseases has increased, so the error in making the
diagnosis is smaller..
Health professionals, the elderly and people with comorbidities have a high risk of COVID-19
infection. Telemedicine can help reduce this risk by minimizing faceto-face interactions, where
remote medical consultations are possible.
The patient_hp table represents the patient data transferred to the histopathology ward and is
managed by the "[Link]" page by the staff related to the access level in question. In addition
to the fields with personal information, there are some fields essential to the medical practice
that are required to make the histopathological result such as: biopsies, operations,
hospitalizations, sent by (which physician sent the person to the ward), data_send, diag_clin,
lesion code and so on). The "result" field represents the balance of all the patient's exams,
representing the diagnosis on the histopathology ward. The patient_bio table is similar to the
patient_hp table and represents the data of the patient transferred to the biochemistry ward
which is managed by the "[Link]" page by the staff related to the access level in question. In
addition to the fields with personal information there are some fields essential to the medical
practice that are needed to make the biochemical result such as: hpv, hsv, am_various, mss,
specific, unit, etc. The "status_result" field represents the balance of all patient’s exams,
representing the diagnosis on the biochemistry ward.
The patient hp table represents the patient data transferred to the histopathology ward and is
managed by the "[Link]" page by the staff related to the access level in question. In addition
to the fields with personal information, there are some fields essential to the medical practice
that are required to make the histopathological result such as: biopsies, operations,
hospitalizations, sent by (which physician sent the person to the ward), data_send, diag_clin,
lesion code and so on). The "result" field represents the balance of all the patient's exams,
representing the diagnosis on the histopathology ward. The patient_bio table is similar to the
patient_hp table and represents the data of the patient transferred to the biochemistry ward
which is managed by the "[Link]" page by the staff related to the access level in question. In
addition to the fields with personal information there are some fields essential to the medical
practice that are needed to make the biochemical result such as: hpv, hsv, am_various, mss,
specific, unit, etc. The "status_result" field represents the balance of all patient’s exams,
representing the diagnosis on the biochemistry ward.
We find in the Content section the content of each entry on the accessed menu, but also
information on patients, accounts and medical reports. Being an online application that is made
in php, it uses session variables ($ _Session) to manage information between pages. At the same
time, the connection to the database in MySQL must be performed. All files that are connected
to the MySQL database are used by the “[Link]” file.
The "slidebar" section defines the actual menu of the application, which is dynamic and divided
according to the access rights that the user has. The software manages the database of two
medical practices in a hospital, respectively, the histopathology ward and the biochemistry
ward. The menu is divided into two categories: physician (chief physician), physician and nurse,
and in terms of source code in levels 3, 2 and 1. Each login of one of these users gives the right
to access only certain tabs from the menu. The physician, level 3, has access to both medical
practices and has the right to manage the entire application resulting from: general information,
viewing, adding, deleting and editing patients in the ward of histopathology and biochemistry,
printing medical records of patients in the ward of histopathology and biochemistry, viewing,
adding, deleting and editing the medical staff that has access to the web application, backing up
databases. The physician level 2 is catalogued on a single medical unit, having access to only
one of the wards, either histopathology or biochemistry and has the following rights: general
information, viewing, adding, deleting and editing patients in the ward, printing medical records
of patients in the related department. The nurse, level 1, just like the physician, is catalogued on
a single medical unit, but has access only in one of the wards (histopathology or biochemistry)
and has the following rights: general information, viewing patients in the related department,
printing medical records of patients in the related department. Total access to this menu has only
level 2 (physician), some of the tabs being restricted to level 3 chief physician and level 1 nurse.
The physician has access to the entire menu developed in the web application and manages the
smooth running of the activity of his subordinate staff. (Fig.10).
The Dashboard tab represents the input content in the web application (Fig.11). Here, there are
inserted the administrative data that must be taken into account when altering the information in
the web application.
Figure 11. Dashboard section.
The add_patient subtab is based on a form like a table where the personal and medical data of
the patient in question must be entered (Fig.12). Once the function validation rules have been
created and the fields with the variable "required" are inserted, the "date_time" libraries must be
loaded for the date, time when the form is performed and patient_model (patient's medical data).
Figure 12. Subtab add patient, for the histopathology practice. Legend: Adauga pacient – Add
patient, Buletin histopatologic nr. – Histopathology report no, din data de – of, date personale –
personal data, nume – surname, prenume – first name, varsta/ CNP – age/ Personal number,
Adresa – Address, date pacient/ proba – Patient data / sample, Internat/ Consultat la –
Hospitalised/ Consultation at, trimis de – sent by, la data de – on, cu diagnostic clinic – with
clinical diagnosis, material trimis – sent sample, nr. blocuri – no of blocks, nr. lame – no of
blades, cod leziune – lesion code, Rezultat
HP – HP result
The view patient subtab is based on a form with all the entries filled in by the physician in the
MySQL database (Fig.13).
Figure 13. Subtab view patient, for the histopathology practice. Legend: Pacient histopatologie
– Histopathology patient, Cauta dupa NUME si/ sau PRENUME sau DATA – Search by
SURNAME and/ or FIRST NAME or DATE, CAUTA – SEARCH,
Total pacienti – Total patients.
All this data is viewed in the web application using the files: "print_all.php", "[Link]" and
"mod_pacient.php", located in the "views" folder. A form is created in the form of a table with
all the fields and patient information, ready to be modified and saved by the application user
(Fig.14).
Figure 14. Change patient. Legend: Modifica pacient histopatologie – Change patient
histopathology, Buletin histopatologic nr. – Histopathology report no, din data de – of, date
personale – personal data, nume – surname, prenume – first name, varsta/ CNP – age/ Personal
number, Adresa – Address, date pacient/ proba – Patient data / sample, Internat/ Consultat la –
Hospitalised/ Consultation at, trimis de – sent by, la data de – on, cu diagnostic clinic – with
clinical diagnosis, material trimis – sent sample, nr. blocuri – no of blocks, nr. lame – no of
blades, cod leziune – lesion code, Rezultat
HP – HP result
The patient_bio tab makes it easy to add, view, delete, edit and print personal and medical data
of patients in the biochemistry office. The add patient subtab is based on a form likely to a table
where the personal and medical data of the patient in question must be entered (Fig.15). The
only changes are the visual ones (other medical notions, fields with other elements that can
exemplify the patient's problems, medical problems) and of course the file names in the
"controllers", "models" and “view" folders and the names of the functions, generally in instead
of the prefix or affix "histo" was used "bio".
Figure 15. Subtab add pacient, for the biochemistry practice. Legend: Adauga pacient Cito –
Add patient cytology, Buletin citologic cervico-vaginal nr. – Cytology report cervical-vaginal
no, din data de – of, date personale – personal data, nume – surname, prenume – first name,
varsta/ CNP – age/ Personal number, Adresa – Address, Trimis de – Sent by, Diagnostic clinic –
Clinical diagnosis, Teste PAP anterioare - Previous PAP tests, Calitate frotiu – Smear quality,
Frotiu satisfacator – Satisfactory smear, Frotiu nesatisfacator – Unsatisfactory smear, acelular –
no cell, hipocelular – hypo-cellular, fixat necorespunzator – inadequate fixation, intins
necorespunzator – inadequate stretch The subtab view patient relies on a form with all the
entries filled in by the physician in the Mysql database, being from the point of view of the
source code almost identical to the one in the subtab view patient of the tab patient histo
(Fig.16).
Figure 16. Subtab view patient, for the histopathology practice. Legend: Pacient examen
citologic – Cytology exam patient, Cauta dupa NUME si/ sau PRENUME sau DATA – Search
by SURNAME and/ or FIRST NAME or DATE, CAUTA – SEARCH,
Total pacienti – Total patients.
The print tab is an easier way for medical staff to manage patients' medical reports (Fig.17).
Medical records can be extracted from the database as a form, ready to be printed in two ways:
after the current date or another date and for a period of days, months or years.
Figure 17. Subtab Print per day/period bio. Legend: Pacient histo – Histopathology patient,
Pacient cito – Cytology patient, Print – Print, Print pe zi/ perioada Histo – Histo print by day/
period, Print pe zi/ perioada Cito – Cytology print per day/ period, utilizatori – users, Cauta
dupa data curenta sau o alta data: Search by current date or another one, Cauta pacienti intre
data START – Search patients
between START date, Data STOP – STOP date
In both medical practices the algorithms and functions are identical, the differences being in
shape, the names of folders, files and functions.
The users tab represents the users (medical staff) that are inserted in the MySql database of the
web application. This tab is only accessible for access level 2, which is the physician. For the
rest of the medical staff, respectively the rest of the users, the access is restricted. The users tab
consists of two subtabs: add user (adding medical staff) and view user (a form as a table that
consists of medical staff inserted in the MySql database of the web application). The user add
subtab shows the same procedures for creating, communicating with the database and viewing
information in the application (Fig.18).
Figure 18. Subtab add, for the biochemistry practice. Legend: Pacient histo – Histopathology
patient, Pacient cito – Cytology patient, Print – Print, utilizatori – users, add utilizator – add
user, vizualizare utilizatori – view users, Adauga utilizator – add user, email – e-mail, parola –
password, confirma parola – confirm password, Numele – Surname, Prenumele – First name.
The view user subtab was also developed under the same style (Fig.19). Like any MySQL
database, it needs to be archived and backed up regularly. The backup tab is the possibility to
copy the entire MySQL database of the web application. The purpose of the copy is to prevent a
disaster in the event of a server failure or mismanagement of information or even loss of
information. The functionality of the backup is given by a simple gesture, respectively the
operation of the left mouse on the [Link] subtab (Fig.20). When this is done, a window will
appear to perform the save operation in a file named "[Link]".
3.3 Discussions
The advantages of using software in manipulating histological and biochemical data of patients
are costeffective, safe, simple and quick.
Biochemistry deals with the study of the chemistry of organisms at the molecular level, and with
the help of histology we study cellular morphological aspects (Fig. 21: structure of nuclear
chromatin, changes in cytoplasm homogeneity, appearance of cell organelles, etc.), which occur
in various inflammatory or neoplastic pathological processes.
.
a) b) c)
d) e) f)
Figure 21. Cellular morphological aspects – tests that will be comprised in the application
database: a) Granular tumour - ovary, b) Infiltrative ductal carcinoma - breast, c) Gastric Signet
ring carcinoma d) Gastric tumour - gastric carcinoma in "Singnet ring", e) Diffuse gastric
carcinoma, f) Tubular adenocarcinoma, moderately differentiated, G2- colon.
There can be identified on smears commensal or pathogenic microorganisms, but also the local
effect, resulting from the induction of an acute or chronic immune response. Biochemical
examination is performed on cells harvested by specific techniques. Biochemical methods can
be used as a test:
- diagnosis – in case of suspicion of an inflammatory or neoplastic pathology,
- screening – to identify the occurrence of precursor changes in people at high risk of
developing certain pathologies. In the future, the development of the application is also
considered for the inclusion of cell pictures in jpeg format, so that the chief physician (level 2)
and the physician have access to this information. (level 3).
4. Conclusions
Currently, in the context of the covid pandemic 19, increasing the knowledge of telemedicine
experts is an objective necessity. However, telemedicine is not entirely a solution to the current
crisis, but it has every chance of becoming one of the lasting "consequences" of this pandemic.
Expert systems are able to respond in a reasonable time, at a level of competence with that of a
physician, to problems related to symptomatology, drawing conclusions related to diagnosis.
Thus, the consultation of a patient can be initiated, providing the diagnosis with the highest
probability (as close as possible to 1). The application is in line with modern methods of making
intelligent software tools for achieving medical diagnostic problems. Expert systems can be
used by family and outpatient physicians as an assistant in diagnosing general medicine. In
addition to the diagnosis, the application creates a "patient record" for each consulted patient.
With consulted each patient, the knowledge database will be enriched, so the expert system will
gain experience. The expert system can access the knowledge database stored on a server
connected to the network, but with only one user at a time. It can be developed in a multi-user
system for
networking, by storing the main software on a server and accessing it from different client
terminals.
The second application can bring a real benefit to the medical staff and also to the patient,
because it considerably reduces the time lost on a bureaucratic level and focuses on the most
important thing, the patient's health. Such a system should be implemented in every medical
institution, in order to increase the development of healthcare. The web application can be
managed by a person without programming knowledge. All the features mentioned in paragraph
3 are entered in the MySQL database and do not require further modification. The development
possibilities on the web application can be the following: the addition of more medical practices
in the hospital institution (for a better communication between the related wards), the
implementation of a management system on a larger scale, allowing the transfer of patients from
one institution hospital to another, notifying the patient by e-mail about the results of more
complex performed tests.
References
[1] M.C. Popescu, Artificial intelligence, Reprographics of the University of Tg. Jiu (in
Romanian), 1999.
[2] L. Zhou, M. Sordo, Expert systems in medicine, Artificial Intelligence in Medicine,
Technical Basis and Clinical Applications, p.75-100, 2021.
[5] L.M. Fagan, E.H. Shortliffe, B.G. Buchanan, Computer-based medical decision making:
from MYCIN to VM, Automedica, Vol.3, p.97-106, 1980.
[6] S. Allier, O. Barais, B. Baudry, J. Bourcier, Multitier Diversification in Web-Based
Software Applications, IEEE Software, Vol. 32(1), p.83–90, 2015.
[7] K.F. Braekkan Payne, H. Wharrad, K. Watts, Smartphone and medical related App use
among medical students and junior physician s in the United Kingdom: a regional survey,
BMC Medical Informatics and Decision Making, p.1-11, 2012.
[8] P. Sherman, Usability success stories: How organizations improve by making easier-to-use
software and web sites, Taylor&Francis, 1st Edition, London, 2007.
[17] Y.R. Yue, M.A. Lindquist, J.M. Loh, Meta-Analysis of functional neuroimaging data using
Bayesian nonparametric binary regression, The Annals of Applied Statistics, Vol. 6(2),
p.697–718, 2012.
[18] S.M. Fakhrahmad, M.H. Sadreddini, J.M. Zolghadri, A proposed expert system for word
sense disambiguation: Deductive ambiguity resolution based on data mining and forward
chaining, Expert Systems,Vol.32(2), p.178–191, 2015.
[19] F.M. Salman, S.S. Abu-Naser, Expert System for COVID19 Diagnosis, International
Journal of Academic Information Systems Research. Vol.4(3), p.1-13, 2020.
[20] R. Braniscan, M.C. Popescu, A. Naji, Secure PHP Open SSL Crypto Online Tool,
International Journal of Advances in Computer Networks and ITS Security, Vol.5(2) NY,
USA, p.108-112, 2015.