Design and Development of We-CDSS Using Django Framework: Conducing Predictive and Prescriptive Analytics for Coronary Artery Disease

Clinical Decision Support System (CDSS) has become the ultimate point of care for healthcare sectors to assist the public in terms of Medical care. Through this research work, we propose the design and development of a Web-based Clinical Decision Support System (We-CDSS) using the Django framework with an aim to make CDSS accessible for both common people and clinicians on computers and mobile devices that integrates Predictive Analytics involving the LWGMK-NN algorithm for predicting Coronary Artery Disease, and Prescriptive Analytics involving prescription rules. The proposed research work consists of three phases. The first phase presents the design and development of a web-based CDSS outlook using the Django framework. The second and final phase embeds Predictive Analytics and Prescriptive Analytics into the We-CDSS to manage the functionalities of predictive decisions, and the functionalities of prescriptive processes that evaluate the predictive results and recommends personalized lifestyle suggestions to reduce the risk of coronary artery disease.


I. INTRODUCTION
Healthcare professionals use CDSS to improve patient care which gives the right diagnosis results, eliminates unnecessary clinical tests, and boosts patient safety, which in addition reduces healthcare costs, and aids healthcare professionals to review diagnosis results in real-time. The utilization of EHR improved dramatically with CDSS since data becomes accessible in only a few clicks. The capability of CDSS to scale back health problems is still under study, and many researchers suggest that thorough work is required to investigate this issue. Many healthcare providers are far behind in up taking ''Electronic Health Records (EHRs) and CDSS, and many affirmations confirm the successful The associate editor coordinating the review of this manuscript and approving it for publication was Vicente García-Díaz . health outcomes through CDSS when properly utilized in underserved communities [21]. Healthcare expenditures are likely to fall than increase after CDSS deployment. However, insufficient and inconsistent data restricts the usefulness of this evidence [14]. CDSS assists healthcare providers to make better medical decisions. It can be in the form of advice, patient-related alert, reminder, or any important health-based communication. A knowledge Base (consisting of recorded data facts and algorithmic models), an event monitor (laboratory results), and end-user communication support are all included in an automated CDSS. There are two kinds of CDSS namely patient-specific and non-patientspecific CDSS.
The recent generation has seen significant advancements in healthcare technology, particularly Artificial Intelligence (AI) playing a key role. Though AI has a fearsome reputation, VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ it offers a plethora of potential for bettering patient outcomes. Predictive analytics is one of the most important advantages AI [15] provides. Automation of regular chores is only one benefit of healthcare technology. Predictive analytics and AI are critical technologies for patient diagnosis and treatment. They help patients have a better experience and provide better care. Predictive analytics employs AI and Machine learning (ML) [7] to examine a wide range of data to determine a person's or a population's likelihood of developing particular diseases or ailments. It assists healthcare providers in making well-informed judgments regarding the best treatment alternatives for the best patient outcomes. Healthcare providers can use predictive analytics to assess which individuals and populations are more vulnerable to disease. Doctors can use predictive analytics to detect signs of potential diseases before they become severe thereby improving patient health outcomes The outcomes of essential healthcare decisions on intuition or simple instruments will be less than ideal, putting patients' lives in jeopardy. Any successful strategy to transition in this era of big data must be powered by real-time data analytics and empower evidence-based and informed decisions. That is where technologies like decision optimization come into the equation, allowing for a more evidence-based and seamless approach to decision-making. Prescriptive analytics can be used to evaluate a patient's well-before conditions, estimate their risk of developing future impacts on health, and generate tailored proactive treatment programs based on that risk. This subset of analytics goes a step further than predictive analytics by using data sets to recommend the next optimal course of action. Prescriptive action can indeed be pre-programmed based on the established combination of rules, or the algorithms that make recommendations depending on the data sources and what it learns through them.
This research work proposes the ''Web-based CDSS (We-CDSS)'' integrating Predictive Analytics that predicts the risk of ''Coronary Artery Disease'', and Prescriptive Analytics that evaluates the predictions, and coronary risk factor values to prescribe ''Personalized Life Style Suggestions''. This We-CDSS is easily accessible via the internet where any user can access the CDSS service through the web browser and the internet. The deployment of We-CDSS using Django consists of three phases; firstly, the design and development of the We-CDSS outlook. Secondly, the integration of predictive analytics using the LWGMK-NN [8] algorithm to predict the risk of Coronary Artery Disease, and Finally, embedding prescriptive analytics upon the results of predictive analytics to provide personalized healthcare suggestions to improve their living conditions and reduce the risk of CAD. Further, We-CDSS has two distinct CDSS built under a single We-CDSS umbrella:-One is based on patient-specific (common users) CDSS and the other is non-patient-specific (for clinicians) CDSS depending on the various laboratory results available unlike other traditional ''Decision Support Systems (DSS's)'' that are installed on a single computer or a network with the user (account) required accessing the DSS. The following summarizes the paper's structure. Section 2 summarizes the Literature Survey; Section 3 presents the Proposed Work; Section 4 presents Results and Discussions, and lastly, the conclusion and future work culminate the paperwork.

II. LITERATURE SURVEY
Early detection and prognostication of CVD risk is an effective approach among other measures. Predictive analytics (PA) plays a vital role in decision support and value-based care, based on the simple adage that ''an ounce of prevention is better than cure.'' According to a researcher [22], one of the most severe forms of mortality globally is Coronary Artery Disease (CAD), which accounts for one in every three deaths. Since it is difficult to identify and reverse CAD, hence and early detection is critical for an effective cure [23], risk prediction can inspire people to change their health and lifestyles, along with the right medications [20]. However, proper diagnosis necessitates the use of experienced medical professionals; without them, diagnosis errors, underestimated risks, delayed medications, and wrong treatments can occur. Thomas Dawber and William Kannel [16] identified cardiovascular risk factors in 1961 and published their findings in ''Factors of Risk in the Development of Coronary Heart Disease''. Researchers in Framingham [29] propose a logistic risk (multivariable) model, with seven risk factors namely age, hemoglobin, weight, electrocardiogram (ECG), total cholesterol, systolic blood pressure, and tobacco products smoked. The ''Framingham risk score'' publishes [30] the best risk profile for a 10-year risk assessment for CAD that provides an easy way to classify individual coronary heart risk as high, moderate, or low. Along with the previously mentioned risk factors, several other risk factors for cardiovascular disease have been identified namely cholesterol [13], diabetes [24], [19], [18], High-Density Lipoprotein (HDL), obesity, Low-Density Lipoprotein (LDL) [11], and Hypertension. These factors increased the risk of stroke more than the risk of CAD [17]. Yang [31] conducted a CVD study on the Eastern-China population and presented a 3-year CVD risk model. Using a multivariable regression as a benchmark model, the researcher evaluated the performance of other ML algorithms-, and observed that the Random Forest (RF) outperformed other supervised ML algorithms with an accuracy of 78.70 % versus the benchmark model of 71.43 %. Salhi [27] conducted studies on predicting heart disease in Algerians using an Artificial Neural Network (ANN), K-Nearest Neighbor (K-NN), and Support Vector Machine (SVM). Results showed that ANN predicted better with the highest accuracy of 93%. The author [3] discusses the role of a ''Decision Support System (DSS)'' in preventing ''Cardiovascular Disease (CVD)'' and the requirement of well-designed studies on the outcome of patient's health data for the evaluation of DSS's role as a secondary disease prevention method. Work by P.K. Anooj [4] presents a ''Weighted fuzzy rule'' model for CAD prediction. The obtained results showed 57.85% accuracy, which is not much progress. Another work [1] proposes a ''Nested Ensemble nu-Support Vector Classification (NE-nu-SVC)'' model that combines many ML methods as ensemble techniques for CAD diagnosis. The performance results of the ''Z-Alizadeh Sani (Iran)'' and ''Cleveland'' datasets validate the model with accuracies of 94.66%, and 98.6%. However, the paper presented only the ML model but not the work on the CDSS framework as stated in the research title. A research paper on predictive and descriptive analytics [5] proposes the use of Decision Trees, SCM, NB, and Neural Networks (NN) for predictive analytics, and association and decision rules for descriptive analytics. Results showed that Decision trees performed better with the accuracy of 88.09%, 73.87%, and 85.38% for ''Cleveland'', ''South Africa'', and Z-Alizadeh Sani (Iranian)'' datasets respectively. One of the research works proposes a new optimization strategy [2] named ''N2Genetic Optimizer'' for the ''NuSVM'' algorithm and projects the performance results with 93.08% accuracy, and 91.50% of F1-Score for the Iranian dataset. Yet another research work [12] proposes a ''Systematic Review and Meta-Analysis'' to estimate the consequences of CDSS on ''Cardiovascular Risk Management (CVRM)'' and concludes that CDSS gives lesser benefit for CVRM due to heterogeneous approaches for CDSS, which obstructs strong conclusions. Table 1 gives a tabular summary of research works carried out on the development and deployment of various CDSS. Decision support systems emerging under the umbrella of cognitive decisions [6], can lead to a paradigm shift in the healthcare industry. The research work on implementing a multistratified LWGMK-NN algorithm [8] for various clinical diagnosis problems has proved the predicting capability and its novelty to rely on the forecasted results.

III. PROPOSED WORK
The research work on implementing the LWGMK-NN algorithm for various clinical diagnoses has proved the predicting capability and its novelty for relying upon the LWGMK-NN algorithm. The current section divides into two subsections explaining the Predictive Analytical model and We-CDSS workflows.

A. PROPOSED WE-CDSS
Traditional DSS requires user (account) authentication, and authorized persons to access the ''Decision Support Systems'' that are installed on a single computer or a network. This research work proposes the ''Web-based CDSS (We-CDSS)'' that is easily accessible via the internet; where any user can access the CDSS service through the web browser and internet. Figure 1(a) depicts the pictorial representation of the proposed workflow taken up for this research work. The deployment of We-CDSS using Django consists of three phases; firstly, the design and development of the We-CDSS outlook. Secondly, the integration of predictive analytics using the LWGMK-NN algorithm to predict the risk of Coronary Artery Disease, and Finally, embedding prescriptive analytics upon the results of predictive analytics to provide personalized healthcare suggestions to improve their living conditions and reduce the risk of CAD. Further, this We-CDSS has two distinct CDSS built under a single We-CDSS umbrella, One is based on patient-specific (common users) CDSS and the other is non-patient-specific (for clinicians) CDSS depending on the various laboratory results available.

B. DJANGO FOR WE-CDSS
Django-is an open-source, free, and high-level web framework that works on python (programming language) for rapid, pragmatic, clean, and hassle-free web development. The Django framework provides several software tools, packages, and features required for the easy design and development of a ''Web-based Clinical Decision Support System (We-CDSS)''. Table 2 provides information on tools used for developing we-based CDSS. Django provides several functionality features such as ''CRUD (Create, Read, Update, and Delete)'' functionalities, cross-site scripting, HTTP Responses, Software administration features, and user management capabilities. Django provides cross-site scripting and handles a complex set of features and a large no. of users such as user authentication and API connectivity. It has more than 10,000 Django packages all the virtual requirements for a web application to run smoothly. The Django web packages include user authentication, validation, Captcha protection, content management systems, and most importantly the API. The proposed We-CDSS is built using the Django framework as represented in Figure 1(b). From the client end, the user requires just a web browser with the internet to connect to the We-CDSS system. The Server side consists of We-CDSS built on the Django framework involving Uniform Resource Locator (URL), Cache Framework for Web-application, Django's Model View Template (MVT) model, and a database (SQLITE3 is considered) for storing data and Django-data models.
Structured Query Language (DQL) is a powerful language and it provides a variety of queries to generate, remove, update, and other database-related tasks. Django models facilitate many inbuilt packages to organize tables into models. Django takes care of the controller (software code to control model view interactions) by itself and leaves a template for developers. The model view template (MVT) is an HTML file assorted with DTL. Templates offer security features such as the automatic escape of HTML characters (common characters) in the user-entry field, protection from SQL injections, and reinterpretation of unauthorized commands to avoid code injections into databases. The Django project allows us to build our Web-Based CDSS data model in python without the need to use SQL. It uses an ''Object-relational Mapper (ORM)'' and converts traditional Database (DB) structures into python classes. Django Sqlite3 also supports JSON datatype and other related functions. The database fields convert into class attributes for easy design and management of the Django database.

C. INTERACTIONS OF APPLICATIONS IN WE-CDSS
Web applications built entirely on Python (programming language) are termed Projects in Django. Hence, the design and development of We-CDSS are technically termed as the We-CDSS Project. Figure 2 depicts the overview of the We-CDSS design. It consists of four applications representing object-oriented interaction among the sub-Web-Applications. We-CDSS is the main application that connects all the other applications of the We-CDSS project. We-PUBLIC application involves a We-PUBLIC page for public access, and the We-CLINICIAN application involves the We-CLINICIAN page for clinicians' access. Finally, the We-WEB application hosts the Predictive and Prescriptive models of Coronary Artery Disease. The following explains the role of each module.
i. We-CDSS Main Module: Presents the entire web application of the resulting We-CDSS, and its role is to provide connecting paths to access the We-PUBLIC module (i.e. the We-PUBLIC Page), We-CLINICIAN module ( i.e. the We-CLINICIAN Page), and We-WEB modules exclusively. ii. We-PUBLIC and We-CLINICIAN Modules: Hosts all the necessary Django files and structures of the We-PUBLIC Page, and We-CLINICIAN Pages. It also maintains exclusive connectivity paths to the We-WEB module and the We-CDSS Main module. iii. We-WEB Module: Hosts the Predictive and Prescriptive models of the entire We-CDSS implementation. In addition, it maintains the interactions among the We-PUBLIC-We-WEB modules, and the We-CLINICIAN-We-WEB modules are completely exclusive.

D. NOVELTY EVALUATION OF LWGMK-NN PREDICTIVE MODEL
To ensure that the LWGMK-NN algorithm is the right choice to predict the chances of any individual falling at the risk of ''Coronary Artery Disease (CAD)'', we evaluate the LWGMK-NN algorithms prediction performance using four different CAD datasets of different countries including ''Cleveland'', ''South Africa'', Framingham (US)'', and ''Iran''. Table 3 projects the performance result of the LWGMK-NN algorithm evaluated using standard performance metrics namely Precision, Accuracy, Recall, ROC-AUC curve, and F1-score measure through an iterative evaluation process (5-fold cross-validation technique iterated10 times). Results show that the LWGMK-NN algorithm makes CAD predictions for Framingham heart study datasets with 99.98% preciseness, and makes cent percent predictions for Cleveland, South Africa, and Iran heart disease datasets.

IV. DESIGN AND DEVELOPMENT OF WE-CDSS MODULES
We-CDSS consists of mandatory sub-structures under each module namely the Templates, views, forms, and models. These default file structures used will deploy the We-codes for decision support system development. The following explains the functionalities of sub-structure files.
i. Templates: A Django template is a Python string with Django template vocabulary. The template engine interprets and recognizes some constructs. Context rendered by the templates executes tags and replaces variables with their look-up values in the context where everything is an output in its current state. The templates are capable of generating text-based formats such as XML, HTML, and CSV.   ii. Views: Django Views are indeed an essential feature of the Django MVT Structure. The view file receives  Figure 3 gives a pictorial representation of the We-PUBLIC and We-CLINICIAN Web development structure. Our Django Templates for We-PUBLIC and We-CLINICIAN consist of a Public & Clinician page, Public & Clinician content, and Prediction and Prescription pages (for Public and Clinician separately). We-WEB module interacts with the views of We-PUBLIC and We-CLINICIAN distinctly. Figure 4 depicts the We-WEB module's development structure. The Views file of We-WEB handles the main We-CDSS page views through Template interactions which intern contain Index, Placeholder, and Base HTML files for handling interactions from We-PUBLIC and We-CLINICIAN modules. We-WEB module hosts the predictive and prescriptive analytical models inside it, which collects the query data from the user (public or clinician) through Forms. After data validation in Forms, the predictive model takes in the user data as input for CAD risk prediction. The prescriptive model then evaluates the outcome of the predictive model to give personalized lifestyle prescriptions. We-CDSS main module hosts all the sub-modules to handle interactions between all the other modules in the project. Under every module, Django creates dynamic HTML with a built-in template engine called the ''Django Template Language (DTL)'' that allows  Django HTML templates to combine data (like locations and usernames) with static elements (logos, text, or colors) on the fly.

V. RESULTS AND DISCUSSIONS
The proposed We-CDSS built on the Django framework involves two different projects for two different user populations-one for the public and another for the clinicians.

A. USE CASE RESULTS
All the possible use case results for providing personalized lifestyle prescriptions after the prediction for users irrespective of the results of having ''CAD'' or ''Healthy Heart'' for the We-Public Page module, and the We-Clinician Page module of We-CDSS respectively are cited in Tables 4, and 5.

B. DEPLOYMENT RESULTS OF WE-CDSS
The designed, developed, and deployed result of the We-CDSS depicted in Figure 5 shows the main page of the We-CDSS. The main page introduces the Web-based Clinical Decision Support System with an introduction to the purpose, functionalities in brief, and two navigation buttons  for different user populations of the We-CDSS namely ''For Public'', and ''For Clinicians''. The ''For Public'' button navigates to the Public page (i.e. We-PUBLIC module of We-CDSS) as shown in Figure 6. It provides six form fields, and separate navigation buttons for ''Home Page'' and ''Get predictions''. Once the user fills his/her report data in the form (shown in Figure 6) and clicks on the ''Get Prediction'' button, the data goes to the prediction model (Multi-stratified LWGMK-NN) of the We-WEB module for evaluation and the results are displayed on the prediction result page of the We-PUBLIC Page as shown in Figure7. The designed, developed, and deployed result of the We-CDSS depicted in Figure 5 shows the main page of the We-CDSS. The main page introduces the We-CDS System by giving an introductory note on its purpose and its functionalities in brief. Along with the introductory note, it provides two option buttons for the We-CDSS users namely ''For Public'' and ''For Clinicians''.
On click of ''For Public'', buton navigates the link to the Public page (i.e. public-specific module of We-CDSS) shown in Figure 6. The Public page provides six form fields and  two navigation buttons, one for ''Home Page'' and the other to ''Get predictions''. Once the user fills his/her report data in the form (sample form shown in Figure 6) and clicks on the ''Get Prediction'' button, the data goes to the prediction model (Multi-stratified LWGMK-NN) for evaluation and the results are displayed on the prediction result page shown in Figure 7.
A sample user data filled is shown in Figure 6.   button, the predicted result along with the user data is sent to the prescriptive analytical model for evaluation and display as shown in Figure 8. The prescriptions not only provide personalized lifestyle suggestions but also boost the confidence of the patient (user) by indicating his/her health normality. For the sample query data and predicted results shown in Figures 7 and 8, the prescription results project that his/her cholesterol levels, Body weight, and resting heart levels are good and focus only on the abnormal blood pressure levels and gives personalized lifestyle prescriptions for it.
From the We-CDSS main page, on-click the ''For Clinicians'' button, the We-CDSS navigates to the ''Clinician Page'' (i.e., a non-public specific module of We-CDSS) shown in Figure 9. The ''Clinician Page'' has three divisions namely the form fields, the ''Home Page'', and the ''Get Predictions'' buttons. Once the user fills his/her report data in the form (sample form shown in Figure 9) and clicks on the ''Get Prediction'' button, the data goes to the prediction model for evaluation and the results are displayed on the prediction result page shown in Figure 10. A sample user data filled is shown in Figure 9. Figure 11, shows the results obtained from the prescriptive model for the We-Clinician module. The prescriptions not only provide personalized lifestyle suggestions but also boosts the confidence of the patient (user) by indicating his/her health normality. For the sample query data and predicted results shown in Figures 9 and 10, the prescription results project that his/her blood sugar levels, heart vessels, ECG, and maximum heart rate are normal, no blood disorders, and focuses only on the abnormal Diastolic Blood Pressure levels and gives personalized lifestyle prescriptions for it. Figures 12, 13, 14, 15, and 16 demonstrate the use case of a person falling at risk of Coronary Artery Disease for public and clinician modules respectively. Figure 12 explains the second user sample data entered on the Public page to get CAD prediction. Prediction and personalized lifestyle prescription for sample-2 data is displayed in Figure 13 to depict the risk of CAD and suggest personalized lifestyle prescriptions to control blood, and body parameters to reduce the risk and lead a healthy lifestyle. Fig. 14 explains the second user sample data entered on the Clinician page to get CAD prediction. Prediction result gives an '' Alert!! You are at risk of Coronary Artery Disease'' message as a predictor message for CAD risk presence as  displayed in Figure 15 and personalized lifestyle prescription is depicted in Figure 16 explaining the health condition levels and the lifestyle prescriptions based on each parameter considered for risk factor analysis to predict CAD.

VI. CONCLUSION
Django a robust python framework makes the design, development, and deployment of complex We-CDSS simple, cost-effective, and easily accessible via the web browser. Predictive and prescriptive analytics makes a significant contribution to diagnosing and predicting the risk of CAD in any individual correctly through the LWGMK-NN model and provide personalized lifestyle prescriptions by combining and evaluating prediction results, risk factors, user data, and association rules to deliver rightful prescription for people under CAD risk. By making We-CDSS of CAD work accessible at their fingertips for both common people and healthcare professionals, We-CDSS makes a promising contribution to the people and society. As an extension to the We-CDSS work further with careful and more detailed research, the inclusion of automatically personalized medication prescription is possible, provided integration of additional features such as the patient's medical history and current medications is included in the evaluation process.