A System to Quantify Mobility and Occupancy Levels in Clinical Settings: Development and Implementation

Background: The use of location-based data in clinical settings is often limited to real-time monitoring. Here we develop a proximity-based localisation system, and show how its longitudinal analysis can provide operational insights relating to mobility and occupancy in clinical settings. Objective: We measure the accuracy of the system, and algorithmically calculate measures of mobility and occupancy. Methods: We developed a Bluetooth Low Energy proximity-based localisation system, and deployed it in a hospital for 30 days. The system recorded the position of 75 people (17 patients and 55 staff) during this period. We additionally collected ground-truth data, and used it to validate system performance and accuracy. We conducted a number of analyses to estimate how people move in the hospital, and where they spend their time. Results: Using ground truth data, we estimated our system’s accuracy to be 96%. Using mobility trace analysis, we generated occupancy rates for different rooms of the hospital, by both staff and patients. We were also able to measure how much time, on average, patients spend in different rooms of the hospital. Finally, using unsupervised hierarchical clustering we showed that the system can differentiate between staff and patients without training. Conclusions: Analysis of longitudinal location-based data can offer rich operational insights to hospitals. Pri- marily, they allow for quick and consistent assessment of new strategies and protocols, and provide a quantitative way to measure their effectiveness.


Introduction
Hospitals and clinical contexts are often spaces whose physical attributes are closely linked to organisational procedures, processes, and protocols. As such, the movement of people within a hospital can be thought of as the physical manifestation of a particular process. For instance, when a patient visits the hospital for a surgery, a particular sequence is expected to be followed: admission, preparation, anaesthesia, operation, recovery, etc. The patient progresses along this sequence by moving through the different rooms and spaces of the hospital. Similarly, staff movement is closely linked to organisational processes. Further, these rooms are highly specialised locations serving specific clinical and operational functions.
In this paper, we demonstrate how to take advantage of this close link between physical movement, functional, and organisational processes in hospitals to generate operational insights. Specifically, we show how capturing and studying the longitudinal movement of people in a hospital can provide insights into the operational characteristics and efficiency of the hospital. We show multiple analyses where long-term mobility patterns helps us quantify a hospital's operational efficiency. Hospitals are no strangers to localisation technologies [10]. Indoor localisation has seen large technological improvements in recent years [11]-the relatively inexpensive Bluetooth Low Energy (BLE) beacons and Apple's iBeacons standard have brought indoor localisation closer to mainstream use. Most of the applications in hospitals and clinical settings have focused on real-time localisation [22], i.e. locating people or assets quickly and accurately, process mining [31]. However, the data collected by such real-time systems is typically discarded and not accumulated over long periods of time. One reason for the lack of interest in longitudinal analyses is because we currently lack a movement-centered representation that is flexible enough to work with a variety of localisation systems, and that also allows researchers to study people's flow across indoor spaces and rooms.
Yet, outside clinical settings and healthcare, an increasing number of studies suggest that long-term localisation data can provide meaningful insights in workplaces where efficiency is of the essence and where the flow of people and assets can be optimised by studying and analysing their movements. For instance, construction sites aim at minimising the movements of heavy assets to reduce hazards and ensure a safer working environment and researchers are currently working on similar projects [6]. Likewise, hospitals have an interest in reducing the downtime of Operating Rooms (ORs) as they can cost up to $ 1,500 per hour when in standby [2]. This means that hospitals are strongly motivated to develop policies and standards that reduce the downtime of expensive facilities, such as ORs. However, it can be challenging to accurately describe why facilities have downtime, or why patients have to wait for long periods of time.
In this paper we present a room-and movement-centered analysis of longitudinal indoor localisation data, focusing on the semantics of hospital rooms and their role in the workplace workflow. By analysing this data we are able to measure the occupancy levels of different rooms, understand how much time patients and staff spend in each phase of the treatment process, and visualise & quantify the movement of patients and staff over time. We present an overview of the system we developed and deployed, the challenges we faced, and the insights we generated by analysing the longitudinal movement data of staff and patients. We tested and validated our approach in a long-term deployment in a ward of a public teaching hospital with 7 operating theatres. Previous works have looked at gathering insights from indoor localisation systems in different settings: music festivals [21], museums and galleries [38] and clinical [29]. However, these works do not provide a long-term analysis, focusing instead on single-time events or short-term data collection.
From a technical standpoint, the contribution of our work is in the development of algorithms that can analyse longitudinal indoor localisation data and generate high-level insights with minimal training and without an understanding of the specific application domain (e.g., hospitals). Researchers in the field of Geographical Information Sciences have tackled a similar challenge of abstracting indoor spaces [19] from a theoretical point of view, which has been shown to be useful in the modeling of movements in clinical settings [33]. In addition, this paper is the first, to the best of our knowledge, to invert the role of Bluetooth tags and anchor nodes in a longitudinal deployment. From a clinical perspective, our work demonstrates how localisation systems can be used to generate operational and efficiency measures in clinical settings.

