Design and Development of Long-term Care Management System Based on Internet of Things

The aim of this study is to design and establish a long-term care management system with the functions of data acquisition, data access, and website management for a long-term care center, along with the utilization of an Internet of Things (IoT) demo board and router to transmit the measurement parameters of biomedical sensor modules to the server database, including blood pressure, body temperature, and heart rate modules, for physiological information measurement by the system. The interface for information browsing is simple and user-friendly. This system uses Windows 10 as its operating system and uses Apache to create a Hypertext Transfer Protocol (HTTP) server, as well as the MySQL relational database management system and WordPress.com blog services. WordPress.com is also utilized to design a web interface so that the family of the person in long-term care can instantly access their physiological information, and the hierarchical webpage architecture enables administrators to manage the information regarding long-term care. The blog format allows users to operate it easily, and the physiological data and website information are stored in the MySQL system. Message Queuing Telemetry Transport (MQTT) protocol was designed by using Microsoft Visual C# to store the data in the database with the application programs to implement the transmission function for the physiological data. A WeMos D1 demo board is utilized to implement the data publish function for heart rate, body temperature, and blood pressure via the MQTT protocol. The advantage of this system is that it is based on the IoT structure, and the biomedical measurement data can be managed via the website with security, privacy, wear ability, and low-power operation. Moreover, an alarm function is also implemented to help medical staff manage measurement data and achieve the goal of instant care.


Introduction
The trends of an aging population and an aging society in recent years are challenging issues that the world must face, particularly in Taiwan. As the ratio of elderly people continues to increase, the unbalanced population structure will lead to a greater burden on society owing to the increased dependency ratio. According to a report by the National Development Council of Taiwan, there were about 5.0 people in work for each elderly person in 2018, which will decrease to 1.2 workers in 2065. Therefore, the demand for long-term care is expected to increase, and to meet the demand, technology can be implemented to assist caregivers, reduce the burden on caregivers, and address the labor shortage. We believe that this will be beneficial to society and enhance the quality of care for elderly people. (1) System operability needs to be considered when integrating technology into a long-term care system. (2) For instance, abnormal measurement is often due to an incorrect operating procedure when elderly people operate their medical measurement equipment. Therefore, personnel are often assigned to assist in the operating procedure to avoid such measurement errors, which increases the workload for caregivers. Regarding data maintenance and management, labor is often required to input measured data into a computer and create files, and when family members request physiological information of elderly relatives, labor is also required to send data files to the family members. Siu et al. presented an intelligent clinical decision support system for care planning where a case-based reasoning technique was adopted to provide knowledge support for decision-making in care planning. By extracting the relevant knowledge from similar past cases, care plans can be formulated in a cost-effective and time-efficient manner so as to maintain the high quality of services. However, the construction of the system is complicated, and operation and maintenance are difficult and expensive. (3) In 2008 and 2009, Kato et al. developed the necessary intelligent clinical decision support system for activities of daily living items that should be considered in a process for elderly care. (4,5) However, these studies failed to establish a complete method for designing long-term care service plans and care plans. Therefore, a long-term care management system with the IoT that has security, privacy, wear ability, and low-power operation has not yet been reported, which is the motivation of this study.

