INCREASING THE EFFICIENCY OF SMART PATIENT ROOM USING INTERNET OF THINGS (IOT)

Researchers are developing more applications based on Internet of Things (IoT) in healthcare services. Proper health care services are the major requirements now a days due to constant increase in the population. These days a major problem faced by critical patients or victims of any kind of accident is of receiving treatment on time, which in some cases becomes a huge problem specially when hospitals refused to take patients in their ER due to unavailability of beds. Travel time consumed while moving patients from one hospital to another at times results in death. The modern technology is able to manage the needs by using IoT technologies that can connect smart objects together. This paper provides the solution to the users who want prompt and timely medical treatment for their loved ones, especially in case of emergency. Smart IoT based patient room is a system that enables paramedic staff /user to get the information about beds availability in the Emergency Room in real time. The smart patient room is different from other emergency rooms by allowing the user to see the status of bed inside emergency room from anywhere in the world through internet using Raspberry Pi. This application also helps hospital staff to monitor basic vitals of patient including the body temperature, heartbeat, etc. and helps user to save life by saving time searching for hospitals where bed is available for treatment in Emergency room. Smart IoT based emergency room consist of android mobile device, cloud network, wireless means of communication, hardware having Wi-Fi module, that sends the data to the cloud which indicates the users about the status of bed. This system deploys pressure sensors on beds that will automatically sense pressure and indicates users regarding the status of the bed inside the emergency room of the desired hospital.

ABSTRACT Researchers are developing more applications based on Internet of Things (IoT) in healthcare services. Proper health care services are the major requirements now a days due to constant increase in the population. These days a major problem faced by critical patients or victims of any kind of accident is of receiving treatment on time, which in some cases becomes a huge problem specially when hospitals refused to take patients in their ER due to unavailability of beds. Travel time consumed while moving patients from one hospital to another at times results in death. The modern technology is able to manage the needs by using IoT technologies that can connect smart objects together. This paper provides the solution to the users who want prompt and timely medical treatment for their loved ones, especially in case of emergency. Smart IoT based patient room is a system that enables paramedic staff /user to get the information about beds availability in the Emergency Room in real time. The smart patient room is different from other emergency rooms by allowing the user to see the status of bed inside emergency room from anywhere in the world through internet using Raspberry Pi. This application also helps hospital staff to monitor basic vitals of patient including the body temperature, heart beat etc. and helps user to save life by saving time searching for hospitals where bed is available for treatment in Emergency room. Smart IoT based emergency room consist of android mobile device, cloud network, wireless means of communication, hardware having Wi-Fi module, that sends the data to the cloud which indicates the users about the status of bed. This system deploys pressure sensors on beds that will automatically sense pressure and indicates users regarding the status of the bed inside the emergency room of the desired hospital.

INTRODUCTION
Internet of things (IoT) is the system or network connectivity of physical devices, home equipment/appliances, vehicles and other objects fixed with electronic, sensors, actuators, software, which permit these entities to connect and interchange the data. Through the embedded system of computing, each item is uniquely recognizable but is inter-operated within the present internet setup. The IoT allows objects to be sensed or controlled remotely across existing network infrastructure, creating opportunities for more direct integration of the physical world into computer-based systems, and resulting in improved efficiency, accuracy and economic benefit in addition to reduced human intervention (Sharma & Tiwari, 2016). It is a continually growing system consist of physical entities having an IP address linked with it for addressing and connectivity with internet, and for communication that happens between other Internet supported systems and devices that permits in some decision-making processes for assembly line scheduling, health care monitoring applications and many more etc. (Sharma, Kumar & Mehta, 2018).
Reinforcing IoT with actuators and sensors (Ghayvat, Mukhopadhyay, Gui & Suryadevara, 2015), it grows into a case of the more universal group of cyberphysical structures, which also covers technologies like smart homes, smart grids, virtual power plant, smart cities and intelligent transportation. Connectivity is already provided to an extensive range of devices through mobile systems. This new surge of connectivity is moving away from the laptops and tables, to connected buildings, and cars, traffic control and smart meters, by the vision of wisely linking virtually everyone and everything.
Recent researches show more potential applications for IoT in healthcare services. The use of IoT technology in applications has spurred the increase of real-time data, which makes data storage more challenging.
This research is about designing and developing a system which will work in real time in case of Emergency. When the person or a paramedic staff with patient is in emergency so he/she is facing a biggest difficulty to select the hospital which is nearby and which has beds available in an emergency room this is the major issue in developing countries. The designed application provides a solution in choosing the correct hospital in case of emergency which in turn saves life and increased treatment time for patient. Registered user can check the available hospitals in the vicinity and also check the availability of bed in an Emergency Room in that hospital. This research will help people to save life of a person by saving time in visiting different hospitals in case of emergency. Implementation of this technique in the prototype IoT based Emergency Room application is discussed in this paper.
The research goal is to present IoT applications for the health care emergency problems. The paper is structured as; Section 1 provide Introduction of IoT, Section 2 describe the literature review/background of the research, Section 3 delivers the system design and implementation of the IoT based emergency room system. In section 4 the results obtained from this research are discussed. Section 5 will provide Conclusion. Section 6 gives future guidelines and the challenges that can be faced using IoT.