Method
We developed a system that captures the movement of staff and patients through the operating ward of a hospital, which spans a single upper floor. Our technological implementation -which we describe next -considered a range of requirements in terms of range, precision, and power consumption. During our study, the staff members we observed had a range of roles, including nurses, surgeons and technical staff. We also captured patients' journey through the various rooms of that ward: starting from the Reception Room, to the Preoperative Rooms (here: Daily Process Unity (DPU)) for preparation, Anaesthetic Rooms (ARs), Operating Rooms (ORs) and finally Recovery Rooms before discharge. Based on discussions and interviews of staff members, we produced a directed graph, as presented in Fig 1, which shows the expected journey of a patient in this ward, from the moment they arrive at the reception to the time of discharge. As part of our aim to quantify the operational performance at this hospital, one of our objectives was to understand what the true patient journey looks like, as opposed to the expected journey. This entailed looking at how much time each stage of the journey takes, and where staff members spend most of their time.

Indoor Localisation System
Hospitals are logistically challenging environments where efficiency and patient care are of the utmost importance. This means that tracking solutions involving bulky devices that require frequent maintenance and attention are not appropriate for such a setting. Thus, the system we deployed had to be unobtrusive, effortless to manage and reliable. Given that rooms play an important operational role in hospitals, we were only interested in capturing location at the room level and not at a more granular scale, such as the specific coordinates of the people being tracked. This means that we were able to use a proximity-based indoor localisation system: these systems have been around for many years [25], and have been used in a multitude of scenarios without deploying substantial infrastructure [13]. The following requirements had the most significant impact on our choice of the localisation system:  Proximity-based localisation systems require fixed hardware at a known location, and mobile hardware that can infer its location when it comes close to a fixed hardware. Due to to hospital's hygiene policies and for their privacy, nurses, surgeons and patients may not be carrying their phones at all times. Further, patients who are about to have an operation are not able to carry any devices. Therefore, in our scenario the mobile hardware (or beacon) carried by people cannot be their phone, and should be a lightweight and noninvasive device that does not distract staff and patients.  The equipment deployed throughout the theatre should provide a battery life that keeps them running and scanning the surrounding for as long as possible without reducing their accuracy. o Because emergencies often take place, a power socket may suddenly become essential to staff members, therefore equipment should not immediately turn off when unplugged. o Staff members often cycle through different departments in the hospital, making it hard to inform and educate them regarding our ongoing localisation project. Staff members are instructed to keep the rooms safe for patients and it might be the case that any new equipment may seem suspicious or new to the staff. o Likewise, patients may not be used to such devices, and they might unplug the anchor nodes or turn off their tracking device.  We wanted to minimise the deployment of infrastructure, which can be disruptive and costly. A number of localisation systems rely on WiFi infrastructure which is already present. However, this requires people to carry their own mobile devices, which is not always possible or desirable. Similarly, RFID systems have been used for localisation, but they tend to have either a very short range of a few cm (passive RFID) or be heavy and noisy (active RFID) [32].
Considering the above requirements in terms of range, precision, and power consumption, we developed a proximity-based localisation system that uses Bluetooth Low Energy (BLE) [7]. The system consists of: Android smartphones deployed as fixed anchor nodes throughout the hospital floor, and RadBeacon Dot iBeacons [4] handed out to patients and staff members as shown in (Fig.  2). The beacons are small and light enough to be attached to the staff badge or patient bracelet. This potentially increases adherence rates, since badges and bracelets are mandated to be worn at all times.
Typically, BLE-based localisation systems rely on beacons as fixed anchor nodes and smartphones as carried devices [28]. Due to the constraints we have identified, we opted for an inverted setup where staff members and patients carry a BLE beacon, while smartphones act as fixed anchors strategically placed throughout the hospital. To the best of our knowledge, this is an approach that has not been tested before in a longitudinal study.
We developed a custom Android application which continuously runs a Low Energy (LE) scan to detect all nearby beacons. The app continuously runs on the phone and locally stores the Received Signal Strength (RSSI) readings of the received Bluetooth packets, along with the timestamp in epoch milliseconds, the minor identification number of the iBeacon emitting the packet, and the IMEI of the smartphone itself. On a daily basis each smartphone uploads to our server a compressed data file containing the collected data. An online dashboard allowed us to monitor our deployment, to check state of the smartphones' network, and check for irregularities or mistakes in the smartphones' and beacons' labeling and configuration. Smartphones sent to the dashboard every few seconds an brief update on their own state, including the last group of beacons they scanned, their battery level and charging state. A screenshot of the dashboard is shown in Figure 3.

