6. Research Methodology
6.5. System Boundaries
In expert system based programs like CFRMFEDD, the inference engine represents the coding section of the project. Therefore, the following classes, modules and predicates were used in the design of CFRMFEDD. This is summarized in Table3.21. Also A tree-view of all the classes, modules and predicates used in CFRMFEDD are shownin appendicesB1-B16.
161
Each Class in visual prolog is organized into class interface definition, class declaration and class implementation. The actual codes that are used by the classes are found as clauses in the various predicates in the class implementation section.
Customized classes are those classes which were built from the native class-templates by the programmer.
The main customized classes of CFRMFEDD are shown in Table 3.21 and discussed briefly in the following sessions.
Table 3.21: Summary of modules designs used in CFRMFEDD
Class Name class implementation Type No of
Predicates Class Purpose
addEyeDisease addEyeDisease.pro Class 32 adds new eye disease
to database
addNewDiseaseAttributes addNewDiseaseAttributes.pro Class 11
Adds New symptoms, signs, risk factors and Treatment
askDialog askDialog.pro Class 7 gets password from
user
biodataForm biodataForm.pro Class 10 registers new patient
browseDiseaseAttributes browseDiseaseAttributes.pro Class 4
displays Symptoms, signs, risk factors and treatment
deleteManager deleteManager.pro Class 8
delete existing disease from database
symptomChecker1 symptomChecker1.pro Class 18 symptom check and
162
diagnose eye conditions
myReport myReport.pro Class 24
displays result of eye testing for viewing and/or printing
patientLogIn patientLogIn.pro Class 10 logs in a patient for
eye testing
testMyVision testMyVision.pro Class 39 tests the visual acuity
of a patient
welcomePage welcomePage.pro Class 12
displays useful information and instruction to the user
Routine routine.pro class 30
provides re-useable codes often needed by other classes
Taskwindow taskwindow.pro Class 71
provides customized GUI functions for menu-driven tasks
Total 13 287
3.9.4.1 taskwindow class Name of class: taskwindow
No of predicates: 96 (See Appendix B1)
Purpose: provides customized GUI functions for menu-driven tasks.
163
Description: This class contains all the predicates, clauses and facts that are necessary to sustain menu-driven events/actions and database loading and manipulations.
The general algorithm for displaying the system GUI and responding to user actions are as shown below.
LOAD taskwindow form
DISPLAY form Title
LOAD and CONNECT database
CLOSE previously loaded Database
OPEN the loaded database for access
SET Timer
SET WindowState to MAXIMIZED THEN
RESPOND to Menu-driven user actions
3.9.4.2 welcomePage class Name of class: welcomePage
No of predicates: 12 (See Appendix B2)
Purpose: Provides the template for displaying user instructions and other event-specific messages.
Description: This class contains all the predicates, clauses and facts that are necessary to display relevant instructions to the user on how to use and navigate the system.
The general algorithm for displaying the user instructions is as shown below.
164 SELECT Message Source
IF message is from:
“WELCOMEPAGE” OR
“TESTMYVISIONPAGE” OR
"DIAGNOSTICS" OR
"ABOUTEYEDIAGNOSTICS" OR "REPORTBUGS" OR
"ABOUTTHEAUTHOR"
THEN set Message AND DISPLAY Message 3.9.4.3 askDialog class Name of class: askDialog
No of predicates: 7 (See Appendix B3)
Purpose: To give log-In access to Doctor or System Admin
Description: This class contains all the predicates, clauses and facts that are necessary to give log-in access or denial to the doctor or system Administrator. Logging-in as a doctor/System admin gives the user reserved access privileges for adding, removing or updating the database.
The general algorithm for login-access is shown below.
DISPLAY Login Password Fields
VALIDATE [Password] Entry
CHECK if entered [Password] matches known password in database
165
GIVE access if match is found
DENY access otherwise
3.9.4.4 addNewDiseaseAttributes class Name of class: addNewDiseaseAttributes No of predicates: 11 (See Appendix B4)
Purpose: To add new Symptoms or Signs or RiskFactors or Treatmentto the database
Description: This class contains all the predicates, clauses and codes that are used to add new eye disease-attribute to the database. It displays add-disease-attribute input form earlier designed. This form contains a single adaptable list box which can display any of the four disease-attributes depending on the attribute the user has selected to add. For any disease-attribute such as ―Signs‖ to be referenced, it must first of all be added into the database.
The general algorithm for adding new disease-attribute is as shown below.
Enter new Disease-AttributeName
Rule out that the new attributeName is not already existing
Select [ATTRIBUTE] from AttributeList
If NO ERROR THEN
Save [ATTRIBUTE] …..
If AttributeType is Signs THEN save into signsCode FactsDatabase
REPEAT for each of the attribute types
3.9.4.5 addEyeDisease class
166 Name of class: addEyeDisease
No of predicates: 32 (See Appendix B5)
Purpose: To add new eye disease to the database
Description: This class contains all the predicates, clauses and codes that are used to add new eye disease to the database. It displays add-new-disease input form earlier designed. This form contains sections for selection of disease attributes which include symptoms, signs, risk factors, treatment options and image for the disease about to be added. For any disease to be referenced, it must first of all be registered into the database.
The general algorithm for adding new disease is as shown below.
Enter new DiseaseName
Rule out that the new name is not already existing THEN
Select [SYMPTOMS] from SymptomsList
Select [SIGNS] from SignsList
Select [RISKFACTORS] from RiskFactorsList
Select [TREATMENT] from TreatmentList
Select [DISEASE IMAGE] from file
If NO ERROR THEN
Save [SYMPTOMS] into diseaseSymptoms FactsDatabase
Save [SIGNS] into diseaseSigns FactsDatabase
Save [RISKFACTORS] into diseaseRiskfactors FactsDatabase
167
Save [TREATMENT] into diseaseTreatment FactsDatabase
3.9.4.6 biodataForm class Name of class: addEyeDisease
No of predicates: 10 (See Appendix B6)
Purpose: To add new patient‘s information to the database
Description: This class displays a registration input form earlier designed for entering the biodata of new patient. The biodata includes, FirstName, Surname, Initials, Age, sex, etc. This registration protocol is mandatory for any new patient who wishes to test his vision.
The general algorithm for adding new patient is as shown below.
Display AddNewPatientForm
Get Selections from the displayed fields
Validate entries made
Save [FIELD ENTRIES] into patientsBioData FactsDatabase
3.9.4.7 patientLogIn class Name of class: patientLogIn
No of predicates: 7 (See Appendix B7)
Purpose: To give log-In access to Patient
Description: This class contains all the predicates, clauses and facts that are necessary to give log-in access or denial to the patient. Logging-in as a patient enables him or her to carry out eye test.
168 The general algorithm for login-access is shown below.
DISPLAY LISTBOX for patient to select his/her names
DISPLAY ID field for patient to enter his Folder/ID No.
VALIDATE [ID NO] Entry
CHECK if entered [ID NO] and Selected names MATCH any record in database
GIVE access if match is found
Otherwise set DEMO mode to TRUE.
3.9.4.8 testMyVision class Name of class: testMyVision
No of predicates: 39 (See Appendix B8)
Purpose: Visual acuity measurement.
Description: Tumbling-E is presented to the patient at four different orientations (Left, Right, Up and Down) and at different sizes. The patient clicks an arrow corresponding to the orientation of E. For instance, if E is facing up, the patient is expected to click UP arrow. Testing is automatically halted when patient can no longer identify the orientation of presented-E correctly by pressing the wrong keys consecutively. Testing is done per eye. The visual acuity is finally saved in the database.
Algorithm :
IF E-orientation is X
AND correctLastButtonOrientationClicked is X AND acuityOfE_beforeFailure is Y
169 THEN
PatientAcuity is Y
3.9.4.9 symptomChecker1 class Name of class: symptomChecker1
No of predicates: 19 (See Appendix B9)
Purpose: Symptoms checking and partial tentative disease diagnosis.
Description: list of symptoms are presented to the patient for selection and then using the selections made, the list of unlikely diseases are eliminated systematically while the list of likely diseases are kept.
The process continues until when one solution is found or when no solution is found or when further processing could not lead to any goal.
Algorithm:
Facts:
SymptAA, SymptBB, SymptCC, SymptDD are symptoms of Eyedisease-X, SymptBB, SymptCC, SymptDD, SymptEE are symptoms of Eyedisease-Y, Rules:-
IF HasSymptomsBB AND HasSymptomsCC AND HasSymptomsDD THEN
Patient has Eyedisease-X OR Eyedisease-Y
170 3.9.4.10 diagnostics class
Name of class: diagnostics
No of predicates: 19 (See Appendix B10)
Purpose: Outputs final disease diagnosis.
Description: The class outputs the final disease diagnosis by comparing the result of visual acuity measurement and the tentative partial diagnosis earlier made during symptom checking. It also calculates the certainty factor associated with the diagnosis.
Algorithm:
Get visual acuity result from testMyVision class Classify the visual acuity result
Get the [tentative partial diagnosis] result from SymptomsChecker1 class
Using the [classified visual acuity] and [Tentative Diagnosis result] calculate the CERTAINTY FACTOR Output DIAGNOSIS with the associated CERTAINTY FACTOR.
3.9.4.11 myReport class Name of class: myReport
No of predicates: 27 (See Appendix B11)
Purpose: Displays the patient‘s test report from the database for viewing or printing.
171
Description: The class displays the test reports for a selected patient. Also all the test reports and records related to a particular patient could be displayed in multiple pages.
Algorithm:
Gather all the test records related to a given patient Display the records in a form
For multiple records, display page navigation buttons 3.9.4.12 deleteManager class
Name of class: deleteManager
No of predicates: 8 (See Appendix B12)
Purpose: Deletes an existing disease from the database.
Description: The class provides platform for removing or deleting existing disease from the database.
Only the user who logs-in as doctor or system administrator could carry out this delete operation.
Algorithm:
Get user password
If user is registered doctor or system admin THEN Display list of all existing eye diseases from the database Confirm delete request from user the second time
Delete the selected disease and all its attributes from the database
172 Update database.
3.9.4.13 browseDiseaseAttributes class Name of class: browseDiseaseAttributes No of predicates: 4 (See Appendix B13)
Purpose: Displays the list of eye diseases, symptoms, signs, risk factors and treatment.
Description: The class displays only eye disease and disables other attributes if user logged-in as a patient. But if user logged-in as a doctor/system admin, then display of disease attributes could also be enabled.
Algorithm:
Get user password
If user is registered patient THEN
Enable only disease viewing and corresponding images If user is registered doctor or system admin THEN
Enable disease viewing and corresponding images Enable Symptoms viewing
Enable Signs viewing
Enable Risk-factor disease viewing Enable Treatment viewing
3.9.4.14 routine Class Name of class: routine
173 No of predicates: 30 (See Appendix B15)
Purpose: Common pool class for provision of routine functions
Description: This class contains all the common predicates, clauses and codes that are repeatedly required by other classes. Most of the important services provided by this routine are conversion services. This involves converting diseases, symptoms, signs, risk factors and treatment to codes and vice versa as it is programmatically safer to work with codes to ensure consistency, save memory demand and minimize errors.
3.9.4.15 main module Name of class/module: main
No of predicates: 2 (See Appendix B16)
Purpose: loads system executable file (.exe)
Description: The class loads CFRMFEDD executable file at startup.
Algorithm:
Display taskwindow Load main::run (Goal)