LITERATURE REVIEW
With the increase in use of IoT technologies, every field of industry is trying to adopt this technology because, the "Internet of Things" (IoT) is in great need (Yun & Yuxin, 2010). By applying these technologies, a person can easily store and access a large amount of data.
Many researchers are using IoT for Information Desk system. The researchers in (Rafique, et al., 2015) established an Electronic Information Desk System. They have used SMS based method, however in a different way. The designed system works autonomously without the requirement of any human operator. When any information is required by an employee or a student, simply an SMS is to be sent to the system, which will provide the required data to the user. The scholars (Dogo, et al., 2015) designed Digital display board, which is gaining recognition and application in diverse domains of life, containing community or utility places, educational institutes, and in advertisement. Use of IoT system can be applied for assistance for aged or disabled persons living independent. It can also help in monitoring and controlling the condition of medicine inside freezers which are used for storing vaccines, and other health products and for patient's surveillance. It is helpful for monitoring of patient's conditions inside and outside hospitals and in old age homes.
In the medical service industry, the IoT technology is facilitating user in emergency medical findings, and minimizing costs in the process (Xu, Xu, Cai, Xie, Hu & Bu, 2014). Number of researchers have published their IoT based work related to healthcare issues (Darwish & Hassanien, 2011;Sermakani, 2014;Rghioui, L'aarje, Elouaai & Bouhorma 2014). When patients are continuously monitored it allows health care suppliers to access real time data to treat diseases before they get out of hand. By the help of IoT technology we can get the real time data by using sensors. IoT is helping in every way to make emergency department respond more quickly, faster and accurate so the doctors can treat patients as quick as possible. (Xu, et al., 2014) has proposed a method that provide support for the emergency medical services which enables collects, integrate, and interoperate IoT data flexibly. This method supports data accessing periodically and universally in a cloud and mobile computing platform. The scholars have introduced application for RFID to gathered in-formation about the users living environment. It helps to get the detail about the temperature, humidity, and other gases around human (Amendola, Lodato, Manzanari, Occhiuzzi & Marrocco, 2014). Yun and Yuxin (2010) tells us about the key technology of IoT and explains it's working. Sensors in IoT systems formulate real-time interactive network connection between the power equipment and to make data interpretation in real-time. Dhar, Bhunia and Mukherjee (2014) has introduced IoT technology for Health Monitoring. Where the medical facility is provided after the direction of the specialized doctors present all over the globe on the Cloud. This helps to treat a large population when there is lack of doctors in that area.
The scholars developed the Smart Home/Building, which has been implemented in different home or building that allows monitoring the activities of an inhabitant detection. Due to this a user will be able to monitor the activities inside the home even when he/she is far away from the home (Ghayvat, et al., 2015). (Gope, et al., 2015) develops a health monitoring system using the response from Electromyography (EMG), Electroencephalography (EEG), Electrocardiography (ECG), Blood Pressure (BP) Motion, and Thermometer. The system develop use to fetch the data from Body Sensor Network with the help of IoT and send it to the server. The system provides bene ts in generation of the proper reports about the patient status e.g. condition, history etc.
Zhanlin, et al. (2014) implements a cloud-based Information Centre of smart city, which provides transportation services to users like control and monitoring traffic, car parking service, route planning. The author proposed three layers for Business IoT implementation. I.e. Sensor, communication and application layer. IoT is a latest technology that's why there is still a paucity of studies on the social, managerial, behavioral, and economic, aspects of the IoT . IoT utilize Raspberry pi board that reads data from different devices and send it to the cloud so that user will receive update in real time (Laila, Khan, Shaikh, Mazhar & Mehboob, 2017).
All the above work and studies tell us about the need and advantage of IoT technology. IoT has been massively used in medical services in emergency. Therefore, there is a need to propose an application for the users to know about the availability of beds in emergency rooms.

SYSTEM DESIGN & IMPLEMENTATION
The system consists of two modules as shown in Figure 1; software module and hardware module. Software module is designed using android studio which is compatible with android version 4.1 or greater. This system consists of software module and hardware module. The software module comprises of three parts. All of them are incorporated with authentication mechanism.

SOFTWARE MODULE FOR USER
The designed android application is based on emergency services. IoT based Emergency Room helps users to check the status of beds inside emergency room.

Login/Registration
The application requires authentication of user by utilizing one-time Login/sign up. The Login screen display is shown in Figure 2.

Dash Board
After the sign-up process user will be able to access the features of the application via dash board. The features include the hospital list, area wise hospital list, profile, emergency room map and location sharing.

Hospital List
The user searches the hospital available in town. This list has been maintained by admin.

Area wise Hospital List
The user searches the nearest hospital available within 5 to 10 km vicinity ( Figure  6). This feature is very important in case where user did not know about the nearby hospital after facing any emergency situation. This will reduce the time the user waste in finding hospital. A database is maintained for all hospitals and data will be parsed to android device when required. Longitude and latitude of all hospital are saved in the database.

Profile Management
This feature of adding friend and family contact numbers to a registered user profile will enhance the abilities of the application to generate real time alert messages in case of emergency, user can inform registered friend and family member in case of accident or any emergency by clicking just one button. Alerts can be in form of push notification or SMS. Currently this application utilize real time SMS functionality making it real time SMS enabled application which is cost effective as well as in easy reach. Figure 7. Depict the profile management screen.

Emergency Room map
Rooms in ER (Emergency Room) bed status of any hospital can be checked easily via software module. Each bed in the emergency room has been incorporated with pressure sensors attached to it. When a patient is present on the bed, sensor will be activated, data will be read by Raspberry Pi and sent to database through Wi-Fi module.
Our hardware will monitor three states of beds 1) checks if the bed is occupied 2) monitors if the bed is vacant and 3) This is used for monitoring the functionality of the hardware which is the case where any technical issues like hardware failure, power failure etc. happens. The third state helps us to figure out if the hardware is not functioning properly.
Application will update the status of the bed in the database which indicates user regarding the status of the bed. The emergency room map is shown in Figure 7 If bed indication color is green it ensures the availability of bed i.e ideal status and if the indication color is red that states the bed is occupied. Grey color is used for bed that is not operational i.e. there is some problem associated with the hardware. Pressure sensors will be used to synchronize bed status with the server. Pressure will be monitored periodically, so that if patient go for some medical tests the system will not update the status of bed to ideal. When the user selects the hospital the ER map will be displayed on the user application along with beds status. If all beds occupied then user will take the patient to some other hospital without wasting time. This feature will fast track the time to reach hospital for treatment which will decrease risk of any mishap.