Beacon Configuration
According to the manufacturer specifications, the beacon batteries can last between a month and over a year depending on the signal power and to the advertisement rate to which the beacon is set. A lower power or advertisement rate allows for a longer battery life but the beacon emits its identity less frequently, meaning that in cases where a beacon is moving very fast, then the anchor point can miss it. Conversely, a higher power and advertisement rate improve the chances of a beacon being detected at the cost of a fairly short battery life. Due to the way the hardware is built, the advertisement rate needs to be set before the experiment. For this reason, we conducted laboratory measurements to identify the optimal beacon settings for our scenario. We assumed beacons to be moving at walking speed, and wanted them to be detectable at room-size distances, in our case up to five meters away. We configured beacons at different advertisement rates (1Hz, 5Hz, 10Hz) and in our lab we placed them at varying distances from an anchor node (1m, 2m, 5m). In Figure 4 we show the effect of these 2 variables (advertisement rate, distance) on how the anchor node can detect those beacons (i.e., the time between consecutively received packets). Effectively, this is a measurement of the amount of packets lost. Given these experimental conditions, we identified that the optimum setting for our scenario, in terms of battery consumption and packet loss, is at 5Hz. At a frequency of 1Hz we observe a loss packets which is undesirable. At a frequency of 10Hz we observed no noticeable performance improvement, while the drain on battery is doubled.

Deployment
The project was approved by the hospital's Health Human Research Ethics Committee. Each fixed anchor node comprises a plastic container as shown in Figure 2b, containing an Android HTC U11 smartphone. We deployed our anchor nodes throughout the ward (see Fig. 5), and plugged them into the nearest wall socket. Because our objective was to be able to detect the presence of a beacon inside any given room, we placed one box in each room of interest, confirming with the staff that the box would not cause any inconvenience to them or the patients, and that a nearby power source was available. In most of the rooms the box was placed under a desk or mounted on a wall.
We handed out RadBeacon iBeacons to staff members (Nurses, Theatre Technicians and Head Theatre Techni-cians) who attached them to their badges as shown in Fig 6a. Staff members are mandated to carry their badges all the time, usually on their front pocket, or sometimes in their bottom or pants pocket. When a beacon was handed out, we made a manual spreadsheet entry to link the beacon ID to the staff ID. This allowed us to link the beacon ID to staff roles during our analysis. Staff were instructed to keep the same beacon during the study, and make a new data entry if they were issued a new beacon. Patients received their beacon together with their patient bracelet (Fig. 6b), as part of the hospitals standard admission procedure. The hospital uses plastic bracelets to identify patients, which are strapped to their wrists during admission, and cut off when patients are discharged. When nurses gave a beacon to a patient, a spreadsheet entry was manually made to link the beacon ID to the patient ID. This allowed us to identify which beacon belonged to which patient during our analysis.

