# IoT-Based Medical Image Monitoring System Using HL7 in a Hospital Database
## 2 Materials and Methods  
Machine-to-machine-based data communication and monitoring of patient diagnostic information over IoT servers is difficult and time consuming. To overcome the above problem, this study proposes a new method where the following protocols and methods are used to improve accuracy: MLLP protocol, HL7 messaging, FTP based storage, RSA based encryption and decryption, and MQTT protocol. This study uses HL7 messaging for machine-to-machine-based communication, and for large data storage uses an FTP server. The MQTT protocol is used to communicate with an IoT server using RSA-based encryption and decryption. In this approach, our proposed model divides the entire procedure into four parts, which are as follows:  
* Ultrasound Machine to Raspberry Pi HL7 messaging process;
* Result data stored in LIS (Lab Information System);
* Raspberry Pi to FTP server image transfer;
* Transfer of files from FTP server to MLLP and MQTT protocol with the help of a Raspberry Pi 3 (RSPI3). The above steps are displayed as a flowchart in Figure 1.  
Figure 1: Flow chart of the whole process. This study obtained a variety of options from the analysis for using database platforms to track the health status of patients. Comprising observations and research procedures, this study provides solutions for monitoring patient data. From looking at previous studies, this study also found several bottlenecks when monitoring image data in real time in hospital databases. Before being sent to cloud storage, a microprocessor processes all of the output raw data. With the use of IoT, physicians can simply view that information. This solution heavily relies on the Raspberry Pi for real-time data processing and the IoT server i.e., things-board.io, an open-source IoT platform [19]. However, the main issue of transmitting image data directly to the IoT server via the MQTT and MLLP protocols is handled in our provided approach with a new methodology which overcomes the image viewing problem in real time. A custom widget in the IoT server also aids in the deployment of a machine-to-machine based custom dashboard with image and physician-based access. The overall schematic diagram is shown in Figure 2.  
However, physicians may not need to consider latency, suitable bandwidth management, or fog computing, or to wait for clearance from others for precise therapy and prescriptions, if the diagnosed ultrasound images are processed and transformed with HL7 in such a way that only uses the patient's sample ID for the entire communication. Converted ultrasound images of patient diagnoses will be stored in hospital databases, and precise ultrasound image conversion and sharing links to the images in an IoT server will ensure precision monitoring of patient illnesses, and thus patients will receive appropriate treatment from doctors at any time. The proposed model directly acquires data from ultrasound equipment. The video is converted to photos using the most up-to-date ultrasound machine, which is ideal for the experimental results. The transformed image is sent to RSPI3 in HL7 base64 format, along with patient data. RSPI3 processes the image and converts it into a jpg or png file, which will then be delivered to the FTP server. Again, socket-based (IP + PORT) communication connects the ultrasound machine to the RSPI3. One side is the listener, while the other is the sender, or vice versa. In this instance, the proposed method uses an HL7-based data transfer method. Ultrasound machines often convert ultrasound raw data to video exclusively. Physicians extract visuals from the video that are ideal for visualizing patient information. This image is transformed to base64 format before being sent to the LIS computer. An RSPI3 was used as the LIS in this case. This RSPI3 takes an HL7 message and converts the base64 image to JPG or PNG format using the HL7 messaging protocol. The image quality is also checked by the RSPI3. The patient sample ID is sent in an HL7 message with each image data (see Section 2.1.1).