{'fraction_non_alphanumeric': 0.031191774204678765, 'fraction_numerical': 0.010903319301635498, 'mean_word_length': 4.995862639635912, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
COVID-19 knowledge-based system for diagnosis in Iraq using IoT environment

Received May 15, 2020 Revised Jul 14, 2020 Accepted Aug 1, 2020 The importance and benefits of healthcare mobile applications is increasing rapidly, especially when such applications are connected to the internet of things (IoT). This paper describes a smart knowledge-based system (KBS) that helps patients showing symptoms of Influenza verify being infected with Coronavirus, commonly known as COVID-19. In addition to the systems’ diagnostic functionality, it helps these patients get medical assistance fast by notifying medical authorities using the IoT. This system displays patient’s location, phone number, date and time of examination. During the applications’ development, the developers used Twilio, short message service (SMS), WhatsApp, and Google map applications.


INTRODUCTION
Since its emergence in Wuhan, China in December 2019, the 2019-nCoV virus has become a primary global health concern [1,2]. The world health organization (WHO) declared this virus outbreak as the sixth public health emergency of international concern. COVID-19 is a type of Coronavirus not observed previously in humans [3,4]. The other common types of Coronavirus cause mild symptoms like the common cold while COVID-19, on the other hand, can cause serious illness for some persons, including older people and persons with severe underlying health conditions like heart disease, lung illness, and diabetes [5][6][7][8]. There is currently no cure or vaccine for this virus. Symptoms of COVID-19 are fever, chills, dry cough, breathing difficulty, tiredness, aches and pains, headache and sore throat [9][10][11][12]. Upper respiratory symptoms, like runny nose and sinus congestion, are infrequent in COVID-19 [13][14][15]. The results of diagnostic of the disease depend upon experience, expertise and perception of the physician [16][17][18]. "Expert systems" are systems in which a reasoning engine solves problems by applying rules from a knowledge base compiled by a human [19][20][21]. The usage of computer-based methods in medical diagnoses is improving the quality of medical services as it employs large number of data as the symptom and patient history. This technology is spreading, and it is supported by the internet of things (IoT), artificial intelligence, and machine learning methods. Smart expert systems utilize human knowledge to solve problems and give quick, accurate medical diagnoses; they can also send the results to related authorities [22][23][24][25][26]. The system is object-oriented and uses a unified modelling language (UML) [27][28][29], that ensures good system visualization and performance documentation. The proposed method uses python language 3.8. Expert Systems are accessible for the engineer to build and the end-users to use. Furthermore, the connection between knowledge-based systems and IoT system is a powerful technique that helps patients get medical attention as soon as possible. In this work, the developers used Twilio as a platform for communication. The main contribution of this paper as follow : a) Design and implementation of an alarm system. b) Describes a smart knowledge-based system (KBS) that helps patients showing symptoms of Influenza verify being infected with Coronavirus. This article is presented in different sections; Section 1 is the introduction while Section 2 is the literature review. Section 3 presents the methodology of the proposed system while Section 4 presents the case study. Section 5 covers the experimental results while the final section presents the conclusion of the study.
Literature review that has been done author used in the chapter "Introduction" to explain the difference of the manuscript with other papers, that it is innovative, it are used in the chapter "Research Method" to describe the step of research and used in the chapter "Results and Discussion" to support the analysis of the results. If the manuscript was written really have high originality, which proposed a new method or algorithm, the additional chapter after the "Introduction" chapter and before the "Research Method" chapter can be added to explain briefly the theory and/or the proposed method/algorithm.

