# IoT-Based Medical Image Monitoring System Using HL7 in a Hospital Database
## 2 Materials and Methods
### Ultrasound Machine to Raspberry Pi HL7 Messaging Process
#### 2.1.1 HL7 Block Formation and Messages
After configuring thingsboard with custom widgets, physicians can easily see patient information with images (Figure 10). On the left side of Figure 10, ultrasound image data are displayed. On the right site patient information is shown. This is the final output of the image and patient info which is displayed on the IoT server in real-time. After requesting patient information from the IoT server, the proposed model examines different sized images based on different bandwidths and checks the IoT server response for displaying those images. Here, the proposed model uses 1 MB to 5 MB images which are displayed on the IoT server depending on the bandwidth. Table 2 shows that image display delay time varies based on image size as well as bandwidth. Lower bandwidth with small packet size means that it takes more time to show the information on the IoT server. On the other hand, higher bandwidth with higher packet size means it takes less time to display (Table 2). In addition to the real-time situation, the proposed model also simulates the whole process using NS3 in two parts: (i) ULSM to hospital management system (HMS), and (ii) HMS to FTP and IoT. NS3 allows us to trace the node pathways, which allows us to determine the number of data points sent or received. Trace files are created to track these activities. Its main purpose is to mimic networks of connecting nodes and the traffic that flows between them. To do this, NS3 offers a core abstraction of computer nodes with applications to produce traffic as well as net devices and channels to transport the traffic. In part (i) of the ULSM to HMS simulation, image data transfer employed a total of 10 nodes, each labelled with a number from 1 to 10. Node 1 is the source node from which the proposed model transfers packet data using ULSM. This study employed nodes 2 to 9 as intermediate nodes, such as the RSPI3, and Node 10 as a server, receiving packets from different nodes and responding with acknowledgement (ACK) messages (Figure 11). In part (ii), packets are sent from HMS to FTP and from HMS to IoT (Figure 12). This simulation utilized various nodes in this case, with node 0 serving as the source, node 1 serving as the HMS, node 2 serving as the FTP server, and node 3 serving as the IoT server. Tables 3-5 emerged from those simulations. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Image Category** & & & **Display Medical** & **Patient** \\
**(2D) Total Image** & **Data Size** & **Network** & **Minimum (s)** & **Image** & **Information** \\  & **per 30 s** & & & **Found (s)** & **Found (s)** \\ \hline
5 \textgreater{} image & Image \textless{} 1 MB & 2G & 15 & 10 & 5 \\ \hline
5 \textless{} image \textless{} 10 & 1 MB \textless{} Image \textless{} 3 MB & 3G & 10 & 5 & 3 \\ \hline
15 \textless{} image \textless{} 20 & 3 MB \textless{} Image \textless{} 5 MB & 4G (LTE) & 5 & 2 & 2 \\ \hline Image \textgreater{} 20 & Image \textgreater{} 5 MB &
\begin{tabular}{c} Broadband above \\ 5 Mbps \\ \end{tabular} & 3 & 2 & 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Image display in IoT server by category. Figure 11: NS3 simulation from ULSM to HMS. (**a**) Packet data passing; (**b**) Node information. Figure 12: NS3 simulation from HMS to FTP and IoT. **(a)** Packet data passing; **(b)** Node information. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Data/Packet Size (MB)** & **Bandwidth (Mbps)** & **(S) Response Time (s)** \\ \hline \multirow{5}{*}{5} & 1 & 41.64960943 \\ \cline{2-3}  & 5 & 10.92773353 \\ \cline{2-3}  & 10 & 5.634109647 \\ \cline{2-3}  & 15 & 3.674797321 \\ \cline{2-3}  & 20 & 4.611541816 \\ \hline \multirow{5}{*}{10} & 1 & 81.17746564 \\ \cline{2-3}  & 5 & 17.22091601 \\ \cline{2-3}  & 10 & 10.01965412 \\ \cline{2-3}  & 15 & 8.12423431 \\ \cline{2-3}  & 20 & 6.908335693 \\ \hline \multirow{5}{*}{15} & 1 & 122.5305769 \\ \cline{2-3}  & 5 & 25.36579175 \\ \cline{2-3}  & 10 & 14.6547472 \\ \cline{2-3}  & 15 & 9.84765541 \\ \cline{2-3}  & 20 & 7.490648534 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: HMS To FTP (Internet).