Expert Systems with Applications 39 (2012) 2132–2156
Contents lists available at ScienceDirect
Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa
Constructing a nutrition diagnosis expert system Yuchuan Chen a, Chien-Yeh Hsu a,1,⇑, Li Liu a,2, Sherry Yang b,3 a b
Graduate Institute of Biomedical Informatics, Taipei Medical University, 250 Wu-Hsing Street, Taipei City 110, Taiwan Taipei Medical University, 250 Wu-Hsing Street, Taipei City 110, Taiwan
a r t i c l e
i n f o
Keywords: Expert system Nutrition diagnosis system Rule-based ASP.NET
a b s t r a c t This paper presents a research of constructing a web-based expert system for nutrition diagnosis by utilizing the expert system techniques in artificial intelligence. The research implements Nutritional Care Process and Model (NCPM) defined by American Dietetic Association (ADA) in 2008 and integrate the nutrition diagnosis knowledge from dietetics professionals to establish the basics of building the rulebased expert system with its knowledge base. The system is built using Microsoft Visual Studio 2008 on .NET Framework 3.5SP1 utilizing the built in rule engine which comes with Windows Workflow Foundation. With the help of this system, it is easier for dietetics professionals to adapt to the newly introduced concept of nutrition diagnosis. At the heart of the web based expert system is a knowledge base, it has a rule engine which contains the nutrition diagnosis rules converted from signs and symptoms for nutrition diagnosis from dietetics professionals and are expressed in XML format which are then stored in a SQL database. A knowledge engineer will be able to use a rule editor to add new rules or to update existing rules within the rule database. Dietetics professionals would be able to enter patient’s basic data, anthropometric data, physical exam findings, biochemical data, and food/nutrition history into the program. After dietetics professionals complete nutrition assessment, the program will make inference to the rule base and make nutrition diagnosis. Dietetics professionals could then make the final diagnosis decision for the patient based on the diagnosis report generated by the web based nutrition diagnosis expert system. For this study, I have selected 100 chronic kidney disease patients under hemodialysis from a university hospital, recorded their albumin, cholesterol, creatinine before dialysis, height, and dry weight and then use these data to perform nutrition diagnosis with both the expert system and a practicing dietitian. After comparing the result, I found that the expert system is faster and more accurate than human dietitian. Ó 2011 Elsevier Ltd. All rights reserved.
1. Introduction 1.1. Motivation Nutritional diagnosis is currently a new concept for dietitians in Taiwan. Taiwan’s Department of Health is working with Taipei Medical University’s dietetics department to establish a standard model for nutritional diagnosis in Taiwan while American Dietetic Association has already established a model called NCPM. One of the goals of American Dietetic Association is to help all dietetics professionals to provide high quality nutrition care to ⇑ Corresponding author. Address: No. 250, Wu-Hsing Street, Taipei 11031, Taiwan. Tel.: +886 939 193 212. E-mail addresses:
[email protected] (Y. Chen),
[email protected] (C.-Y. Hsu),
[email protected] (L. Liu),
[email protected] (S. Yang). 1 Tel.: +886 2 2736 1661x3349. 2 Tel.: +886 968 771 329. 3 Tel.: +886 2 2736 1661x6568. 0957-4174/$ - see front matter Ó 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.eswa.2011.07.069
their patients. In order to achieve the goal of ‘‘Increase demand and utilization of services provided by members” and ‘‘Empower members to compete successfully in a rapidly changing environment”, the establishment and implementation of a standardized nutritional care process is needed. Implementing a standardized process would yield a more consistent result. The House of Delegate of American Dietetic Association finally adopted the final version of the Nutrition Care Process and Model (NCPM) on March 31st, 2003 (Lacey & Pritchett, 2003). NCPM consists of four main steps. They are nutrition assessment, nutrition diagnosis, nutrition intervention, and nutrition monitoring and evaluation. This research is trying to build up, practice and computerize the nutrition diagnosis with the flexibility of a web based expert system that provides expert knowledge and evidence-based diagnosis (Bueche, 2008a). Nutrition diagnosis should not be confused with the traditional physician-oriented medical diagnosis, which can be defined as an illness or a syndrome of particular organs or body systems that
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
can be taken care of (Lee, 2005). Nutrition diagnosis refers to the patient’s nutritional conditions and problems that dietetics professionals can be expected to identify, based on organized and clustered assessment data. Expert systems are influential software that assists decision making and is being applied to a variety of problem domains (Buchanan & Smith, 2003). An expert system is a computer program that contains the domain knowledge of one or more human experts. Expert system can explain how the conclusion is reached. The types of problems can be dealt with expert systems is vast. An expert system has the ability to accumulate the expertise and experiences from multiple human experts, and provide valuable decision making recommendations to human experts. Applying expert system technology in the field of nutrition diagnosis has the potential to increase the efficiency of dietetics professionals’ clinical practices. 1.2. Purpose The purpose of this research is to construct a rule-based expert system for nutritional diagnosis and to evaluate whether the constructed system could assist dietetic professional to make nutritional diagnosis faster and more accurate. 2. Literature review 2.1. Nutrition Care Process Model (NCPM) During nutrition diagnosis phase, a dietitian would identify and label the patient which indicates an occurrence, risk, or potential of developing some kind of nutritional issues that dietitians should treat. From the data gathering in the previous step, nutrition assessment, dietitians would organize and analyze the data and reveal diagnostic category and finally comes up with appropriate nutrition diagnosis. A nutrition diagnosis is different from a medical diagnosis which could be defined as a disease or some type of pathological disorder of a particular organ that can be treated. A nutrition diagnosis would change when patient’s response changes. A medical diagnosis does not change as long as the disease condition stays. By analyzing the data gathered from nutritional assessment and come up with the correct nutrition diagnosis(es) presents dietitians with a way to set realistic and measurable goals, selecting fitting interventions, and tracking improvement in achieving those expected goals. A nutrition diagnosis contains three major components. They are problem (diagnostic label), etiology (cause/contributing factors) and signs/symptoms (defining characteristics). A diagnostic label is a phrase or sentence which describes the patient’s condition such as increased/decreased, or having risk of. In etiology, we state the cause of the problem. This helps in determining whether or not we should be expecting that the following nutritional intervention would effectively help the patient with his/ her nutritional condition. By recording the etiology, we may also gain the benefit of identifying the cause and thus correct it. In the signs and symptom components of the nutritional diagnosis, we record both subjective and objective signs and symptoms for the patient. The signs and symptoms component includes patient’s biochemical data, anthropometric measurements, physical examination findings and food/nutrition history. These data allows quantifying the problem and permit us to evaluate and give a severity ranking. The symptoms are changes the patient verbally tells the dietitians while the signs are observable fluctuations in the patient’s health status. The nutrition diagnosis should be prepared in PES format, which stands for problem/etiology/signs and symptoms. According
2133
to American Dietetic Association, a well-written nutrition diagnostic statement should be: 1. 2. 3. 4. 5.
Clear and concise. Specific: patient centered. Related to one client problem. Accurate: relate to one etiology. Based on reliable and accurate assessment data.
The nutrition diagnosis step mainly focused on the naming and describing of the nutritional problem. Dietitians seldom determine the continuation of care at this stage. Step 3. Nutrition intervention. A nutrition intervention is a precise steps of actions used to deal with the nutritional problem found in nutritional diagnosis. It is designed to correct patient’s nutrition-related behavior, risk factor, and environmental condition. It is done in this step to select, plan and implement suitable measures to meet patient’s nutritional needs. The nutrition diagnosis acts as the basis in which the intervention selection decision is made. Every intervention should be based on scientifically sound principles. Nutrition intervention includes two processes. 1. Formulate and determine a plan of action Prioritize nutrition diagnosis based on the seriousness of the nutritional problem. Consult evidence based practice guides. Determine expected outcome for the patient. This should be obvious and brief and expressed in a recognizable and measureable way. This should be evaluated based on the patient. The intervention should be focused on the cause (etiology) and should be effective based on latest knowledge and evidence. Determine time and frequency of the intervention, including strength, period and follow-ups. 2. Implement nutritional intervention During intervention process, dietitians should effectively explain the plan of care to the patient and execute the determined action plans. He/she should also continuously collect patient’s data and adjusts the plan based on the collected data as required. Step 4. Nutrition monitoring and evaluation. Monitoring refers to the measurement and review of a patient’s status at a pre-defined interval with regards to the nutrition diagnosis, intervention and outcomes. Evaluation is the organized comparison of patient’s current status versus patient’s previous nutritional status. Dietetics professionals could find out the recommended times for follow ups in American Dietetic Professional’s Evidence-Based Guides for Practice and other evidence based sources. The goal of nutrition monitoring and evaluation is to determine the progress of each intervention and to find out whether the desired nutritional status has been achieved by adopting the selected nutritional interventions. The progress should be recorded on a schedule until the patient is discharged. There are three steps in the process of nutritional monitoring and evaluation. 1. Monitor progress. 2. Measure outcomes. 3. Evaluate outcomes. By adopting NCPM, it is expected that we enhance the traditional experience-based practice towards a scientific methodology that utilizes evidence-based practices (Bueche, 2008b).
2134
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
2.2. Nutrition diagnosis
2.3. Nutrition informatics
The notion of nutritional diagnosis was first introduced in 1956 (李蕙蓉, 2005). What exactly does the term nutrition diagnosis mean? According to American Dietetic Association (ADA)’s definition, Nutrition diagnosis is a dietetics professional’s recognition and naming of an existing nutritional problem of a patient which the dietetic professional is responsible for treating (Bueche, 2008a). Currently, nutrition diagnosis is not included in dietetics’ daily workflow. Dietetics professionals currently rely on medical diagnosis made by physicians as the major reference in the nutritional assessment work. Dietetics professionals then design the nutritional treatment plan according to the medical diagnosis. During nutritional assessment, dietetics professionals create raw data by record their findings on a chart. They would gather patient’s biochemical data, anthropometric data, physical exam findings, and food/nutrition histories. This would generate a huge amount of raw data for a patient. After gathering all those data, a dietetics professional will have to write a statement stating what problem has been found or solved for the patient. At present, there exists no standard terminology for dietetics professional to record their findings. This leads to the communication issues among dietetics due to the lack of standard terminology (Peng, 2005). This has prompted American Dietetic Association to establish Nutrition Care Process Model (NCPM) in 2003 (Lacey & Pritchett, 2003). Since the nutritional diagnosis step’s main purpose is to give a diagnostic label to the patient, if a nutritional diagnostic label could not be determined by the dietetics professional, the patient might be referred back to the primary provider (see Fig. 2-1).
The use of computers and electronic media by nutritional experts began when the computer system was first introduced almost half a century ago. Dietetics professionals used computers to assist their work mainly in the following areas: 1. Inventory management system. Dietitians have used computers to help with the management of large amount of data which is used for purchasing and inventory management. An example of this is the online nutrition information system for the clinical dietitian used in university hospitals of Cleveland, OH (Petot, Houser, & Uhrich, 1980). 2. Nutrient analysis. It is natural for dietitians to be interested in using computers to correctly calculate the nutritional values of menus, patient’s nutritional intakes, etc. There are many programs aimed at achieving this goal, such as Diet Balancer, DietMax Plus for windows, Food Processor Plus and Counseling Data System (Lee, Nieman, & Rainwater, 1995). 3. Nutrition research. Researchers in every discipline are using computers to run statistical analysis in reporting experiment results. Research dietitian also used nutrient analysis programs to evaluate the consistency. They also used computers for accurate data reporting. In 2003, researchers in University of Minnesota have created a computer program which collects and analyzes dietary information required for nutrition researches (Feskanich, Sielaff, Chong, & Buzzard, 1989).
Fig. 2-1. Nutrition care process (Bueche, 2008a).
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
4. Clinical nutrition care. The most commonly application in clinical nutrition care is to use a personal digital assistant device to calculate or to derive formula. In addition to that, in the past decade, there were many programs that are used to aid in education and training for clinical dietitians. 5. Foodservice systems management. Computer applications are used in all food service tasks, including procurement, preparation, and delivery. 6. Educational/instructional tools. In education, computers were being used to writing and printing educational materials. There were also software programs which help consumers to understand more about nutrition. 7. Reimbursement of nutritional care. Dietitians are interested in electronic reimbursement process. 8. Communication. Dietitians are using emails, Internet, web sites, and electronic patient medical records. 9. Food-supply surveillance. Since 911, US FDA has invested in counter bioterrorism procedures to establish a food tracking system which allows FDA to trace food’s sources, destinations from ports, factories, or distributers within US. This eases the investigation in the event of mass food poisoning or contamination. The Centers for Disease Control and Prevention (CDC) of the United States has launched a web based system called ‘‘The National Outbreak Reporting System” in 2009, which was designed to improve quality, quantity and availability of data for not only food borne but also for water borne, person-to-person as well as animal-toperson disease outbreaks in the states (Sobel, Khan, & Swerdlow, 2002). Hoggle defined nutrition informatics as ‘‘the specialty in the field of human nutrition and dietetics that integrates science, evidence-based practice, research, computer knowledge, and expertise in electronic information systems for the purpose of supporting optimal nutritional status and health” (Hoggle, Michael, Houston, & Ayres, 2006). In order to effectively utilize the benefit of ADA’s NCPM, a standard terminology is required to communicate, document, and evaluate the effectiveness of nutrition care (Hakel-Smith & Lewis, 2004). The medical profession developed the International Classification of Diseases (ICD) so that physicians could describe a patient’s medical condition with standardized terms and thus reduce confusion. A standard, International Dietetics and Nutrition Terminology (IDNT) is being developed by ADA. IDNT will allow dietetics to describe with a standardized terminology for nutritional assessment, nutritional diagnosis, nutrition intervention, and nutrition monitoring and evaluation. NCPM and INDT are complementary to each other. NCPM provides a standard process to solve the problem while INDT provided the standard term to describe the results of the model (Bueche, 2008b). For nutritional informatics, INDT will play a very important role. A standard terminology provides exact data entry, management, retrieval, and correlation. If INDT is used consistently by dietetics professionals and all nutritional systems, large amount of data can be analyzed and researches can be done to further improve nutritional care. Four weeks after President Barack Obama’s inauguration, he signed a US$787 billion economic stimulus package which is called ‘‘American Recovery and Reinvestment Act of 2009”. It requires US federal government to mandate an electronic health record for all American before year 2014 (Steinbrook, 2009). In Taiwan, department of health has been promoting electronic health record since 2000. Integrating the standardized nutritional terminology into electronic health records will provide more opportunities and efficiencies for researchers to conduct clinical
2135
trials, measuring outcomes and provides a pool of data for further studies (Bueche, 2008b). 2.4. Expert system In the early 1950s, the development of computer software began with a focus in numerical systems. People began rapidly relying on computers to deal with data process at the beginning of 1970s. Stanford University developed a rule-based expert system called MYCIN back in mid 1970s. Although the system is invented almost some 40 years ago, it is still the representative of the state of the art expert system. MYCIN is developed to help diagnose the likely cause of patients’ infection and provides suggested therapy for the patients. Its rule base consists of 450 rules and one thousand facts of medicine regarding to meningitis infections. The system was successful and it proved that with a rather simple representation of rules in a form of if-then-else statements is enough to handle with a rather complicated but focused domain area such as meningitis infection diagnosis. However, due to some political issues, MYCIN was never put to use in a clinical setting. It was only used for learning and training purposes (Buchanan & Duda, 1982). It is after the successful development of MYCIN, the expert system technology began to see a light of being commercialized. During 1980s, researchers began research artificial intelligence. United States, Japan, as well as many countries in Europe, began investing in the area of artificial intelligence and expert systems and during these time, many expert system tools began to emerge. The purpose of artificial intelligence is to broaden the application of computers to not only include numerical calculations but also to possess knowledge and therefore enhance the utilization of computers. The major research area for artificial intelligence includes natural language processing, symbol processing, rule-based system and logic systems. The development history of the expert system could be divided into five periods (葉怡成, 1991): 1. Incubation (prior to 1960) In 1937, Allan Turing described the Turing Machine. In 1956, the term ‘‘artificial intelligence” occurred the first time in a conference at Dartmouth College. In 1957, Herbert Simon, J.C. Shaw, and Allen Newell created a General Problem Solver. In 1958, the language LISP language was created by John McCarthy at MIT. 2. Birth (1960–1970) In 1965 a team at Stanford University created Dendral, an expert system used to identify unknown organic chemical substances. In 1965, Zadesh published a research regarding to fuzzy sets. In 1966, MIT released MACSYMA, a tool for symbolic computations. 3. Development (1970–1980) In 1972, Stanford University developed MYCIN. In 1972, Stanford University developed Prospector. In 1972, PROLOG was developed in France. In 1975, Minsky developed a framework for knowledge representation. In 1977, Feigenbaum came up with the term ‘‘knowledge engineering”. In 1978, Carnegie Mellon University cooperated with DEC to develop an expert system called R1/XCON which is used for the configuration of VAX computers. In 1979, Dr. Forgy defined the RETE algorithm in his PhD thesis. 4. Growth (1980–1990) In 1980, several companies began selling LISP machines. In 1982, Japan began the Fifth Generation Computer System Initiative using PROLOG.
2136
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
In 1983, IntelliCorp released KEE (Knowledge Engineering Environment) for development and deployment of knowledge systems on LISP machines. In 1988, Gallant proposed the expert system based on Neural Network. 5. Mature (after 1990) After 1990, expert systems are used in many different areas. According to Buchanan and Smith (2003), the definition of an expert system is: ‘‘An expert system is an interactive computer-based decision tool that uses both facts and heuristics to solve difficult decision problems based on knowledge acquired from an expert.” An expert system is a software program which helps solving the problems with expert-level solutions and is heuristic, transparent and flexible. It reasons with human experts’ domain knowledge while providing explanations of how it reaches the conclusion and is flexible so that it can easily add or update its existing knowledge (Buchanan & Smith, 2003). Expert system is a branch of applied artificial intelligence developed in mid 60. The principle behind an expert system is basically transferring the expertise from human to computer. Expert systems could aid non-experts to perform better instead of replacing the experts entirely. One of the purposes of expert systems is to make expert’s knowledge and experience more widely available (Efraim Turban & Aronson, 2001). Expertise from human would be stored in a database and when the knowledge is needed, users or programs could easily retrieve the knowledge stored in the database when needed. The expert
system should be able to make inferences and comes to a conclusion. Much like a human expert, the expert system should have the capability to explain the logic that it uses in order to come up with a conclusion (Efraim Turban and Aronson, 2001). 2.5. Architecture of an expert system The basic architecture of an expert system comprises of four modules (Wang, 1994): 1. Working memory – To temperately store the data and the facts during program execution. 2. Inference Engine – To execute rules which reside in the rule base with forward chaining capability. 3. Knowledge base – A rule base with rules in the following form: IF
THEN ELSE 4. User Interface – The screen that users interact with the system. 5. Explanation Facility – The ability to trace rules used to reach the conclusions. 6. Knowledge Acquisition Facility – The user interface used by knowledge engineers to convert expert knowledge into rules. It also allows adding, editing and deletion of rules in the knowledge base. The development of functional expert systems is always centered on the organization of a knowledge base. Fig. 2-2 shows the typical integration of expert systems components. Knowledge engineers collects and organizes knowledge gathered from domain expert then convert the expert knowledge into a form which
Fig. 2-2. Integration of expert systems components.
Table 2-1 Lists the history of Microsoft’s web development technologies. Period
Technology
Strengths
Weakness
1993 1996 1996 2002 2005 2007 2008
Common Gateway Interface (CGI) Microsoft Internet Database Connector Active Server Pages (ASP) ASP 1.0/1.1 ASP.NET 2.0 ASP.NET AJAX ASP.NET 3.5
Simple, flexible, only option at the time Runs inside a web server General-purpose Compiled ‘‘stateful” UI Vast infrastructure Encourages object oriented programming
Runs outside of the web server, resource intensive, low level Simply a wrapper for SQL queries and templates for the result Interpreted at run-time, encourages spaghetti code Heavy on bandwidth, ugly HTML, untestable
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
computer expert system understands and save those converted knowledge into the knowledge base. Users enter the collected facts into the system via the user interface and save the data into the fact base. Finally, users get the results, recommendations and explanations from the system. As we can tell from Fig. 2-2, an expert system communicates with the end users through the user interface while gathers the knowledge it required through a knowledge acquisition interface which is used by knowledge engineers. Therefore, the expert system has two features. 1. Frequent user interactions: An expert system collects data from the users and formulates the end results based on these data. 2. Independent and dynamic knowledge base: The major difference of an expert system from a traditional program is that the knowledge is independent from the program flow. Knowledge engineers could create, modify or delete the content of the knowledge base as the knowledge evolves. Knowledge contents could be updated without the need to recompile and redeploy the application. The knowledge base contains the problem-solving rules that was gathered and converted from human experts in a given problem domain. The representation of knowledge in a knowledge base is usually in the following form. IF THEN ELSE Conditions are expressions involving attributes, in our case; it contains the patient’s biochemical data, anthropometric measurements, physical exam findings, food/nutrition history, and diseases/conditions. An action list consists of a single function in our system, which is AddDiagnosis(). Thus, a full example of a rule might be similar to the following: IF this.BMI < 18.5 THEN this.AddDiagnosis(‘‘Underweight”). It is the knowledge engineer’s job to translate the knowledge gathered from domain experts to the knowledge base. The inference engine is responsible for searching applicable rules from the knowledge base to apply to a certain problem. In recent years, the proliferation of World Wide Web has enabled web-based expert systems. Web-based expert systems have been proposed in several knowledge domains such as fish disease diagnosis (Li, Fu, & Duan, 2002), pig disease diagnosis (Zetian, Feng,
2137
Yun, & XiaoShuan, 2005), and nutrition advising (Huse & Shyne, 1992). 2.6. The application area of expert systems The major application areas for expert systems include but not limited to the following (Shu-Hsien, 2005): Interpretation, Prediction, Diagnosis, Planning, Design, Monitoring, Debugging, Instruction, and control. 1. Interpretation: Based on raw data to generate meta information. 2. Prediction: Predict the future status based on current status. 3. Diagnosis: Diagnose the problems based on current conditions. 4. Planning: Create a flexible correctable initial plan. 5. Design: Generate design with a given set of data. 6. Monitoring: Monitor the predefined goals, record and compare the data. 7. Debugging: To issue instructions to correct the defects. 8. Instruction: To educate the user regarding to diagnosis or debugging. 9. Control: Systematically controlling of actions. 2.7. Rule-based expert system A rule-based expert system is an expert system that contains the knowledge of human experts, and represents human knowledge in the form of rules in a data storage as IF-THEN-ELSE statements. The computer program will then make inferences to these rules to the data in order to reach to a suitable conclusion. Rule based expert systems have been utilized in many different domain areas (Shu-Hsien, 2005), it has also been applied to medical diagnosis. 2.8. The development process of an expert system The major phases of developing an expert system consists the following: 1. Determine the problem area. One of the features of an expert system is that it is designed to solve issues of a specific area. Therefore first step of developing an expert system is to establish the problem area and reduce the
Fig. 3-1. Google trends result for ‘‘MVC web”.
2138
2.
3.
4.
5. 6.
7.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
scope to a level where the system is capable to handle and provides reasonable performance during program execution. Gathering of the knowledge. Expert Systems require containing the knowledge from expert for a specific problem domain in order to make inference and decisions. This is often done by gathering data from literatures or interviewing several domain experts. Determining the knowledge presentation form. After collecting and organizing expert knowledge, knowledge engineers must find a method to convert the gathered knowledge into a form which the computer expert system understands. The major forms to represent expert knowledge in expert systems are rule-based system, frame-based system, semantic networks, neural networks and predicate logic. Selection of platform. We need to choose a platform (operating system) for which the expert system will be running. Selection of language.We need to determine which programming language that we want to use. Selection of the inference engine. In order to actually begin building a knowledge base, we have to select an inference engine according to our decision with regards to the knowledge presentation. Creation of knowledge base. After the completion of organizing and analyzing expert knowledge, knowledge engineers will use the knowledge acquisition interface to build the knowledge base by converting expert knowledge into a form which computer expert system understands and simulate every possible user inputs to the system to test if the knowledge base is working as it is designed.
8. System tests. After the completion of the expert system, we need to evaluate the system’s correctness with real world cases and adjust the knowledge base if the results are unsatisfactory. 2.9. History of web development To appreciate the distinct characteristics of ASP.NET MVC, it is helpful to understand a little history of web development so far. Since this research is based on Microsoft’s technologies. I will only focus on Microsoft’s web development history (see Table 2-1). ASP.NET was a huge step in progress when Microsoft first released it back in 2005. It not only provided developers with a brand new multi-language managed code platform but also tried to make the developer’s experience to be similar for developing a stateful, object oriented windows form program and a stateless HTML based web development. Microsoft tried to hide both HTTP and HTML by modeling the UI as a series of server side control objects. Each control keeps its own state across requests, automatically renders HTML when required and automatically wires client side events such as button click with a corresponding server side event handler codes. In reality, a webform is simply a gigantic abstraction layer. 2.10. ASP.NET MVC ASP.NET MVC framework is a model–view–controller pattern web application framework created by Microsoft. An ASP.NET MVC application is composed of three basic modules: model, view and controller. The model is the core information of the application. It contains the objects that reflect the real world objects
Fig. 3-2. Google trends result for ‘‘Webform”.
Fig. 3-3. MVC architecture.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
and is often connected to a database. The view is the presentation layer (user interface) of the application. In ASP.NET MVC, the view is composed of HTML codes. The controller contains the business logic of the application. It sits between the view and the model to control the execution of the application. The weakness of the traditional ASP.NET. 1. ViewState The behind the scene mechanism that maintains states across requests often results in large amount of data being transferred between the server and the client. It could easily reach hundreds of kilobytes in many real world applications and it is designed so that it travels back and forth with each web requests and resulting in slow websites or web-based applications. 2. Page life cycle This is the mechanism to keep server side event handler to be in sync with the client side actions. This mechanism often gets complicated and resulting hard to debug issues such as when some of the event handlers won’t execute. Managing run time control hierarchy of server controls is always a .NET programmer’s nightmare. 3. Limited control over HTML Server controls render as themselves as HTML. Often the generated HTML does not comply with web standards or take good advantage of CSS. The worst part is that it generates unpredictable and complex ID values, thus making it hard if not impossible to call with custom JavaScript codes. 4. False sense of separation of concerns The code-behind concept makes it possible to separate HTML from the application code. This was thought to be the way to separate logic and presentation, however, in reality with this code-behind model, developers are encouraged to mix their presentation code with logic code. 5. Untestable The architecture of web form based design is not designed with unit test in mind. It is totally incompatible with automated tests. Benefits of ASP.NET MVC 1. Model–view–controller architecture. ASP.NET MVC provides a much better separation of concerns by adopting the MVC (model–view–controller) architecture. MVC architecture is not a new concept. It dates back to 1978 from the
2139
Smalltalk project at Xerox PARC. Web applications integrate several different technologies and often divide into a set of tiers which maps to MVC architecture naturally. 2. Extensibility MVC framework was built as a series of independent components, by implementing an interface or built on an abstract base class. Therefore a programmer is able to easily replace the routing system, the view engine, or any framework components. 3. Testability ASP.NET MVC was designed with automated test in mind. With it, we can now write testing codes for each of the controller and action in the application. Making our program more maintainable. 4. Tight control over HTML While the build in HTML helper produce XHTML compliant output, the framework encourages programmers to write simple HTML codes for UI components and style the UI with CSS. ASP. NET MVC pages do not contain any ViewState data, therefore it allows us to save the bandwidth and maximize the speed of our application.
Table 3-1 Development tools. Server Database Component Language IDE NET Version
Table 3-2 Major entities. Entities Account Anthropometric measurement BioChemical data Diagnosis Diseases Food nutrition history Lab test Patient Physical exam finding Visit
Fig. 3-4. Nutrition diagnosis expert system architecture.
Windows Server 2003 Microsoft SQL server 2008 developer’s edition Telerik Extensions for ASP.NET MVC, jQeury C# Microsoft Visual Studio 2008 .NET Framework 3.5 SP1
2140
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
5. Routing system With the ASP.NET MVC, it became easy for programmers to create neat URLs. For example, we were used to see cryptic URLs such
as /app/default.asp?u=1&book=9&action=2. When using the neat URL, we might have /User/buy/book9. There are many benefits of using a neat URL. First, we can hide the technical details, folder
Fig. 3-5. Nutrition diagnosis expert system domain model.
Fig. 3-6. Database schema for nutritional diagnosis expert system.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
and filename structures from the public, thus making our application more secure. Second, the neat URL is more search engine friendly. Third, users are more likely to remember it. 6. Build upon mature ASP.NET components and facilities Microsoft’s .NET Framework provides a mature, production suite of components and facilities that can be used in the project to save both development efforts and time and increase productivity. Since ASP.NET MVC is based on .NET Framework 3.5, we are able to utilize the extensive set of APIs, components and facilities. 7. NET 3.5 language features ASP.NET MVC is designed with the new features of .NET 3.5 languages in mind. Therefore, it works very well with these new features. The most important recent feature in the advancement of . NET language is the invention of Language Integrated Query (LINQ) LINQ saves programmers many efforts in creating mechanisms to cope with the difference between object oriented programming language and relational database. 2.11. Object oriented programming The notion of object oriented programming is to use computer objects to construct an abstraction of real world objects. An object has properties and method just like the objects in the real world. Object oriented programming is a packaging method that facilitates the creation of meaningful software units. Those units are focused on specific problem areas. Classes represent groups of related objects. For example, apples and oranges belongs to ‘‘Fruit” class, even though they are different in color, taste, size, and textures. A class specifies the general format of its objects; the properties and actions available to an object depend on its class.
2141
One of the major benefit of writing programs with an object oriented approach is it allows us to reuse the code that we wrote, which would save programmers a lot of time for re-inventing the wheels as well as saving time in maintaining the program. Programming techniques for object oriented programming includes data abstraction, encapsulation, modularity, polymorphism, and inheritance. Most major programming languages today are object oriented programming languages. 2.12. Introduction to C# language C# Programming language, developed by Microsoft was designed specifically for the .NET platform. C# has the roots in C, C ++ and Java. Adapting the best features of each and adding new features of its own. C# is an event driven, object oriented, visual programming language for which the programs are created using an integrated development environment (IDE). The programmers can create, run, test and debug C# programs conveniently within the IDE which saves a lot of precious time and increase the productivity of programmers. The process of creating programs rapidly using an IDE is referred to as Rapid Application Development (RAD). 2.13. .NET Framework and the common language runtime The .NET Framework is the core of .NET. This framework manages and executes applications, contains a class library (Framework Class Library), enforces security and provides many other programming capabilities. The details of the .NET Framework are found in the Common Language Specification (CLS), which includes
Fig. 3-7. Domain model for nutritional diagnosis expert system.
2142
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
Fig. 3-8. Detailed Entity Framework model.
Fig. 3-9. Visit entity mapping details.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
2143
is known as platform independence. Code written once can be used on another machine without modification. .NET Framework also provides a feature which enables a high level of language interoperability. Programs written in different languages are all compiled to MSIL. MSIL allows the .Net Framework to be language independent since MSIL is not tied to a particular programming language. Any language that can be compiled into MSIL is called a .NET compliant language. .NET Framework also provides several reusable classes which can be accessed by any .NET language.
2.14. ADO.NET Entity Framework
Fig. 3-10. Rule Set table.
information regarding to the storage of objects and other information. Microsoft has submitted CLS for standardization to ECMA (the European Computer Manufacturers Association). This allows the independent software companies to create the .NET Framework for other platforms. The common language runtime (CLR) is another central part of the .NET Framework. It executes C# codes. Programs are compiled into machine specific instructions in two steps. First, the program is compiled into Microsoft Intermediate Language (MSIL). MSIL defines instructions for the CLR. After that, another compiler in the CLR compiles the MSIL into machine code, creating a single application. The reasons for this two step compiling scheme are portability among operating systems, interoperability among languages and execution management features such as memory management and security. If the .NET Framework is installed on a platform, that platform can run any .Net programs. The ability to run on different platform
According to Microsoft, Entity Framework is not intended to be a replacement of current ADO.NET data access technologies. Instead, it is an enhancement to ADO.NET, giving developers a better approach to accessing data. Allowing developers to work with conceptual model, and therefore enable developers to deal with data as objects and properties, which is the basic concept of object oriented programming. ASP.NET MVC framework does not restrict or regulate the methods we persist our domain model. Here we are facing an issue that most of the developers would face in most object orientated programming. The ‘‘object-relational impedance mismatch”, it is encountered whenever we are trying to use the relational database as the storage solution when writing with an object-oriented programming language such as the one we are using – C#. There exists many methods for application modeling, each has a different focus. The following lists some of the approaches and their focus. 1. ERM (Entity Relationship Model): Used with databases, it is a way to represent logical relationships of objects in order to create a database. 2. UML (Unified Modeling Language): A standard modeling language which is used to describe objects.
Fig. 3-11. Rule Set browser.
2144
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
Fig. 3-12. Type selection.
Fig. 3-13. Rule Set Editor.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
3. ORM (Object-Relational Mapping): Method for mapping objectoriented programming and relational databases. 4. DFD (Data Flow Diagram): A graphical representation of the flow of data between processes and systems. There are other products in the marketplace which provides similar functionalities to Entity Framework, such as the following: 1. NHibernate: This is an open source project which was ported from Hibernate Core for Java for the .NET Framework. It allows persisting plain .NET Objects to and from a backend relational database. 2. Spring.net: An open source application framework which is based on JAVA Spring framework. The abundance of these products showed that there is a need for a good ERM application. The Entity Framework (EF) is an object persistent layer that includes object/relational mapping (O/RM) tool to replace an object graph diagram for the traditional relational database schema. The responsibility of a persistent layer are to instantiate a desired set of object instances in memory together with a representation of their associations and able to save the in-memory changes to objects and to their property values to rows and columns of a relational database. The Entity Framework is a set of Microsoft technologies which helps fill in the space between object oriented
2145
programming model and relational databases. This is commonly known as ‘‘impedance mismatch”. It exists due to the fact the mapping and organization of classes does not match with the organization of relational objects. Developers used to have to write huge amounts of codes just to persist the data to the database, with the help of Entity Framework; developers can save a lot of time and effort and focus the attention on developing the core function of the program. 2.15. WF rule-engine The major part of an expert system is the rule-engine. There’re many open source and commercial rule engines available to use. For this research, I have chosen to use the rule-engine that comes with every installation of .NET framework 3.5 SP1. I used the rule engine capability contained within Windows Workflow Foundation outside of a workflow, and leverage it to act as the main inference engine for the nutritional diagnosis expert system. Windows Workflow Foundation (WF) that came with .NET Framework 3.5 SP1 includes a free and powerful rule engine, allowing the Workflow developer to logically divide the application’s business rules from the Workflow Assemblies. Rules enabled programmers to represent and implement the business requirements of the application into a set of declarative statements, which can be imposed at runtime (Willis, 2006).
Fig. 3-14. Rule Set Editor with IntelliSense support.
2146
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
Each rule is composed of three separate parts: 1. An If conditional statement which returns a Boolean value. 2. A Then statement that is executed if the ‘‘if” condition returns true. 3. An optional else statement which is executed when the ‘‘if” condition returns false. Collectively, these three parts form an if-then-else construct that works like C#’s if-then-else statement. A rule is executed by evaluating the condition and then executing one of the actions depending on the result from the condition. Each action could contain one or more C# statements that are executed in sequence. During the rule set execution, each rule is fired, and the appropriate actions performed. There are several ways that we can control the sequence in which the rules in a rule set are evaluated. The default is that the rules are fired in alphabetical order based on the rule name. We could change the default ordering by modifying the priority of our rules. Those rules with higher priority will be evaluated first, when both rules has the same priority, the system will determine the ordering by alphabetical order of the rule names. The rule engine has a feature called forward chaining, what it means is that the system will automatically re-evaluate the rules. It monitors the dependency of each rules. If a rule changes a variable that is referenced in a condition of a previously evaluated rule, forward chaining would fire that rule again automatically. Originally, Microsoft designed the WF Rules to be used with WF programs. However, in our Nutritional Diagnosis Expert System, we do not intent to implement with WF program; instead we only
intended to utilize the rule engine that came with WF. For the purpose of our program, we have three expectations for the use of this rule engine. 1. We need a way to externalize a rule set, so that we do not need to call it within a WF program. 2. We will need to figure out how to apply a set of rules to ASP.NET MVC programs. 3. We will need the rules to be stored in a database and to have a program which allows IT personnel to create or update rules. Typically, in a WF program, Rules are defined in the Workflow are serialized to a .rules XML file which is compiled and became an embedded resource for the Workflow assembly. At the runtime, the .rules resource is then de-serialized and evaluated. While this method is fine with some types of application, it does not fit our Nutritional Diagnosis Expert System’s requirement. We do not want to recompile and re-deploy our application every time the rules are modified.
3. Research material and method 3.1. MVC architecture The nutritional diagnosis expert system has adopted Microsoft’s ASP.NET MVC as its development framework. ASP.NET MVC offers a much improved separation of concern than traditional WebForm based web development framework.
Fig. 3-15. Login screen.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
The MVC pattern is not a new concept; it was first implemented by Trygve Reenskaug in Xerox PARC back in 1978 (Reenskaug, 1978). The fundamental idea of MVC is to bridge the gap between the human’s mental model and the digital model that exists in the computer. The ideal MVC solution is the one in which the developers feels like they are directly manipulating the real world object (Shan, 1989). The structure is useful if the developer needs to see the same model element simultaneously in different contexts and/or from different viewpoints. From Google Trends, I used the keyword, ‘‘MVC web” and ‘‘webform” to analyze the search trends for these 2 web development technology and found out that the search for the keyword ‘‘MVC web” has increased its popularity steadily and continue to do so for now while the search for the keyword ‘‘webform” is on the declining curve since the peak in 2004. The results are presented in Figs. 3-1 and 3-2. MVC architecture is gaining popularity today especially in web development area. The reasons maybe the following (see Fig. 3-3): 1. User interaction with MVC application is suitable for web applications. Usually a user takes an action and the application changes the data model and then displays an updated view to the user. This similarity makes MVC a fit for web applications we use today. 2. Web applications today combines several different technologies including databases, HTML, JavaScript, binary codes, etc. In order to simply the complexity, a web application is usually split into tiers or layers, this pattern resembles MVC pattern.
2147
3. ASP.NET MVC implements a modern deviation of MVC which is specifically designed to web applications. 3.1.1. Model A model is a representation of reality. Most system models can be represented graphically. It could be either a single object or it could contain multiple objects with relationships among them. There are several notations for data modeling. The actual model is usually called ‘‘entity relationship diagram” (ERD) since it explains the data in terms of the entities and relationships described by the data. We need a concept to abstractly represent all instances of a group of similar things. This concept is called an entity. An entity is something we want to store data. These entities have attributes and behaviors similar to those found in the real world. A key benefit of implementing our own domain model is that we could design it according to the language and terminology dietitians are using in their daily practices. This makes it much easier for developers to communicate with entire team. Finding a suitable name for our entities, operations, and relationships that makes sense not only to the developers but also professional dietetics would really benefit the entire team and increase the efficiency of communication among all parties. 3.1.2. View A view visually represents a model. Usually it would only display certain parts of the model therefore it is acting as some kind of a presentation filter. It is attached to the model and gets the data from the model by issuing queries. A view may also update the model by sending the model some predefined instructions.
Fig. 3-16. Patient list.
2148
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
In web applications, the view is usually a HTML file which might contain some JavaScript codes. It is also possible to return a view in XML format or other format such as a spreadsheet or a PDF file.
1 presents the software tools used to develop the nutritional diagnosis expert system.
3.1.3. Controller A controller links a user to the system. It provides users with input capabilities with one or a combination of multiple views. It receives user inputs and presents users with the output of the program using different views.
The first step of implementing a program is to create a domain model. The method of modeling I will be using is called domaindriven design. This methodology models the objects to represent the problem domain. The domain model is the object graph which represents the business domain of the software. They are rich objects with properties and methods that mimic the behaviors as in the real world. We need to figure out what our major entities are in the system. Basically, we will do so by picking out the nouns from requirement statement such as the following:
3.2. System architecture The architecture of the system is shown in Fig. 3-4. First, the dietetic professionals create the nutrition diagnosis guidelines based on their researches and experiences which in this study we used the research result from a Department of Health of Taiwan, ‘‘Establishing and studying the model of nutritional diagnosis” (Lee, 2005). Then knowledge engineers work with dietetics professionals to convert the guideline into computer readable rules by using a rule editor with IntelliSense support.
3.4. Implementation3.4.1. Domain model analysis
1. A patient will visit dietitians many times. 2. Dietitian will record the patient’s physical exam findings, anthropometric measurement, biochemical data from lab tests, as well as food/nutrition histories. 3. A visit will result in one or more nutritional diagnosis. 4. The system has many accounts. 5. The account has to enter a password in order to use the system.
3.3. Development tools The nutrition expert system is developed using Microsoft Visual Studio 2008 and is written in C# programming language. The backend database is Microsoft SQL server 2008 developer’s edition. The finished web application is hosted on Microsoft Windows. Table 3-
We use this set of nouns as our starting point to identify the entities we will have in the system. I have listed the major entities for our nutritional diagnosis expert system in Table 3-2. Once we have our initial list of entities, we need to map the relationships among these objects. Fig. 3-5 shows the domain
Fig. 3-17. Patient details.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
model of the nutrition diagnosis expert system. The domain model forms the core structure of our expert system. The data model focuses on what would be stored in the database. The database design process includes the following steps. 1. Requirement collection. During this step, the developer interviews the database user. Developers gain the detailed knowledge of data requirement. 2. Database schema Database schema is created. It is the description of data requirements of the users. It includes descriptions of data types, relationships and constraints. 3. Actual implementation of database 3.4.2. Entity relationship model (ERM) Dr. Peter Chen presented his paper, ‘‘The entity – relationship model – toward a unified view of data” at the International Conference on Very Large Databases in September, 1975. He claimed that his Entity Relational Model (Chen, 1976): 1. ‘‘Adopts the more natural view that the real world consists of entities and relationships.” 2. ‘‘Incorporates some of the important semantic information about the real world.” 3. ‘‘Can be used as a basis for a unified view of data [stored in network, relational, and entity set models”. 4. ERM have been widely accepted by data-oriented architects and developers. There are several tools available on the market today such as the CA Erwin Data Modeler. Microsoft Office Visio Professional also supports ER diagram.
2149
3.4.3. Database schema creation After completing the design phase of the entity relationship model design, we need to create a database so that we are able to save data. I have created a corresponding database in Microsoft SQL server and the schema is shown in Fig. 3-6. 3.4.4. Generating the domain model In MVC, M stands for model; it is a software representation of real world objects, processes and rules. A domain model defines the scope and forms the foundation of the entire program, the rest of the codes are simply methods required to expose the model to the user interface. It is basically a project glossary. Once we created the domain model, all individual involved in this project would have a set of standard terms to communicate to each other. Domain model allows us to view the foundation of the program graphically and it shows how all these different terms relate to each other. We can view the domain model as a simplified class diagram with lines that shows us the relationship between different classes (domain objects). It shows both aggregation (has-a) and generalization (is-a) relationships. We will use Microsoft’s Entity Framework as the chosen technology for developing our model. Entity Framework is Microsoft’s preferred relational data management architecture. It is not merely an object relational modeling tool. Entity Framework maps a schema of an underlying relational database to an entity data model, which is based on Dr. Peter Chen’s Entity-Relationship model. There are three XML files defining the physical (relational), mapping and conceptual schema of layers to make the transformation from the relational model to the entity data model. To query the
Fig. 3-18. Visit details.
2150
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
entity data model, entity framework provides a SQL-like language called Entity SQL which returns IQueryable collections of entities (EntitySets). Alternatively, we could use LINQ to Entities to get the same results. I have created the entity data model using entity framework by generating the actual domain model classes from the database. Fig. 3-7 shows the overview of the generated entity framework model of nutritional diagnosis expert system. Fig. 3-8 shows the detailed version of the generated entity framework model. When the entity model is generated by the entity framework from the database, the system automatically maps the properties of the entity to the matching column of a table in the relational database. We can see the mapping of the Visit entity in Fig. 3-9. 3.4.5. Database table for knowledge base The Rule Database contains a table called RuleSet and the rules are serialized into XML format and stored in the column ‘‘RuleSet”. The status column stores the result of the validity of the RuleSet. In our program, we could utilize this demo and use it as our rule editor and make use of its mechanisms for saving rules to a database. 3.4.6. Rule Editor The Rule Editor is the user interface for the knowledge engineer to interact with the knowledge base. It is a windows form application which connects to the database server containing the knowledge base. A screen shot of the Rule Set Editor is shown in Fig. 3-10. From the Rule Store menu, we can load our Rule Sets from the database and save any changes made to the Rule Sets.
When a user starts the Rule Set Editor, the program will load the Rule Sets from the existing configured database automatically. The Rule Set Editor allows a user to keep several versions of Rule Sets simultaneously by providing the version control. When a user clicks New, the program will create a new Rule Set and applies it with version 1.0. When a user copies a Rule Set, the program will copy the highlighted Rule Set and assigns it with a unique version number. 3.4.7. Rule Maintenance The rules are associated with a single .NET type, in our case; this type would always be a patient data type. We assign the type by clicking on the Browse button in the Associated Type section. Then we browse to the DLL where our Nutrition Diagnosis Expert System’s domain model exists and select the DLL file as displayed in Fig. 3-12. This step instructs the system that we are applying our rules to the Patient object in our domain model. Every conditions and actions of every rule will be evaluated against the patient entity (see Fig. 3-11). When we click Edit Rules, the Rule Set Editor shows up as in Fig. 3-13. This user interface is where the knowledge engineer or trained dietetics professionals could use to create, update or remove nutrition diagnosis rules in the knowledge base. It includes IntelliSense support just like the IntelliSense features in Visual Studio IDE. When the knowledge engineer is editing the rule, the IntelliSense will automatically show the properties available as the user types. This feature is shown in Fig. 3-14. With the help of IntelliSense
Fig. 3-19. Lab test values.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
support, the knowledge engineers can edit the rules much faster without the need to reference to the documentation to find out what properties are accessible for the entity, which, in our case, the Patient. 3.4.8. User Interface The Nutrition Diagnosis Expert System is hosted on an IIS web server running Microsoft Windows 2003. Users will have to enter their user name and password in order to login to the system. The login screen is shown in Fig. 3-15. After user login, he or she will see a menu bar which acts as the main navigation for the entire application. The menu bar contains the following. 1. Home: To go back to the home screen. 2. Patient: To create/search/edit patient account 3. Administration: Provided for some maintenance tasks. This menu item will only be visible to accounts with admin privileges. In the patient listing page, users will see a list of all patients in the system (Fig. 3-16). From this list, users have the options to edit patient’s basic information, go into the detailed patient information or ask the system to perform nutritional diagnosis on the selected patient based on current patient data. The list is designed so that it will display 10 patients per page and it allows easy sorting as well as filtering/search on each column. This allows fast searching for the users. If the user knows the patient’s Hospital ID, he/she can also use the search function under the patient menu.
2151
In the patient details page (Fig. 3-17), user can view the details of the patient, including patient’s visit ordered by visit day with the latest visit on top. This is also where the user set patient’s disease. The disease section will affect the rules used in nutrition diagnosis since some standard ranges for biochemical values are different for patient with different diseases/conditions. If this is a new patient, user can add a new visit to the patient by clicking on the New Visit link. To view the Visit details, click on the Detail link of the visit that you want to view. Fig. 3-18 shows a visit detail page (see Figs. 3-19–3-23). The Visit Details page is where a user enters or selects the data collected during the nutritional assessment step of the nutrition care process; including lab tests values, anthropometric measurements, physical exam findings, and Food/Nutrition History. Each function is shown in the following figures. It also displays the diagnosis associated with this selected visit at the bottom. In the administration user interface, users can manage multiple data which are used by the system including account, disease, diagnosis, anthropometric measurement, physical exam findings, food/nutrition history and biochemical data. When the user clicks on the report link in the visit, the system will generate a nutrition diagnosis report which lists the relevant definitions for the nutritional diagnosis related to the visit of that particular patient. 3.5. Constructing the knowledge base 3.5.1. Knowledge base coverage The source of the knowledge of the nutrition diagnosis expert system is from the research result of Department Of Health
Fig. 3-20. Anthropometric measurements.
2152
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
research project, ‘‘Establishing and Studying the Model of Nutritional Diagnosis” which includes 36 nutrition diagnosis definitions, 8 behavioral nutrition diagnosis definitions and 14 special disease nutritional diagnosis definitions for adults. It also included 21 nutrition diagnosis definitions for children. For the purpose of this study, I have converted 36 adult nutrition diagnosis definitions plus 14 special disease nutrition diagnosis into the rules and saved them into the knowledge base. Currently the system is able to diagnose 50 different nutritional diagnoses. Table 3-3 shows the list of nutritional diagnosis we have in the knowledge base. 3.5.2. Knowledge conversion We converted 50 nutritional diagnosis definitions from the research result of ‘‘Establishing and Studying the Model of Nutritional Diagnosis” to expert system rules using the Rule Set Editor we have mentioned in Section 3.4.6. 4. Evaluation and result analysis 4.1. Chronic kidney disease The increase in the number of patients with chronic kidney disease has prompted the National Institute of Health to include CKD as a focus area in the Healthy People 2010 initiative (Healthy People 2010, 2000). Healthy People 2010 is a set of health objectives for United States to achieve over the first decade of the new century proposed by National Institute of Health. One of the objectives in the 2010 guidelines is to reduce the rate of new cases of end
stage renal disease. Another one is to reduce the mortality rate related to chronic kidney disease. Chronic kidney disease is defined as a glomerular filtration rate (GFR) < 60 mL/min/1.73 m2 of body surface area for P3 months (Levey et al., 2005). The prevalence rate of chronic kidney disease in US is 4.7% and has become the nation’s ninth leading cause of death and it was estimated the cost of health care for end stage renal disease would cost US$28.3 billion by 2010 (Kuo, Tsai, Tiao, & Yang, 2007). In United Kingdom, the number of end stage renal disease has doubled in the past decade. In Taiwan, chronic kidney disease has been the eighth leading cause of death since 1997. Taiwan’s national health insurance spends about 7.21% of its annual budget for dialysis alone (Hsu et al., 2006). Both incidence and prevalence of end stage renal disease are among the highest in the world. 4.2. Protein-Energy Malnutrition (PEM) for hemodialysis patients According to Devereaux, despite technological advances in dialysis techniques, the mortality rate in the states for dialysis patients is unacceptably high at around 20% per year (Devereaux et al., 2002). PEM is one of the major risk predictor of death for dialysis patients; it is also believed that nutritional intervention might improve the poor outcome in dialysis patients (Kaysen, 2000). 4.3. System evaluation We have decided to select CKD patients who are under hemodialysis treatment as out test subjects and we will focus on the
Fig. 3-21. Physical exam findings.
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
nutritional diagnosis of Protein-Energy Malnutrition (PEM) for these patients. In this study, we have sampled 100 such patients from a university hospital and recorded each patient’s albumin, cholesterol, creatinine level before dialysis and BMI calculated with patients’ dry weight. The patient’s data is presented in Table 4–1. After we have gathered all patients’ data, we input the data into the system and performed our nutritional diagnosis, and then we compared the expert system’s diagnosis result with a human expert’s result. We also recorded the time for both human expert and the expert system’s nutritional diagnosis time to make a comparison. The definition of Protein-Energy Malnutrition (PEM) for dialysis patient is as the following: 1. 2. 3. 4.
Albumin < 4.0 g/dL or PreAlbumin 6 30 mg/dL. Cholestrol 6 150 mg/dL. Creatitine before dialysis < 10 mg/dL. BMI based on dry weight < 18.5 kg/m2 or lost of dry weight of more than 10% in 6 months or lost of dry weight of more than 5% in 1 month.
In our rule base, it is converted to the following syntax using the Rule Set Editor: (this.Albumin < 4.0 || this.PreAlbumin 6 30) && this.Cholesterol 6 150 && this.CreatinineLevelBeforeDialysis < 10 && (this.Anthro.Contains(2) || this.Anthro.Contains(3) || this.DryBMI < 18.5) && (this.DiseaseList.Contains(2) || this.DiseaseList.Contains(3)).
2153
4.4. Nutritional diagnosis result Our test result shows that human expert has diagnosed 7 patients out of 100 patients with Protein-Energy Malnutrition (PEM) while our expert system diagnosed four patients with PEM as presented in Table 4–2. After careful re-examination and discussion with professional dietetics, we concluded that the human expert misdiagnosed three patients while the expert system correctly diagnosed all 100 patients. Therefore, our expert system is more accurate than a human expert. Table 4–3 presents the patients diagnosed with PEM HD by nutritional diagnosis expert system and the dietitian. Table 4–4 compares the time spent on making nutritional diagnosis between our expert system with an experienced dietitian. The result shows our nutritional diagnosis expert system is faster than a human expert.
5. Discussion 5.1. Research limitation 1. Due to the time limit of this study, we can only focus on a single nutritional diagnosis for a particular patient group, namely PEM for hemodialysis patient. In the future we could examine other diagnosis as well. 2. In this study, we rely heavily on labor intensive manual input of various patient data such as patient basic data, biochemical
Fig. 3-22. Food nutrition history.
2154
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
Fig. 3-23. Nutrition diagnosis report.
Table 3-3 Nutrition diagnosis in the knowledge base. Underweight Overweight Mild Obesity Moderate Obesity Severe Obesity Morbid Obesity Abdominal Obesity Excessive Percentage of body fat Significant weight loss Severe weight loss Mild PEM Moderate PEM Severe PEM Kwashiorkor Marasmus Excessive caloric intake Adequate caloric intake Inadequate caloric intake Extreme energy restriction Excessive carbohydrate intake Inadequate carbohydrate intake Excessive sugar intake Excessive total fat intake Inadequate total fat intake Excessive protein intake Inadequate protein intake Excessive dietary fiber intake Inadequate dietary fiber intake Excessive cholesterol intake Excessive sodium intake
Excessive mineral intake Inadequate mineral intake Excessive Vitamin Intake Inadequate Vitamin Intake Excessive Fluid Intake Inadequate Fluid Intake PEM for HD&PD Inadequate caloric intake - HD&PD Excessive protein intake – Chronic Renal Failure Inadequate protein intake – HD&PD) Inadequate HBV protein intake – Renal Disease Excessive sodium intake – Renal Disease Excessive phosphate intake – HD&PD Excessive potassium intake – HD&PD Excessive water intake – HD Excessive SFA intake – hyperlipidemia
data, anthropometric measurement, physical exam findings, and food/nutrition history since the system is not connected to the hospital information system directly. This results in the lack of efficiency and redundancy of labor. We suggest in the future research, the system could connect directly with hospital information system to retrieve relevant patient data directly to reduce the workload of dietitians in the clinical setting and therefore increase the usability of the system. 3. Nutritional diagnosis rules (a) Need to find a way to deal with descriptive data types so that the rules could include other data such as physical exam findings and food/nutrition histories in addition biochemical data and anthropometric measurements.
2155
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156 Table 4-1 Patient data.
Table 4-1 (continued)
Patient
Serum Albumin
Total cholesterol
Creatinine level before dialysis
Dry BMI
TEST1 TEST2 TEST3 TEST4 TEST5 TEST6 TEST7 TEST8 TEST9 TEST10 TEST11 TEST12 TEST13 TEST14 TEST15 TEST16 TEST17 TEST18 TEST19 TEST20 TEST21 TEST22 TEST23 TEST24 TEST25 TEST26 TEST27 TEST28 TEST29 TEST30 TEST31 TEST32 TEST33 TEST34 TEST35 TEST36 TEST37 TEST38 TEST39 TEST40 TEST41 TEST42 TEST43 TEST44 TEST45 TEST46 TEST47 TEST48 TEST49 TEST50 TEST51 TEST52 TEST53 TEST54 TEST55 TEST56 TEST57 TEST58 TEST59 TEST60 TEST61 TEST62 TEST63 TEST64 TEST65 TEST66 TEST67 TEST68 TEST69 TEST70 TEST71 TEST72 TEST73
4.2 4.5 3.6 3.9 3.8 4 4.2 2.9 3.4 4.4 3.9 3.5 6.9 3.3 4.3 4.4 4.3 4.2 4.2 3.3 3.9 3.8 4.3 3.3 4.2 3.6 4 4 4.1 4.3 3.9 4.1 4.3 3.9 4.6 3.8 4 4.1 3.3 3.7 3.7 3.5 3.8 4.3 4.2 4.1 3.9 3.7 4.2 3.3 4 4.3 2.3 4.1 4.2 4.1 3.7 4 4 4.3 4.4 3.7 3.6 4.1 4.1 3.5 4.6 4.4 4.4 1.8 3.8 3.7 3.9
210 211 109 127 132 199 151 117 213 147 117 193 219 137 198 176 113 212 141 170 220 167 202 187 245 200 118 192 184 162 131 249 229 164 223 119 120 117 131 222 133 215 196 195 218 123 140 206 137 106 176 223 136 123 209 179 155 169 135 350 363 144 118 208 146 172 180 152 205 104 149 142 228
6.6 10.2 11 5.2 4.5 9.4 8 8.3 8.7 12.2 9.4 9.4 13.5 7.6 9.6 7.8 9.8 6.6 7.4 5.9 11 4.8 6.9 4.1 11.7 15.5 7.1 9.9 11.1 12.1 10 10.8 8.5 14.1 13.4 6.6 6.8 11.9 5 14.7 8.8 11.2 4.4 12.2 9.7 13.9 9.9 9.5 10 7.6 11.8 17.8 4.4 12.3 12.4 6.4 9.4 5.6 10.8 12.3 10.9 6.7 8.8 9.9 8.7 6 6.5 11.5 9.4 2.4 11.2 9.6 10.9
23 22.3 29.2 15.2 25.8 25.9 23.4 22.4 20.5 23.6 25.2 18.5 25.8 29.2 24.8 28.8 30.2 23 24.3 18.9 17.6 20.5 25 28.4 28.8 22.1 28.5 25.5 20.4 22.8 19.6 24.2 22.1 26.5 20.5 23.9 27.2 27 25.1 22.8 22.8 20.7 22.9 22.4 22.3 23.6 19.5 25.7 20.9 24.1 24.2 24.2 24.9 32.1 34.2 20.7 33.4 15.3 23.1 23.3 24.7 18.3 19.9 24.3 32 21.4 19.9 21.6 16.6 16.8 24.6 22.1 20.9
Patient
Serum Albumin
Total cholesterol
Creatinine level before dialysis
Dry BMI
TEST74 TEST75 TEST76 TEST77 TEST78 TEST79 TEST80 TEST81 TEST82 TEST83 TEST84 TEST85 TEST86 TEST87 TEST88 TEST89 TEST90 TEST91 TEST92 TEST93 TEST94 TEST95 TEST96 TEST97 TEST98 TEST99 TEST100
3.5 3.7 3.8 2.9 3.4 3.4 2.7 3.5 4.1 3.8 4.1 3.5 4.2 3.9 4.6 5.5 4.1 3.9 3.8 4.3 3.5 4.2 4.1 4.4 4.2 4.3 4
142 207 200 212 160 161 92 161 217 227 158 134 129 179 180 216 161 170 195 131 220 148 115 217 173 132 183
8.7 13.1 10 5.2 8.9 5 12 9.5 12.1 13.2 11.7 7.5 12.9 9 11.5 11.7 10.5 12.6 10.8 11.4 9.2 15.3 10.5 10 11.7 11 10.8
23.8 18.3 17.2 21.4 18.5 23.7 20.8 24 21.5 23.5 17.8 23.7 18.7 23.5 19.2 19.8 24.5 24.5 33.4 24.5 26.8 25.3 20.4 19.5 20.6 18.6 25.3
Table 4-2 PEM nutritional diagnosis result.
PEM patients Total patients
Dietitian
Expert system
7 100
4 100
Table 4-3 Patient diagnosed with PEM HD. Expert system
Dietitian
TEST4 TEST62 TEST70 TEST85
TEST4 TEST12 TEST62 TEST70 TEST77 TEST79 TEST85
Table 4-4 Nutritional diagnosis time.
Diagnosis rules Average diagnosis time
Dietitian
Expert system
1 1.96 s
50 1.3 s
Table 5-1 Database access performance. Type of database access method
Access time in seconds
SQL DataReader SQL DataSet LINQ 2 SQL Entity Framework
1.923 1.625 3.861 4.141
2156
Y. Chen et al. / Expert Systems with Applications 39 (2012) 2132–2156
(b) Need to define which rules are applicable which disease more precisely for each nutritional diagnosis definition. For example, a nutritional diagnosis of overweight, for subjects without hemodialysis, the diagnosis rule is 24 6 BMI < 27. Here, we calculate the BMI based on subjects’ body weight. However, when the subjects are hemodialysis patients, we would need to use subjects’ dry weight to calculate BMI instead of body weight. This is not clearly stated in the research result of Lee’s study in 2005 (Lee, 2005). (c) Need to make sure that there are no contradictions in diagnosis. (d) Need to adopt a standard terminology in terms of descriptive signs and symptoms. 6. Entity Framework performance issue After completing the programming of nutritional expert system I have built for this study, during testing phase, I have found that the performance of the system is not very fast. It took longer time than I have expected to come up with nutritional diagnosis. When trying to tune up the system for faster diagnosis performance, I have found out that the main culprit is in the database access methodology that I have chosen. I found out that Entity Framework 1.0 which Microsoft released with Visual Studio 2008 SP1 does not perform very well. I have written a performance test program to compare 4 types of database access. For each method, I queried against the database to list a patient’s diseases for one thousand times and recorded the time it took for the program to execute. The result is listed in Table 5–1. The result shows that the fastest method is with SQL DataSet while the slowest one is Entity Framework 1.0. While Entity Framework brings many programming features, we must also consider its downside of performance issue. I would recommend in the future research; we might find another method to write the codes for the database access part of the program to prevent the performance issue. 7. Conclusion In this research, I have constructed a rules-based nutritional expert system which contains 50 different nutritional diagnosis rules. It allows professional dietetics to record the data collected from nutritional assessment and perform nutritional diagnosis by evaluating patient’s data with each rule and outputs a diagnosis report for each patient. From our experiment results, we found that our nutritional diagnosis expert system can help dietitians to make their nutritional diagnosis more accurate as well as helping them to make nutritional diagnosis faster. References Buchanan, B. G., & Duda, R. O. (1982). Principles of rule-based expert systems advances in computers. Stanford University. Buchanan, B. G., & Smith, R. G. (2003). Fundamentals of expert systems. Annual Review of Computer Science, 3(1), 23–58. doi:10.1146/annurev. cs.03.060188.000323. Bueche, J. (2008a). Nutrition care process and model part I: The 2008 update. Journal of the American Dietetic Association, 108(7), 1113–1117. doi:10.1016/j. jada.2008.04.027. Bueche, J. (2008b). Nutrition care process part II: Using the international dietetics and nutrition terminology to document the nutrition care process. Journal of the American Dietetic Association, 108(8), 1287–1289. doi:10.1016/j. jada.2008.06.368. 1291–1293.
Chen, P. P.-S. (1976). The entity-relationship model – toward a unified view of data. ACM Transactions on Database Systems, 1(1), 9–36. . Devereaux, P. J., Schunemann, H. J., Ravindran, N., Bhandari, M., Garg, A. X., Choi, P. T.-L., et al. (2002). Comparison of mortality between private for-profit and private not-for-profit hemodialysis centers: A systematic review and metaanalysis. JAMA, 288(19), 2449–2457. doi:10.1001/jama.288.19.2449. Efraim Turban, P. D., & Aronson, Jay E. (2001). Decision support systems and intelligent systems (5th ed.). Prentice-Hall. Feskanich, D., Sielaff, B. H., Chong, K., & Buzzard, I. M. (1989). Computerized collection and analysis of dietary intake information. Computer Methods and Programs in Biomedicine, 30(1), 47–57. doi:10.1016/0169-2607(89) 90122-3. Hakel-Smith, N., & Lewis, N. M. (2004). A standardized nutrition care process and language are essential components of a conceptual model to guide and document nutrition care and patient outcomes. Journal of the American Dietetic Association, 104(12), 1878–1884. doi:10.1016/j.jada.2004.10.015. Healthy People 2010. (2000), 2010, from . Hoggle, L. B., Michael, M. A., Houston, S. M., & Ayres, E. J. (2006). Nutrition informatics. Journal of the American Dietetic Association, 106(1), 134–139. doi:10.1016/j.jada.2005.10.025. Hsu, C.-C., Hwang, S.-J., Wen, C.-P., Chang, H.-Y., Chen, T., Shiu, R.-S., et al. (2006). High prevalence and low awareness of CKD in Taiwan: A study on the relationship between serum creatinine and awareness from a nationally representative survey. American Journal of Kidney Diseases, 48(5), 727–738. doi:10.1053/j.ajkd.2006.07.018. Huse, S. M., & Shyne, S. S. (1992). Nutrition advisor expert system. Expert Systems with Applications, 4(4), 423. doi:10.1016/0957-4174(92)90136-g. Kaysen, G. A. (2000). Malnutrition and the acute-phase reaction in dialysis patients – How to measure and how to distinguish. Nephrology Dialysis Transplantation, 15(10), 1521–1524. doi:10.1093/ndt/15.10.1521. Kuo, H.-W., Tsai, S.-S., Tiao, M.-M., & Yang, C.-Y. (2007). Epidemiological features of CKD in Taiwan. American Journal of Kidney Diseases, 49(1), 46–55. doi:10.1053/j. ajkd.2006.10.007. Lacey, K., & Pritchett, E. (2003). Nutrition care process and model: ADA adopts road map to quality care and outcomes management. Journal of the American Dietetic Association, 103(8), 1061–1072. doi:10.1016/s0002-8223(03)00971-4. Lee (2005). Establishing and studying the model of nutritional diagnosis (DOH94TD-F-113-047). Lee, R. D., Nieman, D. C., & Rainwater, M. (1995). Comparison of eight microcomputer dietary analysis programs with the USDA Nutrient Data Base for Standard Reference. Journal of the American Dietetic Association, 95(8), 858–867. doi:10.1016/s0002-8223(95)00240-5. Levey, A. S., Eckardt, K.-U., Tsukamoto, Y., Levin, A., Coresh, J., Rossert, J., et al. (2005). Definition and classification of chronic kidney disease: A position statement from kidney disease. Improving Global Outcomes (KDIGO), 67(6), 2089–2100. Li, D., Fu, Z., & Duan, Y. (2002). Fish-Expert: A web-based expert system for fish disease diagnosis. Expert Systems with Applications, 23(3), 311–320. doi:10.1016/s0957-4174(02)00050-7. Peng (2005). Developing and validating nutrition diagnosis system (DOH-94-TD-F113-048). Petot, Grace J., Houser, H. B. & Uhrich, R. V. (1980). An on-line nutrition information system for the clinical dietitian. In Proc Annu Symp Comput Appl Med Care (1980 November 5). Reenskaug, T. (1978). MVC XEROX PARC 1978–79. Retrieved 2010, from . Shan, Y.-P. (1989). An event-driven model–view–controller framework for Smalltalk. Paper presented at the Conference proceedings on Object-oriented programming systems, languages and applications, New Orleans, Louisiana, United States. Shu-Hsien, L. (2005). Expert system methodologies and applications – a decade review from 1995 to 2004. Expert Systems with Applications, 28(1), 93–103. doi:10.1016/j.eswa.2004.08.003. Sobel, J., Khan, A. S., & Swerdlow, D. L. (2002). Threat of a biological terrorist attack on the US food supply: The CDC perspective. The Lancet, 359(9309), 874–880. doi:10.1016/s0140-6736(02)07947-3. Steinbrook, R. (2009). Health care and the american recovery and reinvestment act. New England Journal of Medicine, 360(11), 1057–1060. doi:10.1056/ NEJMp0900665. Wang (1994). 專家系統在土木工程上之應用. 營建知訊(113). Willis, J. (2006). Introduction to the windows workflow foundation rules engine. Windows Vista Technical Articles Retrieved 12, 2009, from Yeh (1991). 專家系統方法應用與實作: 全欣資訊圖書公司. Zetian, F., Feng, X., Yun, Z., & XiaoShuan, Z. (2005). Pig-vet: A web-based expert system for pig disease diagnosis. Expert Systems with Applications, 29(1), 93–103. doi:10.1016/j.eswa.2005.01.011.