# Design and Implementation of Health and Risk Level Assessment for Socially Disadvantaged Patients
## 3 Platform Design and Implementation  
### Server-Client Architecture for Patient-Specific Risk Assessment  
In this research, data were collected for about two months to build a risk assessment model. We collected data from at-risk and non-risk subjects. For data collection, we developed and used a smartphone sensor collection application. In addition, we collected and labeled the diagnosis results by conducting expert consultations with application users. We collected the distance traveled, the number of steps, the number of screen touches, data usage, sleep time, and oxygen saturation data through a device developed separately from the application used in this study. This application utilizes smartphone sensor data to collect information such as the physical activity, social activity, and emotional state of the user as shown in Figure 1.  
The collected data are largely divided into user information, sensor data, diagnosis information, and depression diagnosis results. User information includes member account number, age, sex, name, region, occupation, income, and household member information. Sensor data are information collected from a smartphone every 15 min, and includes the date and time of data creation, distance traveled (km), number of steps, number of screen touches (number of times), data usage (Mb), and sleep time (time when mobile phone is not used). Diagnosis information includes the anxiety scale (Generalized Anxiety Disorder 7) and the depression screening tool (Patient Health Questionnaire-9) as psychological test results. Sensor data were used as the learning data, and the values of \"depressed\" and \"normal\" were used for the label based on the psychological test results and the expert's opinion. Sensor data were collected at 15 min intervals. The reason for this is that frequent data taken less than 15 min apart are more than necessary to determine depression, and difficulties arise in terms of system resource management. On the other hand, it was judged that it would be difficult to cope with emergency situations if data were collected over a longer period of more than 15 min. If the communication state is unstable or the application is deactivated, it is handled by a strategy designed to deal with missing data. In this research, we adopted a supplementary method instead of a method of removing missing values in order to use temporal information meaningfully. Missing values were obtained by substituting the mean (\(\mu\)) and standard deviation (\(\sigma\)) of values measured at the same time on different days so that time information could be learned meaningfully. When comparing the method of supplementing missing values used in this study and the method using the average of values immediately before/after the missing values, the method proposed in this research was able to compensate for the missing values more precisely. In the formula, s used a random real value between 0 and 0.01. Figure 2 shows the smartphone application storyboard developed in our research. In designing the information architecture, we focused on explicitly categorizing the menus and avoiding excessive depth. Our app consists of about 20 pages with various functions such as an intro page, login page, measurement page, main page, ID/PW search page, information sharing page, and analysis result inquiry page. In addition, the characteristics of time were created and used as variables to learn the characteristics of the time series data collected in real time. Time information was divided into hours and minutes. To secure independence among the variables, we created numerical variables using OneHotEncoding as a categorical variable and StandardScaler, a standardized method that is relatively less affected by outliers. In the case of VAE,  
Figure 1: Health and risk assessment platform design and implementation strategy. we used 70% of the data as training data, 20% as validation data, and the remaining 10% as test data. VAE's training and validation data only used the data from general subjects.