LITERATURE REVIEW
Many researches have dealt with designing diagnosis systems; for instance, the study by Abu and Mahdi (2016) designed an Expert System to helps in diagnosing foot diseases. The system presents an overview of different foot diseases, their cause and treatment. The developers used the SL5 Object Expert System language for designing and implementing the system. Medical students evaluated the proposed diagnosis expert system and were satisfied with its performance as it was useful for patients with a foot problem [8].
Ahmad et al (2017) presented an expert system for the diagnosis of abdomen diseases such as ulcer and gastritis. It presents an overview, the cause of the condition, and the treatment whenever possible. The system uses Clips expert system language. The evaluation of the systems showed that it exhibited satisfactory performance [10]. Furthermore, Sagir & Sathasivam (2017) designed and evaluated the performances of two discrete adaptive neuro-fuzzy inference system models (ANFIS Matlab's built-in model (ANFIS_ LSGD) and a newly ANFIS model with the LevenbergMarquardt algorithm (ANFIS_LSLM). The proposed model predicts the degree of patient's heart disease with reliable and accurate results. Significant steps in this research involved classification using grid partitioning method, training the ANFIS with least square estimates and backpropagation gradient descent method, as well as training the ANFIS with Levenberg-Marquardt algorithm using finite difference technique for computation of a Jacobian matrix. The two models were compared in terms of training and testing with the Statlog-Cleveland Heart Disease dataset [4].
Santra, Mandal, & Goswami (2020) developed medical expert systems to overcome the problems of redundancy and irregularity in knowledge representation and to offer computational efficiency. The researchers also created a set of decision rules that would be used directly by the inference engine. They measured the reliability of each rule using a credibility factor and redefined the reliability measures of decision ones by placing the highly reliable rules first. The system searches for uncertain ones at a later stage if recommended by physicians. The researchers used an example from the domain of low back pain to illustrate the proposed knowledge representation [5].
Eyasu, Jimma, & Tadesse (2020) presented a prototype knowledge-based system for diagnosis and treatment of diabetes. The researchers used domain expert knowledge as a supplement of data mining techniques. They tested three classification algorithms (J48, PART and JRip) in WEKA and decided to use the J48 classification algorithm as a result. They used Ultimate Visual basic studio 2013 (Vb.net) for knowledge storage and as the front side of the prototype and Common lisp prologue (Clisp) for back end coding. This model achieved 94.7348% accuracy in classifying the statuses of diabetic patient datasets [9]. Safia (2020) presented an elastic, on-demand, and reliable medical diagnosis service based on IoT and cloud infrastructure which offered great benefits to both patients and specialists. The symptoms-based analysis of patients measures the heart rate using sensors. The service interacts with the patients to get the signs first and search for diagnosis later. The service provides doctors with on-demand disease description, scientific paper search, symptoms displaying, web crawling and multiple classifiers for an unrecognized combination of symptoms [11].

PROPOSED METHODOLOGY
The proposed system employed a knowledge-based system for the diagnosis of patients with Coronavirus or Flu. The method is organized as follows:

Block diagram
The proposed system consists of three parts central medical for recoding (CMR), knowledge based smart system (KBS) and emergency part (EP). Each section includes many components as shown in Figure 1.
Provide These components can be described as follows: 1) Knowledge The diagnosis process is initiated when a suspicious patient got to a checkpoint; the first step of the system is to send an informal message via WhatsApp application in CMR part to inform that there is a suspicious patient (thereby starting a checking operation). The cloud database in CMR part stores all the messages it received via WhatsApp from several patients. Secondly, the CMR and KBS parts works parallelly; while the CMR is working, the KBS part provides some previous queries in the Graphical interface (GUI) based on interaction with the patient. After completing the medical examination, the smart system gives the final diagnosis to the patient in KBS, which represents one of three possible outcomes (Flu virus, Coronaviruses, or both Corona or flu). If the final diagnosis is Coronavirus, the EP part will receive an alarm message with the location of the patient for rapid intervention and response.

