Estimating waiting times, patient flow, and waiting room occupancy density as part of tuberculosis infection prevention and control research in South African primary health care clinics

Transmission of respiratory pathogens, such as Mycobacterium tuberculosis and severe acute respiratory syndrome coronavirus 2, is more likely during close, prolonged contact and when sharing a poorly ventilated space. Reducing overcrowding of health facilities is a recognised infection prevention and control (IPC) strategy; reliable estimates of waiting times and ‘patient flow’ would help guide implementation. As part of the Umoya omuhle study, we aimed to estimate clinic visit duration, time spent indoors versus outdoors, and occupancy density of waiting rooms in clinics in KwaZulu-Natal (KZN) and Western Cape (WC), South Africa. We used unique barcodes to track attendees’ movements in 11 clinics, multiple imputation to estimate missing arrival and departure times, and mixed-effects linear regression to examine associations with visit duration. 2,903 attendees were included. Median visit duration was 2 hours 36 minutes (interquartile range [IQR] 01:36–3:43). Longer mean visit times were associated with being female (13.5 minutes longer than males; p<0.001) and attending with a baby (18.8 minutes longer than those without; p<0.01), and shorter mean times with later arrival (14.9 minutes shorter per hour after 0700; p<0.001). Overall, attendees spent more of their time indoors (median 95.6% [IQR 46–100]) than outdoors (2.5% [IQR 0–35]). Attendees at clinics with outdoor waiting areas spent a greater proportion (median 13.7% [IQR 1–75]) of their time outdoors. In two clinics in KZN (no appointment system), occupancy densities of ~2.0 persons/m2 were observed in smaller waiting rooms during busy periods. In one clinic in WC (appointment system, larger waiting areas), occupancy density did not exceed 1.0 persons/m2 despite higher overall attendance. In this study, longer waiting times were associated with early arrival, being female, and attending with a young child. Occupancy of waiting rooms varied substantially between rooms and over the clinic day. Light-touch estimation of occupancy density may help guide interventions to improve patient flow.

Appendix 1. Literature review to inform choice of method 1.1. Methods

Choice of data collection method
A literature review was undertaken to find a data collection method that: 1. Allowed collection of data on the movement of all visitors to the clinic, including those accompanying patients and children, and all clinic staff; 2. Allowed collection of data on movement in all parts of the clinic, including waiting areas; 3. Allowed collection of anonymised data about basic demographics of those attending (age group, sex, reason for attendance) and allowed for identification of those attending with a baby; 4. Did not involve the installation of additional technical (or other) equipment or infrastructure in clinics; 5. Could easily be moved between clinics; 6. Did not violate the privacy or confidentiality of clinic attendees or staff; 7. Was not excessively expensive; and 8. Ideally, could be used (after modification, if needed) in routine practice after the conclusion of the study.

Searching, sifting, and inclusion and exclusion criteria
MEDLINE (via PubMed), Scopus, Web of Science, CINAHL, and Google Scholar, were searched using variations (including Medical Subject Heading [MeSH] terms) and combinations of the following terms: "queue", "patient flow", "waiting times", "measurement", "modelling", "lean", and "six sigma". Results from the different databases were compared and duplicate records removed. Titles and abstracts were then hand-sifted; studies were included that described measurement of the physical movement of individuals through a defined structure or system (including, but not limited to emergency departments, hospitals, airports, and retail outlets); reported on the measurement of the movement of other objects through a defined structure or system (including reports of manufacturing processes and applications of traffic flow theory); attempted to measure the size and/or density of crowds of people, either indoors or outdoors; and reported on methods used to analyse similar data (including applications of queue theory). Articles were excluded that described the application of queue theory to the design or implementation of computing networks or systems (for example, studies of methods to improve management of web traffic) or that were purely theoretical (i.e., that did not describe the collection or analysis of data).

Supplementary material: Estimating waiting times, patient flow, and waiting room occupancy density as part of tuberculosis infection prevention and control research in South African primary health care clinics
Page 3 of 27

Data extraction
Data were extracted by one individual; for articles reporting on data collection, information captured include the study setting, the objectives of the data collection exercise, the outcomes of interest, and a detailed description of the methods used to collect data. For studies reporting on analyses of previously collected data, information captured included any available details of how the data were collected, the outcomes of interest, a description of the analysis process, and any theory used to inform it. A pragmatic, snowballing approach was adopted: where an article described a method that was the same as or very similar to one that had already been documented, only major differences in setting and methods were recorded, instead of all the details described above. As this was a review of methods, findings from included studies were not extracted.
Records were organised using Mendeley and Microsoft Excel; Microsoft Access was used for record sifting and data extraction. Data-driven crowd analysis -software that analyses video images of crowds and 'learns' patterns by performing long-term analysis in an off-line manner. "…learn crowd motion patterns by performing long-term analysis in an off-line manner. The learned motion patterns can be used in a range of application domains such as crowd event detection or anomalous behaviour recognition. …The idea is that any given crowd video can be thought of as being a mixture of previously observed videos."

Rodriguez 2011 8
Density-aware tracking "Detecting and tracking people in crowded scenes is a crucial component for a wide range of applications including surveillance, group behaviour modelling and crowd disaster prevention. The reliable person Structured vs. unstructured crowd tracking "In an unstructured crowded scene, the motion of the crowd appears to be random, with different participants moving in different directions at different times. That is, in such scenes each spatial location supports more than one, or multi-modal, crowd behaviour. For instance, a video of people walking on a zebracrossing in opposite directions is an example of an unstructured crowded scene because, broadly speaking, at any point on the zebra crossing the probability of observing a person moving from left to right is as likely as observing a person walking from right to left. Other examples of such scenes include exhibitions, crowds in a sporting event, railway stations, airports, and motion of biological cells." Rodriguez 2009 10 6 Measurement of structured or linear flow (e.g., traffic)