Research Methods and Tools of Long-Term Care Management System with the IoT
This section introduces the content management system of websites and various software and hardware devices, including the server of the website, the database, the biomedical sensor modules, and the internet demo board. Their functions will also be described; the abovementioned hardware is provided by our laboratory, and the software is a free edition provided by its official website. First of all, WordPress based on a PHP and MySQL platform is used to create web pages. WordPress contains theme topics and users can change their interface without changing the content and structure of their blogs. Users can use HTML and PHP codes to design the theme content, and they can also use PHP coding to connect and operate the database. WordPress contains various plug-in programs, including functions such as search engine optimization and database connectors, which increase its functionality and has made WordPress the most popular blog system on the web nowadays. WordPress can be directly opened in a browser for direct editing of the content or the interface, and some of its plug-ins are shown in  The system uses the wpData Tables plug-in tool to process the display of the database, and  the output chart or graph can be displayed in accordance with the user's requirements. Furthermore, a personalized website map and display based on various data can be created, which creates a hierarchy of the web pages and provides a retrieval function in the website. As physiological information is private and personal information, users can only access WordPress articles or browse web pages in accordance with the permission settings to reduce the risk of information leakage.
The hardware of this system utilizes three types of biomedical modules and an IoT demo board. The three modules are the HKB-08B, arm-type blood pressure measurement module developed by HuaKe Electronic Technology Research Institute, the CMS50D+ Pulse Oximeter blood-oxygen level analyzer developed by Contec Co., Ltd., and the MCU90615 IR non-contacttype temperature detection module. The demo board uses an ESP8266 series board including WeMos D1 R1 and D1 mini, which is compatible with Arduino and is utilized as the wireless network connector and module controller. The development board is also designed as an MQTT publisher (Publisher), which controls and transmits module data to the server. The module for blood pressure measurement is combined with a radio frequency identification (RFID) module so that the user identification and management function can be realized.
Regarding the web pages, the biometric measurement information can only be displayed on the website, and the biomedical information cannot be directly input into the website and stored in the database. Therefore, this program is also used as a data format converter for the data transmitted from the MQTT protocol to the MySQL database. It utilizes Microsoft Visual C# software to design the data input and output program, and uses the MQTT communication protocol to receive input values, which are converted to SQL syntax before they are sent to the MySQL database. This program has three functions, Publisher, Subscriber, and MySQL data query, allowing users to use the Publisher function to input data, to use the Subscriber function to monitor the published content, and to query and display the database data with MySQL.