Ground Truth Collection
Before we began our main deployment, we wanted to validate the data generated by the system. To achieve this, we systematically collected ground truth data in multiple sessions. A researcher carried beacons with them, and traversed the space, while manually logging their precise location and exact time using a smartphone application. In total we collected ground truth data from 18 sessions, each lasting about 15 minutes, collected on a single day. All sessions were quite dynamic, meaning that the researcher moved continuously between rooms, rather than remaining static in a single location. During these sessions we simulated realistic scenarios such as walking down the halls, entering an operating room, roaming around the surgery table and eventually leaving, as well as getting out of the ward and leaving the tracked area. Using this ground truth data, we were able to use our system and test various filtering and analysis techniques until the trips captured by the system accurately reflected the ground truth. We presents all our results in the next section.

Results
Our main deployment lasted for a period of 30 days in September 2019. The deployment consisted of 20 anchor nodes installed in various rooms of the operating ward, including seven operating rooms. We collected a total of 35 million packets emitted from 66 beacons, handed out to 75 different people during this period. Some beacons were re-used, while other beacons were replaced:  Beacons given to 17 patients by reception nurses, who also retrieved them when a patient was discharged,  Beacons were given to 15 nurses and 7 theatre tech staff

Collected Raw Data
At the most basic level, our system captures raw signal strength data, also known as RSSI. For example, Figure 7 shows the RSSI for beacon 585 in the Operating Room (OR) 6 over a period of three minutes. A stronger RSSI theoretically means a closer beacon proximity.
There exists substantial literature on how to use Bluetooth for indoor localisation purposes, and the reported applications range from a simple but less accurate triangulation [35] to the more accurate but laborious finger-printing [17]. For our purposes we are interested in making room-level inferences about individuals' presence, because rooms are strongly linked to organisational processes. This means that we do not need to use triangulation (which requires the deployment of multiple anchor nodes), but can rely on single proximity measurements to infer the room within which an individual is. Bluetooth measurements are notoriously prone to unreliable RSSI readings [16] due to the physical nature of electromagnetic signals. The measurements can be affected by the mere presence of a human body, furniture, and especially walls and floors can attenuate the received signal altering the final RSSI reading. We actually use these limitations to our advantage, by effectively trapping the signal within our areas of interest, and taking advantage of the fact that signals travelling through walls are substantially reduced in strength.
Even though walls and floors work as natural filters, a posthoc filter is still necessary because open doors or larger rooms can cause the signal to bounce off the walls and end up in an adjacent room. We visualise this phenomenon in Fig 8 where we show the raw data collected by all anchor nodes in a span of 13 minutes for beacon 585. In this graph we show along the y-axis the room identifier where beacon 585 was actually detected. The coloured circles indicate the detection and strength of the signal, with purple showing a weak RSSI and red indicating a strong RSSI. The graph shows with a grey line the true path (ground truth) that the beacon took through the space during these 13 minutes. The graph shows that as the beacon moves between rooms (grey line) multiple anchor nodes are able to detect that beacon (coloured circles). The graph also shows that while the beacon is in a particular room, the signal strength for the anchor node in that room is higher (bright red circles). Given the amount of noise in this data, we need to apply filters to estimate the path of the beacon through the various rooms of the hospital.