Location Sharing
In case of emergency user can share his/her real time location to his/her family members. To use this feature user has to save the contact numbers of his/her family member at the time of profile management.

SOFTWARE MODULE FOR ADMIN
The most important module of our application is the admin module this module has live connection with our firebase database, user registers or assigned an admin role have the ability to make all changes required in the live system they can not only add or delete data but can also monitor the way any user is using the application. Admin may also have the privileges to enable or disable any registered user. With respect to mobile app which is specifically and separately developed for an admin will allow him to make any changes he wants to hospital live details. These changes can be made on the go and he can remotely add delete or update a hospital. In order to enhance the abilities of our application and make it more accurate for user to track based on GPS coordinates, hence in order to achieve this ability we have incorporated a key element in library from google map repository. The library we are using is of google places as this API not only provide the ability of a live places search to our edit text field but also help us design filters and restrict areas as per location. For example, as the scope of the application is for Pakistan only hence the places that will be displayed will be from Pakistan only. By adding this functionality once user select any place we will be able to fetch the longitude, latitude and address of that respective place using methods available in places API.

SOFTWARE MODULE FOR HOSPITAL STAFF
In order to remove any kind of restrictions from the application and not to make any user feel restricted this system also developed a hospital module. This module is specifically designed for our hospital staff. This module has certain major feature which provides the ability to the hospital staff to update bed status. This feature will enhance future ability that could be incorporated in case of making bookings of bed in advance or when the ambulance is on the way. The application has a single interface which provide ER room map of the hospital by clicking at any bed a dialogue will be open through which the hospital staff can change bed state from available occupied and nonoperational as already discussed the available state means bed is available occupied state mean bed is in use of any patient and the last state is if the bed is not working that can be any problem either with respect to hardware attached its functionality or bed itself i.e its mattress or any other manual mechanism. In the way the hospital staff can share live on ground information of the ER room and save user to reach a wrong hospital and facing a problem of delay in receiving treatment due to any technical difficulty. Figure  10 shows ER bed status management screen.