Measurements at a point or between two points
• "This method is easily capable of providing volume counts and therefore flow rates directly, and with care can also provide time headways" Traffic flow theory 11 Measurements over a short section • "All of these presence detectors continue to provide direct measurement of volume and of time headways, as well as of speed when pairs of them are used" Measurements using (a) moving observer/s • "While the intention in this method is that the floating car behaves as an average vehicle within the traffic stream, the method cannot give precise average speed data. It is, however, effective for obtaining qualitative information about freeway operations without the need for elaborate equipment or procedures."

Measurements across a system/wide area
• The limitation to all three systems is that they can realistically be expected to provide information only on speeds. It is not generally possible for one moving vehicle to be able to identify flow rates or densities in any meaningful way."  Operations research/management • "Having time varying arrivals and heterogeneous patients that need to be treated in consecutive processing steps by several doctors, nurses and other employees, it is a complex environment to control." • "Measurement of crowding: A fundamental weakness is the lack of a measurement gold standard.
There is a weak literature base describing scoring systems of crowding." Carmen 2014 13 Higginson 2012 Proximity sensors X X (X) Cough sensors X Systems for estimating queue lengths (numeric size and duration)

X X (X)
Camera-based systems X X X (X) (X) X X (X) Measurement of structured or linear flow (e.g., traffic)

X X (X)
Queue science approaches (X) (X) X (X) Operations research/management approaches (X) (X) X QI approaches (X) (X) (X) X x = reliably estimated; (x) = partially estimated *Only non-identifiable information collected; participants were free to decline to participate †Scanners were numbered and were 'location specific'. A record was kept of which scanner was used where. ‡A designated barcode was scanned three times in quick succession to denote reassignment of scanner. Time of reset was documented as well as original and new locations of the scanner.

Supplementary material: Estimating waiting times, patient flow, and waiting room occupancy density as part of tuberculosis infection prevention and control research in South African primary health care clinics
Page 9 of 27

Multiple imputation
Four key times were identified in the pathways that each clinic attendee took through the clinic.

Time of arrival
The time that they first arrived at the clinic. This was assumed to be the time that their barcode was first scanned, for attendees who arrived after the start of data collection. The arrival time was set to missing if the attendee was already present in the clinic before the start of data collection, or if the first time their barcode was scanned was not at a clinic entrance (an external door or compound gate).

Time at files
The time that the attendee obtained their patient file from the clinic reception desk. This was assumed to be the time that their barcode was first scanned at files, provided that it occurred before the first time that they were scanned at vitals or at a consultation room. The time was set to missing if they never scanned at files, or if they scanned at vitals or a consultation room before first scanning at files.

Time at vitals
The time that the attendee has their blood pressure, heart rate, and respiratory rate measured. This was assumed to be the time that their barcode was first scanned at vitals, provided that it occurred before the first time that they were scanned at a consultation room. The time was set to missing if they never scanned at vitals, or if they scanned at a consultation room before first scanning at vitals.

Time of departure
The time that the attendee left the clinic. This was assumed to have occurred at the final time that they scanned their barcode, provided it occurred at a clinic exit point (an external door or compound gate). The leaving time was set to missing for attendees who were still at the clinic at the end of data collection, or if their barcode was never scanned at an exit point.
In a small number of cases, times at files and/or vitals were missing not because the attendee did not scan their barcode, but because the attendee did not complete that stage. For instance, some attendees who were at the clinic to collect medicine only may have skipped one or both stages. In many clinics, patients on TB treatment also skip the files and vitals stages. In all ten clinics however, the majority of patients were required to pass through both files and vitals, regardless of their visit reason.
Missing times (Table D) were imputed as interval-censored values, with lower and upper bounds of when the event would have occurred, using a sequential approach. First, arrival times at the clinic were multiplyimputed using 20 imputations. For attendees who arrived before the start of data collection, the lower and upper limits of the time of arrival were set to the clinic opening time and the start of data collection, respectively. For those who arrived after the start, the lower limit was set as the start of data collection, and the upper limit was the time that the attendee was first scanned. Second, the time at files was imputed,    (59) 63 (29) 27 (12) 109 (50) 109 (50) 120 (55) 98 (45) 174 (80) 34 (16) 10 (5) WC1 337 224 (66) 65 (19) 48 (14) (16)  2 (3) WC3 120 56 (47) 44 (37) 20 (17) 51 (43)

(22) 343 (13)
*First data collection exercise †Second data collection exercise ‡Arrived before the start of data collection. §Left after the end of data collection Age, sex, clinic, reason for visit, whether there at start/end, and whether the attendee was first scanned in the morning (before 10am) were included in the imputation model. Twenty imputed datasets were created.   The shape of the relationship between time of arrival and time spent in clinic was examined using fractional polynomials, after extraction of one imputed dataset. The optimal second degree fractional polynomial of arrival time had the terms arrival time (-2, 3) . However, there was no evidence that the optimal second degree or first degree fractional polynomial fit the data better than the linear model (p = 0.646 and p = 0.436, respectively) and time of arrival was included into the final model as a linear term.

Supplementary material: Estimating waiting times, patient flow, and waiting room occupancy density as part of tuberculosis infection prevention and control research in South African primary health care clinics
Page 15 of 27  Supplementary material: Estimating waiting times, patient flow, and waiting room occupancy density as part of tuberculosis infection prevention and control research