Localisation accuracy
Bluetooth-based positioning often uses Kalman filters to smooth the RSSI values and remove outlier readings. Previous work [12] shows that while it can improve accuracy, in certain cases a median filter can work just as well, while also it does not modify the data. The purpose of filtering is to remove noise so that the location of a person in a room can be confirmed, at the correct time and with a significant signal strength. We evaluate three different filters, and compare their results with our collected ground truth. Fig 9 shows how the different filters smooth the signal for the data presented in Fig 7. The Kalman and the Savitzky-Golay filters are applied using their respective R package, while the median filter is manually implemented to maximise flexibility. The results in Fig  9 show, as expected, that the Kalman and the Savitzky-Golay filters fit the data correctly but fail to smooth out the signal fluctuations enough to provide a clear pattern, while the median filter provides a smooth estimate that makes it more appropriate for comparing. In our case we desire smoothed values because if the data from different rooms fluctuate substantially then we are likely to have interference and infer that the beacon is moving back and forth between the two rooms.
Next, we need to determine: i) whether we use median filtering on its own or combine it with another filter, and ii) what time window our median filter uses. These decisions are made based on our analysis shown in Fig 10. Here we show the performance of the median filter when applied to the raw data and pre-filtered data, and we also investigate the effect of different window sizes (between Figure 9. Comparison of three approaches to filter RSSI data. 2 and 60 seconds). Our results show that first, adding a Kalman or Savitzky-Golay to the median filter does not improve accuracy. This means that our median filter is robust. We also observe that using a smaller median time window, the resulting readings fluctuate considerably, which may lead to interference across adjacent rooms. On the other hand, a larger median time window can filter out most of the noise and short bursts of high RSSI packets, but in turn it also loses the ability to detect granular movement: a 60 seconds window will inevitably miss smaller events of 10 or 20 seconds. For instance, a staff member visiting a particular room for 20 seconds, and then moving to another room may not be detected using a 60-second filtering window.
We use our ground truth data to evaluate the accuracy of our system using a range of different window sizes. There is no universally accepted approach to measuring the accuracy of data like ours. Therefore, we adopt an approach where we penalise our system for inferring the wrong location at any given time, but we do not consider the magnitude of error. To measure the system accuracy, we split the time series in intervals of 1 second and compared the ground truth data against the reconstructed trace, using a string comparison algorithm (Jaro-Winkler with a prefix scale of 0.25 and cosine distances) [34].
We observe that the optimum filtering window size is 15 seconds with the median filter, giving an accuracy of 96%. For smaller of larger window sizes, the accuracy drops by up to 10%. We therefore use this window size in all our subsequent analysis, meaning that visits to a room that last less than 15 seconds may not be captured, but we will have stronger confidence in the visits that do indeed get captured. Fig. 11 shows how our trace reconstruction process compares to the ground truth. This figure uses the same dataset that we have used in all previous figures so far. We note that this graph shows data over a period for 12 minutes during which time the position of the beacon is inferred to be in a wrong room for about 30 seconds. We also observe that our estimate sometimes appears to be slightly offset from the ground truth, suggesting that transitions between rooms are shifted by a few seconds rather than misclassified, meaning that our approach would not substantially affect longitudinal analysis.

Visualisation of movement
Using this trace reconstruction approach, we now turn to visualising and analysing data over longer periods of time. In Fig. 12 we show the movement of a single nurse over a period of 10 days. From this graph we can make a number of inferences. First, we can see that the nurse typically was at the operating ward during 9am to 5pm, and we can also identify the days when she was not there (e.g. weekend). We can also see that she appears to spend more time in certain rooms (e..g 22-Holding), while she rarely visits other rooms (e.g. 12-OR2). We are also able to see differences in the patters between days. For instance, we see that on Monday and Tuesday the nurse spent a lot of time in room OR-5 (operating theatre 5). This graph demonstrates two things. First, it highlights the richness in the collected data, and indicates the types of inferences that can be made from the data's temporal and spatial dimensions. Second, it demonstrates how visualising movement traces does not scale, and indeed it becomes impractical to attempt to visualise all collected data over the whole month. Therefore, we must develop ways to summarise all our reconstructed trips, and find meaningful ways to interpret data

Operational Insights
Representing the data as a time series of room-based events makes it easy to visualise patterns in the way people move through the spaces. Fig.12 shows the reconstructed traces of a single nurse over 10 days. In this figure we can identify the daily and weekly patterns of the nurse, as well as identify the rooms where most of the time was spent. We repeated this process, and in our analysis we reconstructed all trips for all beacons and people, across the whole duration of the study. Due to the richness of the data, it becomes inconvenient to visualise the data from all participants in this manner. Therefore, we seek alternative visualisations which can more clearly highlight patterns for the whole dataset. We achieve this by visualising the occupancy rates of different rooms by different different types of people. In Fig.13 we visualise the amount of time spent in each room by nurses and patients. This visualisation confirms Figure 12. A reconstructed trace for a single nurse over a 10-day period. X-axis: date/time; y-axis: room.
that there is a clear distinction between nurses and patients and the way they share their time across rooms during the week.