System Architecture
This section includes three parts. The first part introduces the design concept, the second part introduces the related software settings, and the third part introduces the demo board and biomedical modules. The architecture of the long-term care management system is shown in Fig.  2. Users can access the management interface on the website via the browser on their PC or mobile phone, without installing a new app. WordPress, the MQTT broker, and MySQL must be installed on the PC. The PC runs the data conversion program coded in C# language and converts the subscribed content received by the MQTT broker into the MySQL syntax, and stores the data in the MySQL database, so that MQTT messages can be monitored with the function of data output. In addition, the alarm of the system is configured in this program. When the heart rate data received by the MQTT broker is abnormal, a warning screen is immediately displayed and the alarm is triggered. The WeMos D1 series demo board is used as a module controller and the data can be uploaded via Wi-Fi. WeMos D1 serves as the MQTT client in the system and publishes the measurement data of the module to the MQTT broker, then transports the data to the MySQL database through programming. Lastly, the content and data in the database are extracted by WordPress and displayed on the website.
The design of the long-term care management system in this study refers to the concept of the public health station designed by Lee Way Co., Ltd., which combines the data in a blood pressure machine with the data stored in a health insurance IC card and the cloud, and users can connect to the cloud to view the health status by using an exclusive app, (6) as shown in Fig. 3. Public health stations are now very common in large-scale hospitals and users frequently use their services, but they are rarely seen in the long-term care centers of rural townships; not every long-term care center has the funding for these stations. The cloud database, app, and website maintenance are major engineering projects; thus, we remove app-related functions and use the website as the main interface in this study. As public health stations are intended for use by the entire population of Taiwan, their functions are limited to the measurement of blood pressure, heart rate, height, and weight. Taking the concept of customization into consideration, we allow users in this study to change the display content on the interface according to their personal preferences. Users can also add or delete measurement functions according to their needs, and then carry out the measurements such as weight and blood-oxygen level. In addition, a warning function has been added to the system to monitor some physiological measurements for which an emergency situation may become apparent; if such a measurement is abnormal, an immediate warning is issued to ensure the implementation of instant care.
Next, we introduce various configuration settings used in this system, including the setup of the server, WordPress, MQTT broker, and the environment for programming development.
Regarding the system requirements in this study, a server must be installed in a PC. Common server installations include LAPP, LAMP, LNMP, WAMP, MAMP, LAMJ, BAMP, WIMP, AMP, and XAMP, which can be selected according to individual preferences. We installed WAMP in this study. WAMP is a Windows web development environment created by Romain Bourdon, where the four letters stand for Windows operating system, Apache web server, MariaDB or MySQL database management system, and PHP, Perl, or Python language, and it can control the server functions from the WAMPServer interface, as shown in Fig. 4. The web applications can be created using Apache, PHP, and the phpMyAdmin database. (7) Before installing WordPress, we must make sure that the computer can support Apache and PHP; thus, we install WordPress after installing WAMPServer. First, phpMyAdmin is initiated on the WAMPServer interface, then Add is clicked to create a WordPress database, as shown in Fig. 5.
After creating the database, the latest version of the compressed file is downloaded from the WordPress official website, as shown in Fig. 6, and then the file sent to the directory "C:\ WAMP64\www" is extracted on the user's PC.    After finishing the decompression, the user goes to the URL "127.0.0.1/wordpress/wp-admin/ install" in the browser to start installing WordPress.
Eclipse Mosquitto is used to set up the MQTT broker on the computer. Eclipse Mosquitto is an open source messaging broker. (8) After the installation, the firewall must be granted permission to allow Mosquito in the settings of the computer's firewall and network protection. C# is a user development interface developed by Microsoft Corporation with the C# programming language in an integrated development environment. It can also be initiated using the integrated development environment of Microsoft Visual Studio, with the word Visual indicating its relationship with the series of Microsoft products including Visual Basic, Visual FoxPro, and Visual C++. C# is a development language designed and developed by Microsoft that conforms to the standards of C# language. A Visual #C program can run after its compilation. The main objective of the design with C# is to enhance the development efficiency. C# is very similar to Java, and its compilation result is in an intermediate code, rather than machine code. C# and the common language are based on the standards of an open source crossplatform, and C# can also be developed on Linux and Mac OS X with the support of the open source Mono project by Novell. (9) In general, C# refers to the integrated development environment developed by Microsoft for coding, compiling, and debugging C# programs. The inherited development environment is a part of the Visual Studio or independent C# Express development environment. (10) Next, we introduce the demo board, biomedical module, and RFID module used in the system, and their functions are also described. WeMos is a company in China that specializes in the design of inexpensive IoT demo boards that are compatible with Arduino. They can be coded directly by using Arduino IDE, which is very convenient. In this study, we use the WeMos D1 series demo board to implement the IoT functions for this system. In the selection of the WeMos D1 series demo board, the main consideration is the capability of controlling the biometric measurement modules, i.e., the body temperature, heart rate, and blood pressure modules in this study. The body temperature and heart rate modules are chosen in consideration of portability, and thus the smaller WeMos D1 mini shown in Fig. 7 is chosen, whose specifications are shown in Table 1.    The blood pressure module requires a higher voltage than the other modules; thus we use the WeMos D1 R1 demo board shown in Fig. 8 for this module, whose specifications are shown in Table 2. (11) All three modules used to measure physiological information utilize a Universal Asynchronous Receiver/Transmitter (UART) as the communication interface, and an RX pin is used to receive input data while a TX pin is used for sending data. We use a Contec CMS50D pulse oximeter as the heart rate module of the system, as shown in Fig. 9. After clamping the finger with the pulse oximeter, turning on the power, and waiting for about 20 s, it sends 60 messages per second to the RX and TX pins of the communication port. Each message contains five syllables, of which the fourth syllable is the pulse data and the fifth syllable is the bloodoxygen saturation ratio. In this system, since only the heart rate data is needed and the heart rate can be found from the pulse data, the data of the fourth syllable is taken. (12) The basic principle of pulse oximeter measurement is to use transmissive measurement. The ratio of penetrating hemoglobin to hemoglobin that does not carry oxygen, the pulse rate and SpO 2 are calculated by using the near-IR light emitted through the LED and the Beer-Lambert law. The specifications of the pulse oximeter are shown in Table 3. (13)   We use an MCU90615 IR non-contact thermometer module as the body temperature module of the system, as shown in Fig. 10. With the UART communication interface, the query command is input to the RX and TX communication pins of MCU90615 to receive the temperature value. The measurement principle of the IR non-contact thermometer module is to convert the radiation energy of the IR rays emitted by the measured object into a telecommunication signal. The temperature of the object corresponds to the amount of IR radiation energy, allowing the temperature of the object to be estimated from the amount of conversion of the telecommunication signal. The specifications of the module are shown in Table  4.
An HKB-08B blood pressure sensor is used as the blood pressure measurement module of the system, as shown in Fig. 11. To use the UART communication interface, the start command is sent through the RX and TX communication pins of HKB-08B and a 10 byte signal is received after a wait of a few seconds. The value of the systolic blood pressure in the seventh syllable, the value of the diastolic blood pressure in the ninth syllable, and the value of the heart rate in the tenth syllable are used in this system. The measurement of blood pressure includes non-invasive and invasive methods. At present, the most commonly used blood pressure measurement method is the non-invasive resonance measurement, in which a pulsed belt is inflated to prevent blood flow then gradually deflated. During the process, the arterial pulsation is measured by a pressure sensor. When the pulsation is stronger, the amplitude of the pressure on the belt will increase, and the maximum amplitude of the pressure is the average arterial pressure. After that, the amplitude of the pressure on the belt is gradually decreased until it is less than the diastolic blood pressure. The maximum amplitude is used as the center value to find 50% of the maximum amplitude, which is the systolic blood pressure, and 80% of the maximum amplitude, which is the diastolic blood pressure. The specifications of this model are shown in Table 5. (15) The heart rate and body temperature module of the system are pre-set to be used by a single person, whereas the blood pressure module is shared among users. In this study, we utilize RFID technology to identify users, and we use the Mifare RFID-RC522 module shown in Fig. 12 as the RFID module of the system, whose specifications are shown in Table 6. The RFID technology utilizes an approach based on radio frequency to conduct non-contact two-way data transmission between the data reader and the radio frequency card to achieve the objective of target identification and data exchange. (16)