Knowledge-based analysis and design
The system is developed based on the object-oriented paradigm; UML is used to capture the mechanism of the work of the system. The following shows the use case diagram and sequence diagram: A. Use case diagram: The functional needs of the system can be analysed using UML (use case diagrams); it consists of four actors which are the knowledge-based system (KBS), central medical for recoding (CMR), emergency part (EP), and patient. Figure 2 illustrates the use cases of the system which are: a) Ask questions: This use case is initiated by the KBS actor which asks a patient some questions and the patent should respond. b) Diagnoses disease: This use case is initiated by the KBS actor; it can be given the final diagnoses based on an inference module. This use case has an inclusion relation with send location use case, which means the alarm message contains the location of the patient received by the emergency part. f) Receive notification: This use case is initiated by the CMR actor when a suspicious patient starts to check-up. g) Store info patient: This use case is initiated by the CMR actor; it stores all notifications in the cloud database as received from several patients. h) Answer questions: This use case is initiated by the Patient actor; it answers the KBS questions. i) See result: This use case is initiated by the patient actor; it has a generalization relation (is-a) with three sub-use cases. The patient can see the type of disease, descriptions, and treatments for the disease. j) Receive alarm SMS: This use case is initiated by the EP actor; it receives SMS via smartphone when the final diagnosis is Coronavirus. This use case has an Inclusion relation with the receive location use case. k) Display location: This use case is initiated by the EP actor; it displays the location on Google Map application. l) Go to event place: This use case is initiated by the EP actor. After receiving the alarm, the EP team will go to the event place. This use case has an extend relation with Inform nearest site use case, which means the EP can inform the most adjacent sit to go to the event place.   Figure 3 illustrates the sequence diagram of the system; it shows the interactions between objects and actors based on time sequence or flow. KBS will send notification and store some information, such as the number of suspicious patient's cases on the cloud database. Also, it asks questions which displays on the graphical interface and patient replays on issues. After many processes, KBS displays the result of the diagnosis to the patient. It will send the alarm message with location to a smartphone of EP if the diagnosis is Coronavirus, otherwise, it can display the result to the patient with many information. Figure 3. shows a sequence diagram

Software design
The system used Python 3.8.2 language-based Know library, an alternative to the C language integrated production system (CLIPS). The system was also built based on Twilio, WhatsApp, and Google map applications. Twilio programmable SMS API was used as a powerful tool for messaging; it uses representational state transfer (REST) which relies on HTTP requests. These requests include HTTP method (GET, POST, POST, DELETE) data. Also, cloud database was used in a system that runs on a cloud computing platform. The access to its data is provided as-a-service.

CASE STUDY
Shows the distribution of the results based on the places of the test cases in Baghdad as shown in Figure 5. The system is applied in several places and two hospitals (Al-shaheed Al-Sadr and Central child) in Baghdad. The experiments involved 51 patients of different ages (children, adolescents and the elderly) and the results were as follows: a) Fourteen of the patients had symptoms similar to Coronavirus. They were quarantined, and other tests were performed to confirm the diagnosis. b) Five cases were diagnosed with Influenza, and when there are other symptoms, the patient will go to the hospital again. Figure 4 shows these results as a chart.

EXPERIMENTAL RESULTS
After login into the system and executing the system, the system will send a notification message to WhatsApp to inform on a suspected case as shown in Figure 6. Figure 7 shows the number and date of case tests in the system that are stored in the cloud database. The system diagnosis if the patient has a Flu virus infection as shown in Figure 8, The system can also diagnose if the patient has confirmed Coronavirus infection as shown in Figure 9.

CONCLUSION
This paper developed an IoT knowledge-based system which serves as an early detection system for the diagnosis of coronavirus or flu virus infections. Due to the curfew conditions in Iraq, especially in Baghdad, the proposed system was tested on a small number of people. The essential parameters used in the diagnosis are the travel history of the patient to areas infected with the epidemic, as well as contact history with infected persons. All cases diagnosed as Coronavirus infections by the system were sent for PCR examination to confirm or deny the diagnosis. Additionally, the system can display the description of the disease and the proposed treatment. The system has a user-friendly interface as it was built using the Python 3.8 programming language, Twilio, Whatsapp, and Google map applications.