(b) Patients
All patients in this study were daily cases and therefore spent the majority of their time in the Daily Procedure Unit room. Relatively speaking, only a small fraction of their time was spent in the OR or in the Anaesthetic room. In addition, this visualisation indicates that some ORs are used more than others, for instance OR1 is often used multiple times in the lapse of a week while the same cannot be said for OR6. It is important to highlight that our deployment did not recruit 100% of staff and patients. This means that it can be misleading to calculate absolute occupancy rates of rooms. For this reason, in Table 1 we show for each room how much time in total was spent there by different types of people during our deployment. One person-day consists of 86400 seconds (i.e. 24 hours) of a presence by a single person. This is a more meaningful metric that we can use to compare across rooms. Here we see that the operating room 1 (OR1) had the highest occupancy by staff, and the DPUs had the highest occupancy levels during our deployment. In addition, we see how much time, on average, patients spent in different rooms. From our analysis we can calculate how much time, on average, patients spent at different rooms of the hospital, which is indicative of how long each stage of the process took. For instance, we find that patients spent on average: 42 minutes at reception, 10-50 minutes in an Anaesthetic room, 5-20 minutes in an Operating room, 6-9 minutes in Recovery, and 3-4 hours in the Day Processing Unit before they are discharged. Finally, our results show that each person may spend a different amount of their time in different rooms. Effectively, the variations to these patterns can be though of as a "signature" of the person's role and function. To demonstrate this, we apply a very simplistic non-supervised clustering to the data from Fig.13, and the results are shown in Fig.14. Here, we feed the clustering algorithm an array of occupancy rates that describe how each person spent their time across different rooms. The algorithm then clusters people based on these values (shown as the dendrogram on the y-axis). We find that the algorithm, without any additional input or training from us, is able to identify two clusters of patients and two clusters of staff (medical staff, and technical support staff).

Discussion
The System that relies on ultrasound, and therefore provides high spatial accuracy at the cost of a substantial infrastructure investment [3]. A similar system has been developed by Centrak, and uses Bluetooth to provide Real-Time Localisation Services [1]. Similarly, a number of research papers have investigated the use of Bluetooth for real-time localisation [37], while also focusing on particular spaces, such as operating rooms [18], or particular patients, such as newborns [27].
The popularity of real-time localisation systems is increasing because they can provide a number of valuable capabilities. For instance, they allow for staff to quickly call for help, to raise alerts when a patient has wandered into an inappropriate room, and to quickly find mobile equipment or assets when needed. However, these systems do not typically provide an aggregated overview and analysis of operational measures, and do not provide enough information to make grounded judgements about the processes being followed in the hospital. For this reason, hospitals typically undergo short intense bursts of observations to map their activities and movement. These typically last a couple of weeks and rely on manual data collection, which can be costly, time consuming, and subject to the observer effect. In addition, there do exists systems that allow staff to indicate their location and activity, such as TimeCaT [5], but again this requires ongoing manual data entry which can be time-consuming for staff. The reason why manual observation stints remain popular is because longitudinal data is useful to measuring and improving efficiency. In fact, in other process-based disciplines efficiency has been improved using longitudinal analyses, including in public transport [23], traffic routing [24], and construction [6]. Therefore, our paper's premise has been that analysing long-term mobility patterns can help us quantify a hospital's operational efficiency in multiple ways.

System performance
The system's accuracy was assessed using our ground truth data before the main deployment. During the deployment we considered the reliability and robustness of the system. In general we found that the system accuracy was consistently high across all ground truth tests (96%) in terms of room-level localisation [26]. During the actual deployment, there was a number of challenges we faced. For example, some staff lost or misplaced their beacon and had to be issued another one. In these cases, we made a note of the time when the old beacon was lost, and when the new beacon was issued, and these two data points allowed us to seamlessly analyse the movement of any staff member. However, these incidents point to a weakness of the system -and indoor localisation in general [30] -in that it does not work for people do not carry the tags. We also found that our algorithm seems to identify trips that are temporally shifted by a few seconds from the ground truth. This is a side-effect of using a temporal window to apply the median filter [9,20], and we believe that in terms of longitudinal analysis does not significantly affect the findings. We also found that the sampling rate of the beacons was adequate, and the beacons did not face any battery or power issues during our deployment, as expected [14].