Experimental Results
As shown in Fig. 13, after the Contec CMS50D module is initiated, the heart rate data is transmitted to the WeMos D1 mini demo board, and the data and IP address are then published by the MQTT broker with the MQTT protocol. Finally, the data is loaded by the subscriber to the program.
As shown in Fig. 14, after the body temperature module is initiated, the body temperature data is transmitted to the WeMos D1 mini demo board, and the data and the user name are published by the MQTT broker with the MQTT protocol. Finally, the data is loaded by the subscriber to the program.
After the RFID card is used to contact the RFID receiver, the blood pressure module is activated and the blood pressure data is transmitted to the WeMos D1 R1 demo board. As shown  in Fig. 15, after using the RFID card to contact the RFID receiver and the blood pressure module is initiated, the blood pressure data is transmitted to the WeMos D1 R1 demo board, and the data and the RFID card number are then published by the MQTT broker with the MQTT protocol. Finally, the data is loaded by the subscriber to the program. The data conversion program converts the data in the system, and is able to directly publish the topic and convert it into MySQL syntax so that the data can be uploaded to the database. In addition to automatic uploading to the database, it also has the function of manual input. The interface of the program is shown in Fig. 16.
After clicking on the user and opening an article, the measurement records of the user are displayed. All of the output charts provide output functions and the files can be exported as Excel and CSV files and stored, as shown in Fig. 17.

Conclusions
The aim of this study was to assist the management of a long-term care service center by integrating biomedical sensor module control, RFID chip identification, WordPress.com website management, MQTT communication protocol, and a MySQL database to establish and develop a long-term care management system. We also designed a data conversion program and an alarm to detect abnormalities to allow medical staff or administrators to instantly read the measurement information of users, so that they can see which user is in a critical situation from the warning screen. The WordPress website can also display the user's information, so that their family can review the information on the website to better understand the user's situation; moreover, the family can also communicate with medical staff or administrators through the website. The interface of the website and the content of the articles can be customized according to the needs  of the long-term care service center. In the future, we expect to implement the system and incorporate more biomedical measurement equipment to provide more detailed information. We also intend to output all the data in a physical examination sheet to help the long-term care center manage the physiological information of all users, allowing medical staff to provide users with appropriate care services according to their physiological information. For the communication with the user's family, this system uses the message function on the website. Therefore, the user's family must open the browser to review messages, which may result in a delay in information communication. Communication software such as LINE or Messenger can be utilized to make information exchange more convenient and enable the user's family to receive instant notifications. Furthermore, the system can also be integrated with big data and artificial intelligence to collect and analyze the user's physiological data, so that their physical condition can be diagnosed by a computation algorithm to predict and prevent possible illnesses.