# MobiDabet: Mobile Telemonitoring System for Patients with Type 2 Diabetes Mellitus (T2 DM)
## 2 Materials and Methods
### Data Model  
The data model describes the structure of the telemonitoring system database for patients with T2 DM, which is established in the PostgreSQL database manager (see Figure 7). The database of the proposed system is composed of 35 tables that include primary keys to identify each entity (or table), as well as foreign keys that represent the relationship between tables. The database is prepared in order to be adapted to system updates, i.e., if it is required to add tables or attributes in the existing ones, it is also prepared for the development of food menus by the nutritionist and the modification of the reports about the food intake frequency questionnaire. This data model also shows the relationships between tables that guarantee the integrity of the stored information.  
Figure 6: Patient application UC diagram.  
The main tables of the data model of the proposed system are described below. Tables' names, in Figure 7, are presented in Spanish according to the database implementation.  
* FoodsItems: This table contains the food items with the details of the equivalent system.
* AlertsToDoctor: This table stores the generated alerts when patients record inadequate glucose levels.
* Anthropometry: The nutritionist uses this table for allocating caloric intake. This table is associated with a specific food group and is related to the patient's table.
* HemataBiometry: This table contains all registers of the patient's laboratory results.
* QuestionnaireIF: This stores all the responses to the food intake frequency questionnaire.
* VideoStatus: This table is linked to Videos and Patients tables, and this has the registers of the videos seen by the patients.
* Urinalysis: This table contains the results of the patient's laboratory studies.
* LiverFunction: This table has the results of the liver function test of a patient.
* FoodGroups: This table contains food groups such as vegetables, fruits, legumes, among others.
* MedicalHistory: This table contains fields concerning the management of the patient's medical history.
* Doctor: This contains the ID number, specialty, and other information on the health personnel.
* FoodMenus: This stores the description, calories, and food menus.
* Nutritionist: This contains the nutritionist's ID number that is related to multiple patients.
* Patients: This table contains patients' data and relationships with the health personnel in charge of each one among other useful information.
* NutritionalPattern: This table contains the nutritional pattern assigned by the nutritionist.
* ThyroidProfile: This contains the results of thyroid function tests.
* BloodChemistry: This table contains the laboratory results recorded by the patient of his blood chemistry tests.
* RecommendationsToPatient: This stores the recommendations that the nutritionist makes to patients.
* GlucoseResults: This table is one of the most important, because this contains the glucose results that the patient records, and this is related to the Patients and AlertsToDoctor tables  
Figure 7: Data model of the proposed system.  
* LaboratoryResults: This contains the relationship with the table of patients and the different laboratory results such as blood chemistry test, thyroid profile test, general urine test, liver function test, and complete blood count.
* Rols: This table is one of the main ones, because it holds the types of users that can access the system.
* Users: This is one of the main tables, because it contains the general information of the users registered in the system, both health personnel and patients.
* Videos: This contains the description and link of the videos for the health education section.