Operational insights
Our paper demonstrates how longitudinal data from a proximity-based localisation system can be filtered, aggregated, and analysed to estimate relevant operational metrics related to mobility and occupancy rates. Specifically, we show that the system is able to estimate how much time, on average, patients spend at each stage of their treatment process, which stage seems to take most time, and which rooms they spend most time in. With a larger sample it would be possible to break down these results by particular condition (e.g. heart surgery, hip surgery) and identify trends or outliers within those.
Our system is also able to provide the same metrics for staff, and we have been able to estimate where do staff spend their time, and identify daily and weekly patterns in their behaviour. We show that different types of staff (medical vs. technical support) exhibit different movement patterns, and in fact a simple hierarchical clustering was able to identify the presence of these two staff groups. These metrics can be used to assess the impact of a new strategy or protocol in the hospital. For instance, the metrics can be compared before and after a new scheduling system is deployed at the hospital. The comparison could be used to judge whether patient journeys are affected (e.g. they spend less time at reception), and whether staff working patterns have substantially shifted (e.g. staff spend relatively more of their time in the operating theatre). In addition, it is also possible to characterise and study the behaviour of other relevant subgroups of staff, for example junior medical staff. Their behaviour can be aggregated and analysed to identify how an where they spend their time, and to ensure that their time is spend effectively and with adequate support.

Localisation technologies and representations
From a localisation standpoint, our work does not break new ground in terms of accurately determining the location of people. Perhaps one unique aspect of our work has been our decision to use an "inverted" deployment, whereby Bluetooth tags are given to people and phones are glued to the wall. Typically the opposite takes place; for example in music festivals [21] or museums and galleries [38], Bluetooth tags are installed near items of interest while people carry phones that display information for nearby items. Our decision meant that there was minimal disruption to staff and patients, who had to simply carry a light Bluetooth tag. However, a technical contribution of our work has been our development of a movement-centered repre-sentation that is flexible enough to work with a variety of localisation systems and settings. This allows our system to be easily redeployed to other settings (such as a school, university, gallery) with minimal changes. This is possible because we have developed a data representation that allows us to calculate all the measures we have presented in this paper, but which remains agnostic of the space and environment where the deployment took place. Effectively, this representation allows researchers to study people's flow across abstracted rooms and spaces. Our work bears resemblance to temporal abstraction rules [19], which can be applied to a variety of environments [36], and for example there is previous research [33] on knowledge-based temporal abstraction of clinical phenomena. However, this approach relies on time-stamped clinical data which are part electronic patient records. Similarly, work on Business Process Management [15] relies on electronic records to model corporate operations and functions, and recently this work has been applied to clinical settings [8].
Our work, on the other hand, is able to capture information that is not necessarily part of electronic patient records, and which would be too costly to manually acquire. By capturing movement, we are able to make inferences about about patient journeys and staff work practices. Similar work has recently looked at using Bluetooth to assess the levels of physical activity of people moving inside buildings and consider abstract spaces in a graph form [29]. Their work was confined to a handful of small trials, each lasting a few minutes, whereas our deployment lasted a month and had dozens of participants. Nevertheless, conceptually our work uses a similar approach to model space, in an agnostic manner, and capture people's transition between the various spaces being observed.

Limitations
The deployment we report took place at a single hospital, lasted 30 days, and did not include all patients and staff at the hospital. We do expect that a different hospital or setting might pose different challenges to the study, but we also point out that our algorithms analyses do not rely on any particular characteristic or aspect of the hospital itself. We also acknowledge that our data is sparse, meaning that there were a lot of patients and staff that did not have a beacon in our study, and were not observed by the system. For this reason, we argue that absolute occupancy rates are not particularly meaningful in our case per se, but we can still compare rooms in terms of how much time our participants spent there, which is a relativistic measure. Finally, the deployment period was not long enough to capture any potential seasonal effects, or to any substantial changes to the policies and protocols used at this hospital. A long term deployment, possibly as part of an A-B study design would generate more insights on that front.

Conclusion
In this paper we describe the development, deployment, and evaluation of an indoor localisation system for hospitals and clinical settings. We demonstrate how analysis of longitudinal data can provide operational insights regarding how people inside the hospital move, where they spend their time, and how much do various room get occupied. We also discuss how these metrics can be adapted to measure a number of clinical efficiency measures, and how they can be used to evaluate changes to policies and protocols in these settings. As part of our future work, we are planning to extend our system's algorithms to evaluate the accumulated "exposure" of clinical staff to infected patients, particularly during the covid-19 crisis.

Figures
A reconstructed trace for a single nurse over a 10-day period. X-axis: date/time; y-axis: room.
Snapshot of the online dashboard used to monitor the deployment and data collection. This was used to ensure the deployment runs as expected.