HARDWARE MODULE
The hardware module contains Raspberry Pi 3 along with pressure sensors. The pressure sensors will read the status of the bed and update it to the Database server firebase. Firebase is a web application and mobile application development platform used for real time database operations. A real time data update will help user to get recent status of bed. This thing will help to check the status of the bed in present. The given proposed system is automatic and can send/receive automatic messages to the database. A key component of our entire system is integration of hardware module with every bed of a hospital emergency room. The features integrated into the hardware module includes a set of various sensors. The sensors included are pressure sensor for monitoring the availability of the bed. The availability is tracked based on the pressure been placed over the bed excluding the pressure of the mattress these pressure values help our system analyses weather the bed is occupied by a patient or not. Our hardware has some additional features which will help us monitor basic vitals of our patient including the body temperature and heart beat these vitals will be shared with hospital stuff in future which will help them remotely monitor their patients, this data will be limited to hospital staff application only. Once hardware receives values from the sensor the values are uploaded on an online database which is been designed and developed on firebase. The reason for choosing real time database of firebase is it allows user to developed live application without having any complexity of developing time consuming API for live DB integrations. With help of development of this hardware module live values can be updated on the database which will be later received on our android application. The android application is linked with firebase database and with help of firebase the data will be shared with respective users automatically filtered and sorted. The system kept a track of the voltage consumed by the hardware and the heat generated by the component, as this has enhanced the optimization of the hardware module and can be later enhanced by adding more advance features

FLOW OF PROPOSED SYSTEM
The overall work flow of Smart ER is depicted in the flow diagram, Figure 13.  The system searches for the nearby hospitals in the radius of 5-10 km of the user. Practical testing is performed in the thickly populated city Karachi Pakistan. From the emergency location, the application search is performed for selecting the right hospital having available bed in the vicinity. Figure 14 shows the Incident site where emergency occurred and the selected hospital Vs Time graph. The approx. estimated time to reach hospital is about 15 minutes. Whereas if the conventional search is performed by visiting all the nearby hospitals 1, 2, 3 and 4, the approx. time consumed to reach the same right hospital 4 is about 50 minutes.
The results showed that the designed IoT based system solves the problem of identifying the available rooms in nearby hospitals in quick time and patients can reach their destination covering shorter possible distance in emergency cases as compared to the finding the right hospital without running the application as shown in the Figure 15.

CONCLUSION
This application is designed to help the user who are in emergency and unable to find the hospital which can entertain according to his/her sickness. It is an application where user just need to login at once. Admin panel has the rights to unregister the users. This application is very user friendly and smart. There is no feature that the user is not able to understand. It is an emergency-based application. The results showed that the designed IoT based system solved the problem of identifying the available rooms in nearby hospitals in quick time and patients can reach their destination covering shorter possible distance in emergency cases. It allows paramedics and individuals to search the hospitals in the vicinity and check the availability of rooms in emergency situation.

FUTURE WORK
The future includes calculation of the actual weight of the patient on bed that helps in sensing/ monitoring coma patient's movements. The area or range could be increased to search a greater number of hospitals and also allows user to reserve the bed online via android application before reaching hospital. The system can be enhanced to check the available rooms, available services/ expertise and other biomedical equipment provided by the hospital.
IoT and medical are vast fields according to their importance and the joining of both can bring a huge change at the time of Emergency to rescue the life of critical patients.