\documentclass[Afour,sagev,times]{sagej}

\usepackage[colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red]{hyperref}
\usepackage{array}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{caption}
\usepackage{placeins}
\usepackage{ragged2e}
\usepackage{epstopdf}
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\renewcommand{\arraystretch}{1.4}

\graphicspath{{./Images/}}

\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.85}
\renewcommand{\textfraction}{0.15}
\renewcommand{\floatpagefraction}{0.8}
\renewcommand{\textfraction}{0.1}
\setlength{\floatsep}{5pt plus 2pt minus 2pt}
\setlength{\textfloatsep}{5pt plus 2pt minus 2pt}
\setlength{\intextsep}{5pt plus 2pt minus 2pt}

\newcommand\BibTeX{{\rmfamily B\kern-.05em \textsc{i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\def\volumeyear{2018}

\begin{document}

\runninghead{Palmer, Fulop, O'Connor and Utley}
\title{Using visualisation methods to analyse referral networks within community health care among patients aged 65 and over}

\author{Ryan Palmer\affilnum{1}, Naomi J Fulop\affilnum{2}, Stephen O'Connor\affilnum{3} and Martin Utley\affilnum{4}}
\author{First}

\affiliation{\affilnum{1}Department of Mathematics, University College London, London, UK
			 \affilnum{2}Department of Applied Health Research, University College London, London, UK
		     \affilnum{3}North East London Foundation Trust, Essex, UK,
		     \affilnum{4}Clinical Operational Research Unit (CORU), University College London, London, UK}

\corrauth{Ryan Palmer,
	Department of Mathematics,
	University College London,
	Gower Street,
	London,
	WC1E~6BT, UK.}

\email{ryan.palmer.14@ucl.ac.uk}

\begin{abstract}
Community health care services are considered integral to overcoming future problems in health care. However, this sector faces its own challenges, such as how to organise services to provide coordinated care given: their physical distribution, patients using multiple services, increased patient use and differing patient needs. 
The aim of this work was to explore, analyse and understand patterns in community referrals for patients aged 65 and over, and their use of multiple services  through data visualisation. Working with a large community provider, these methods helped researchers and service managers to investigate questions that were otherwise difficult to answer from raw data.
Each map focuses on a different characteristic of community referrals: patients reusing services, concurrent uses of different services and patterns of subsequent referrals. We apply these methods to routine patient data and discuss their implications in designing of a single point of access - a service for streamlining referrals.
\end{abstract}

\keywords{Community health care, Data visualisation, Electronic patient records, Network analysis, Patient referrals}

\maketitle

\section{Introduction}
Community health care is formed of clinically diverse services that provide local health care close to or in patient homes.
Within the UK, these services are free at the point of access via the National Health Service and range from potentially recurring, long-term care consisting of several appointments (such as clinic based diabetes services), to shorter, potentially one-off episodes of care (such as home based nursing visits).
The planning and operation of community services is thus challenging given the breadth of their roles, diversity of care and complexity of patient use.

Community services are seen as crucial in meeting the current and future challenges facing health care \cite{ham12}.
They help to ensure that care is: person-centred, coordinated and closer to patients' homes; maintains patient health and independence; and, minimises acute admissions and hospital stays wherever possible \cite{foot14}.
Several high-priority national policies within the UK, such as the Better Care Fund and the NHS Forward View \cite{nhs14}, require a larger role for the community sector.
Thus, there has been an emphasis within NHS policy towards moving services out of acute settings and into the community.
This is often motivated by the perceived benefits that increased community care may lead to reduced health care costs, improved access to services, improved quality of care, a greater ability to cope with an increasing number of patients, and improved operational performance in relation to a patient's health and time \cite{munton11}.

Given the importance of these services, the growing emphasis in delivering more care within the community sector, and the questions around how best to manage these services.
One important question is: how services may be organised to provide coordinated care given their physical distribution, patients using multiple services, increased patient use and differing patient needs? 
This is where the application of operational research methods to community health care may contribute \cite{palmer17}.

A patient's history of community care - the services they have used and the services that they are currently engaged with - is stored and recorded within an electronic database, referred to as electronic health records throughout this article.
Importantly, a patient's use of and access to these services can vary greatly. 
Depending on the service, it is typical for patients to first access these services via a referral from a clinician in primary care, such as a GP, from an acute hospital or from social services.
In this context, a referral is a transfer of care between services made by a formal request and can be made by a range of health care professionals.
Subsequent referrals may also occur with community services able to refer to other community services.
Likewise, in some cases, a patient may self-refer directly.

Patients commonly use a range of community services throughout their lifetime, some of which they may reuse or use in conjunction with others.
The above characteristics make planning within this sector challenging due to complex referral pathways and dynamics of patient use \cite{edwards14}.
Adding to the complexity, community services may be provided by a mixed economy of different types and sized organisations \cite{foot14} and patients may be referred between different services and sectors, thus requiring careful co-ordination. 
For an example of the full range and complexities involved in planning community health care services see \cite{hulsho12}.

With the wealth of collected data, accessible analysis and collaborative research are key to addressing the challenge of how to best organise referrals within this sector.  
We have worked with a large community health care provider in London to understand the dynamics of community referrals and inform service planning through visualisations of referral data. 
Such visualisations may enable researchers and service managers to investigate questions that are otherwise difficult to identify and answer from raw data by presenting the data in understandable, intuitive and informative ways.
In particular, such analyses help to highlight key patterns and relationships within the data.
For an overview of visualisation methods, \cite{cleveland85} briefly identifies and summarises some of the key principles behind data visualisation and comment on some features of graphical representations that may lead to more effective interpretation.
	
The aim of this work was to explore the large and complex system of community care through the visualisation of data, for patients aged 65 and over, focussing on uses of multiple services and whether common patterns of referrals exist.
In this article, we focus solely on services provided by a single Trust in a single borough of London (the only state provider of community health services in the borough).
The patient group was chosen due to the operational difficulties of these services and mix of service users. 
For example, the diverse profile of services makes planning and organising difficult, as do the multiple points of access for each service. 
Furthermore it is highly likely that this patient group would use several community services due to the increased likelihood of multiple morbidities. 
Finally, within the UK, elderly care has been at the forefront of the NHS’s future health care policies \cite{nhs14, nhselderly} making this a timely selection of patient group.
 
Given our aim, the research questions were:
\begin{enumerate}
\item[i.  ] How can data visualisation help understand complex dynamics in community health care?
\item[ii. ] How can key patterns of referrals and timings of patient use be identified through data visualisation? 
\item[iii.] How could the information gained from visualisation inform the future planning of services?
\end{enumerate}

At the time of carrying out this analysis, care managers for the community services were beginning to design a single point of access (SPA).
The SPA is a service that manages referrals into and between community services, seeking to streamline the process and reduce inappropriate referrals.
The plans to implement this service presented an opportunity to make a timely contribution; thus, we undertook a collaborative approach to help inform their thought process in designing this service.

We begin with a brief exploration of the literature on visualising electronic patient records and referral data across health care settings.
This is followed by a discussion of our initial steps and the data we used.
A descriptive analysis of the data is presented in the methods section, alongside a description of each visualisation.
We then present an application of these methods.

Applying these methods to their data, we draw out some implications towards informing their thoughts about the design of their SPA and discuss the benefits and limitations of the visualisations.
We conclude with remarks about possible directions for future work.

\section{Research landscape and original contribution}
Several studies have used data visualisation to understand electronic health records, presenting a range of different methods, applications and insights.
A systematic literature review on methods for visualising electronic health records \cite{west15} included 18 articles published between 1996 and 2013.
A range of methods are presented from evaluations of single patient datasets to larger sets for multiple patients, different colours and sizes of both text and objects; visual filters; and interactive methods used to help explain differences in data.

Several papers from this review were relevant to our work.
For example, the work by C Plaisant et al. \cite{plaisant96, plaisant98} in developing and extending LifeLines - a method for visualising individual patient histories through a series of timeline plots.
Regarding larger sets of multiple patients one paper \cite{falster16} visualised linked health data, exploring what events may occur before and after preventable hospital admissions.
Using several timeline plots in parallel, they presented a rich analysis of length of stay and different types of care interactions to identify patterns of care that preceded or followed a preventable admission.
Overall, the application of visualisations to health care highlights how complex data can be presented in a straightforward and digestible manner, providing valuable insight.
Additionally, more complex methods may help to identify key patterns within the data \cite{falster16}.

A common visualisation method is network representation where pairwise relationships between sets of entities are described by a collection of shapes (nodes) and lines connecting them (edges), see Figure 1.
Nodes are connected by an edge if they relate to each other, e.g. if nodes represent services, an edge connecting them may represent a referral between them.
This structure can be visually informative and provides a means of mathematical analysis, such as graph theory e.g. \cite{bondy76} or social network analytics e.g. \cite{carroll17}.
In this article, we are particularly concerned with using networks to display and communicate information.

\begin{figure}[h!]
	\centering
	\includegraphics[width = 0.8\linewidth]{NetworkEx.png}
	\caption{Diagram of a simple network representing referrals between services.}
\end{figure}

Network representations may be used to understand a variety of health care processes.
For example, Zhang et al. \cite{zhang15} having identified subgroups of patients, network representations were used to understand clinical pathways within chronic kidney disease care.   
Node and edge sizes were used to represent the number of patients in specific states and the number transitioning from one state to another, respectively.
Node colouring highlighted key information such as the type of care interaction. 

Additionally, Soulakis et al. \cite{soulakis15} produced an analysis of data for hospitalised patients with heart failure was conducted using network methods.
The sharing of patient records between providers was visualised with node size indicating the number of patient records used by a provider and edge width representing the number shared between them.
Node and edge colouring were used in combination with an analysis of the network's structure for identifying sub-networks of providers who commonly shared records.
Thus, node colour related to the group in which the provider belonged and edge colour to their source. 
These examples highlight how network visualisations can be used to understand different characteristics and patterns within a dataset.

Our work makes several contributions to this research landscape.
We present a range of methods, each exploring different characteristics of community referrals, forming a comprehensive analysis.
To our knowledge, this is the first visualisation work to consider community health care and the referral dynamics of this sector, in particular: analysis of a wide range of different services, reuse of services and concurrent uses of different services. 
Whilst applied to a single provider, the methods are generalisable and easy to use in other boroughs, trusts and organisations.
These maps are visually impactful, informative and simple to create, increasing their scope for use and application in practice.

\section{Methods}
\subsection{Initial steps} 
This project was established, scoped and formed with the input of our collaborating Trust.
To begin, we organised scoping meetings with clinicians and care managers from a broad range of community services (over 15 services).
These contacts were provided by the Associate Medical Director for Quality Improvement and included care leads from physical health services and mental health services.
These meetings were undertaken as part of an immersed operational research approach involving problem structuring and exploration through shadowing, facilitating consultations and project refinement \cite{mingers00}.

The aim of these meetings was to learn from the Trust's staff, especially regarding their understanding of how the system was formed and operated.
These meetings consisted of informal discussions - either face to face or by a phone call - and a session in which staff participated in two mapping exercises.
The discussions were carried out to gain an understanding of what type of care is provided by each service, what a patient's typical use of service looks like and the timeframe of a typical patient use.   
The aim of the mapping exercises were to identify: the types of community services delivered by the Trust; how patients were referred into and between them; whether any common pathways existed (theoretically and in practice); whether there were any significant characteristics that we should consider from the outset; and, whether any previous attempts had been made to visualise this system.

From these exercises, three main characteristics were discussed. 
Firstly, that all 30+ community services for physical health (services for treating physical ailments only) provided by the Trust we partnered with could theoretically refer to each other, whilst in mental health referral pathways were more clearly defined.
Secondly, it was believed that a large proportion of possible referral paths would be used.
Finally, that it was common for patients to reuse services multiple times.
We therefore sought to use visualisation methods to understand the referrals within the system formed of physical health services in order to understand the key dynamics better. 
The next step was to obtain and explore patient data for producing these map.

\subsection{Routine patient data - content and cleaning}
We used a non-identifiable, patient level, routine dataset of patients aged 65 and over, who used our collaborator's community services within a single borough.
When analysing patient data there are several ethical considerations regarding the storage, handling and use of the data.

To ensure that data was secure, it was stored within a Data Safe Haven \cite{UCLIDHS}, an encrypted technical solution for storing, handling and analysing sensitive data.
This Haven is certified to the ISO27001 information security standard and conformed to the NHS Information Governance Toolkit.

Regarding the use of health care data, in undertaking this work we ensured that we fully complied with both the Trust’s and academic ethics and governance processes throughout. At the outset, we sought both NHS or institutional ethical approval. From the HRA tool and consultation with the Trust there was no need to gain NHS ethical approval due to nature of the research. Thus, we sought institutional research and ethics review, during which the research was deemed to not require review – thus our application to the review process was removed during the initial screening. These decisions were made based on our use of non-identifiable pseudonymised patient data in a non-interventional study. Conformity to the governance process was ensured by removing all time stamps and instead using days since a patient's index referral and ordered referral markers to manage the dataset. 

It should be noted however that the data is of commercial sensitivity to the Trust. 
This data is used for contracting purposes, financial forecasting and performance measurement amongst others. 
Thus, in bulk it provides comprehensive and detailed information as to how the Trust operates that may affect its financial future. 
To this end, we are unable to publish interactive versions of our reproducible results since this would make a large amount of commercially sensitive and detailed data available.

The data consisted of all referrals between 1 April 2014 and 31 August 2016.
Lasting from the date of referral until discharge, referrals consisted of one or more appointments - represented as a row in the data.
Thus, a patient's community care history could span multiple rows and consisted the combination of their referrals to community services.

Table 1 details the key information required for our mapping and the level it was recorded at - patient, referral or appointment (App.) level:
\begin{table}[h!]
	\small\sf\centering
	\begin{tabular}{L{1.7cm} L{4.5cm} L{1.1cm}}
		\toprule
		\textbf{Variable name} & \textbf{Description} & \textbf{Level} \\
		\midrule
		Client ID & Non-identifiable patient reference. 20293 unique IDs & Patient  \\
		Ref ID & ID for referral. 65306 unique IDs & Referral \\
		Referral Datetime & Date and time of referral & Referral \\
		Source & Description of where patients were referred from. 44 Sources (Processed) &  Referral  \\
		Specialty Description & Description of medical discipline patients were referred to. 31 Specialties (Processed) & Referral \\
		Discharge Datetime & Date and time of discharge & Referral \\
		Length of Stay & Length of referral - days & Referral  \\
		Appointment Date & Date and Time of contact & App. \\
		\bottomrule
	\end{tabular}
	\caption{Variables contained in the dataset used for producing visualisations}
\end{table}

Prior to its use the data were cleaned using a semi-automated pattern matching and duplication identification to find data that had been input incorrectly or were missing.
For example, times were frequently incorrect or missing and often recorded as midnight rendering the information unusable.
As a result, fields with missing data were not used within the analysis and we did not use imputation methods to counteract this. 
Furthermore, in some cases multiple labels were used in the dataset. 
For example, some services were recorded under multiple names, such as the Nutrition and Dietetics Service which was also recorded as: \textit{Adult Nutrition \& Dietetic Service, Nutrition \& Dietetic Service, Nutrition and Dietetic Service}.
To overcome this, we used only a single label pertaining to the most common usage and changed the other labels to align.
After cleaning, several subsets were produced for analysis. 

\subsection{Initial analysis of individual patient pathways}
The data were left truncated with some referrals beginning before 1 April 2014, and right censored such that not all referrals had concluded by 31 August 2016. 
Only appointments from 1 April 2014 onwards were included in the data.
Due to left truncation, a patient's first referral is unknown, we therefore note their first referral in the data as their \textit{index referral}.
Figure 2 illustrates the above, providing an example of hypothetical referral data for an individual patient.
To overcome difficulties presented by incomplete data, we only use information for referrals that had began on or after 1 April 2014 and finished on or by 31 Aug 2016 in our remaining analysis.

\begin{figure}[h!]
	\centering
	\includegraphics[width = \linewidth]{SinglePatientExample.png}
	\caption{Hypothetical patient level referral data for community health care. The grey dots each represent an appointment}
\end{figure}

\noindent Informed by our collaborator's local and expert knowledge, we identified four dynamics of patient use from the individual plots. 
We anticipated these dynamics having identified them from a systematic review of operational research literature \cite{palmer17}, yet needed to analyse multiple plots to assess the prevalence of these behaviours in the Trust's services.
These four dynamics are indicative of community health care (by design and the nature of the care provided) and are key differentiators of these services in comparison to primary and acute care.

Firstly, there was a large variation in the number and range of services used by patients.
Some used a single service once, whilst others had multiple referrals, sometimes to the same service.
This range is shown in Figure 3.
\begin{figure}[h!]
	\centering
	\includegraphics[width = 0.9\linewidth]{HistoMaxRefs-v2.png}
	\caption{A histogram showing the distribution of the total number of referrals per patient in the dataset - maximum of 64 (Log scale inset)}
\end{figure}
Secondly, referrals to different services commonly overlapped. 
Figure 4 shows the distribution of the maximum number of services used at the same time per patient.
Thirdly, the number of appointments, timing of subsequent referrals and length of referral varied. 
The distribution of referral length is shown in Figure 5. 
Whilst the majority of patients experienced short length of stays, there is a long tail to this distribution with many lasting over 200 days.
Notably, in Figure 5 some patient's referrals lasted over 800. 
Referrals of such length are both possible and expected given the nature of care provided in community services.
For example, many services provide long-term care to patients with chronic conditions, thus long referrals would not be uncommon for a service such as District Nursing when caring for home-bound patients. 
Fourthly, we began to see common patterns of referral with patients using similar sequences of services.
This information informed the data visualisation methods discussed in the next section. 

\begin{figure}[h!]
	\centering
	\includegraphics[width = 0.9\linewidth]{HistoMultipleReferrals.png}
	\caption{A histogram showing how the maximum number of concurrent referrals, per patient, is distributed within the date range of the dataset - maximum of 12}
\end{figure}

\begin{figure}[h!]
	\centering
	\includegraphics[width = 0.9\linewidth]{HistoLOS20-v2.png}
	\caption{A histogram showing the distribution of referral lengths in days - maximum $> 800$ days (Log scale inset)}
\end{figure}
3
\subsection{Network map}
Motivated by the potential complexity of referral pathways, we produced a network map using Gephi \cite{ICWSM09154}.
There are two types of node in this network - Specialties and Sources (terms taken from the Trust's dataset), Tables 2 and 3 respectively.
Notably, the service names in Tables 2 and 3 are those used by the Trust, but are for the most part widely accepted for each.
Specialties are our collaborator's community services based within a specific London borough, whilst Sources are the services outside of these that refer to them.
Thus, Sources may comprise of acute services, mental health services, social services, or community services from other providers/boroughs.
Notably, some Specialties may refer to other Specialties, hence edges are directed from the referring service to the receiving.
\begin{table*}
	\small\sf\centering
	\begin{tabular}{L{6cm} R{1.6cm} || L{6cm} R{1.6cm}}
		\toprule
		\textbf{Referral Sources} & \multicolumn{1}{L{1.6cm}}{\textbf{Number of referrals}} &  \textbf{Referral Sources} & \multicolumn{1}{L{1.6cm}}{\textbf{Number of referrals}} \\
		\midrule
		Acute  & 12,586 & Occupational Health  & 1 \\
		Age Concern  & 2 & Occupational Therapy Service  & 315 \\
		Care Co-ordination  & 1 & Other Community Health provider*  & 1,477 \\
		Care Home  & 1,868 & Other Community Professional*  & 108 \\
		Carer/Relative  & 2,434 & Other Medical Referral  & 24 \\
		Clinical Assessment Service  & 1 & Other Source of Referral  & 3,777  \\
		Community Inpatient Service*  & 162 & Palliative Care Service  & 8 \\
		Community Nursing Service*  & 182 & Physiotherapy Service  & 807 \\
		Community Psychiatric Nursing Service*  & 3 & Practice Nurse  & 121 \\
		Community Specialist Nurse*  & 318 & Private Care Provider  & 1 \\
		Day Centre  & 1  & Private Hospital  & 1 \\
		Day Hospital  & 91 & Psychiatry Service  & 1 \\
		Discharge Liaison Service*  & 91 & Rapid Assessment Team  & 38 \\
		GP  & 1,2601 & Residential Home Staff  & 9 \\
		Health Visiting Service*  & 10 & Self Referral  & 4,877 \\
		Heart Failure Service*  & 25 & Sheltered Accommodation Service  & 3 \\
		Hospice  & 75 & Social Services  & 146 \\
		Intermediate Care Service*  & 68 & Specialist Neurology Nursing*  & 1 \\
		Key Worker  & 46 & Specialist Nursing  & 18 \\
		Mental Health Support Worker  & 2 & Stroke Services  & 304 \\
		Night Nursing Service  & 15 & Transfer In  & 4 \\
		Non-Emergency Health Care Service (111)  & 27 & Walk-in Centre*  & 1 \\
				& & & \\
		\bottomrule
	\end{tabular}
	\caption{Sources for community referrals included within the data set. Community services included in this table represent those that did not feature as a Specialty in the dataset. * indicates a community provided by another provider or borough. }
\end{table*}
\begin{table*}
	\small\sf\centering
	\begin{tabular}{p{6cm}  R{1.6cm} || p{6cm} R{1.6cm}}
		\toprule
		\textbf{Referral Specialty} & \multicolumn{1}{L{1.6cm}}{\textbf{Number of referrals}} & \textbf{Referral Specialty} & \multicolumn{1}{L{1.6cm}}{\textbf{Number of referrals}}\\
		\midrule
		Community Beds	&	331	& 	Neurological Specialist Nursing	&	63	\\
		Community Cardiology Services	&	380	& Nutrition and Dietetics	&	2,575	\\
		Community Matron	&	1,328 & Oncology Specialist Nursing	&	107	\\
		Community Rehabilitation Services	&	1,409	& Orthopaedics	&	1,031	\\
		Community Therapy Service	&	2,064	& Orthotics	&	544	\\
		Community Treatment Team	&	12,598	& Phlebotomy	&	2,251	\\
		Continence Service	&	375	& Podiatry Service	&	288	\\
		Continuing Healthcare	&	1	& Prosthetics Service	&	10	\\
		Diabetes Service	&	568	& Psychological Services	&	38	\\
		District Nursing Service	&	8,461	& Respiratory Service	&	1,014	\\
		Falls Service	&	976	& Specialist Palliative Care	&	8	\\
		Integrated Care Liaison	&	971	& Specialist Seating	&	4	\\
		Intensive Rehabilitation	&	1,562 & Speech and Language Services	&	912	\\
		Intermediate Care Service	&	102	& Tissue Viability Services	&	942	\\
		Leg Ulcer Service	&	2	& Wheelchair Service	&	414 \\
		Musculoskeletal Service	&	4,179	& & \\
		& & & \\
		\bottomrule
	\end{tabular}
	\caption{Our collaborator's community services, known as Specialties, included within the data.}
\end{table*}

Volume of activity and frequency of patient reuse is represented in four ways: edge width, node size, edge colour and Specialty node colour.
Edge width represents the total number of referrals between two services - ranging from 1 to 5810, whilst edge colour represents the average number of times unique patients used the edge. 
Source size corresponds to the number of referrals initiated, and Specialty size corresponds to the total received. 
Sources are uniformly white, whilst Specialties are coloured according to the average number of appointments per referral. 

Due to the possibility of multiple Sources referring to each Specialty  and left truncation, this network can only be used to interpret pairwise relationships.
Whilst visually connected; empirically, the data may not contain continuous paths between more than two nodes.

\subsection{Chains of referral and concurrent use}
Figure 6 shows how the number of patients in their 2nd, 3rd, 4th, 5th and 6th+ referral changes over time, since the start of their first referral - time 0.
Figure 7 shows how the number of patients in two, three, four and five or more concurrent referrals changes over time.
\begin{figure}[h!]
	\centering
	\includegraphics[width = \linewidth]{ReferralsTime2.png}
	\caption{Timelines showing the number of patients in their 2nd, 3rd, 4th, 5th and 6th+ referrals over time. Time $ = 0 $ corresponds to the start date of a patient's index referrals}
\end{figure} 
\begin{figure}[h!]
	\centering
	\includegraphics[width = \linewidth]{MultipleReferrals.png}
	\caption{Timelines showing how the number of patients involved in two, three, four and five or more concurrent referrals changes over time. Time $ = 0 $ corresponds to the start date of a patient's index referrals}
\end{figure}

Due to right censoring, these plots bias towards shorter referrals.
However, they highlight the potential for subsequent referrals to overlap.
Thus, we examined the data further to identify chains of referrals, and services which were commonly used at the same time.

A chain occurs when patients are first referred to a Specialty which then refers them onwards to another Specialty.
The total number of chains and the frequency at which services featured in them are visualised using the R package ``alluvial'' \cite{alluvial}, Figure 9.

Similarly, we analyse how patients concurrently used services with an interactive sunburst plot, produced using R package ``sunburstR'' \cite{sunburstR}, Figure 10. 
By design, any service may theoretically refer to any other, and it was our collaborator's expectation that many of these services would be used at the same time as one another.
Furthermore, due to the nature of these services and the potential diversity of patients none of these are mutually exclusive in terms of concurrent patient use.
The only exceptions are where use of an inpatient service implies it is not possible to concurrently use clinic or home based services.
Thus, the sunburst plot provides a means for exploring this complex and highly linked characteristic of services.

The sunburst plot, Figure 10, is a hierarchical plot showing the number of patients using different combinations of service.
The plot consists layers of rings each divided into segments that represent different services, as indicated by colour.
The inner most ring contains parent segments, representing all services used concurrently with at least one other service.
The size of each segment shows the number of times this service was used concurrently.
In the next ring, the parent segments are divided into sub-segments. 
Considered in combination with their parent segment, these segments represent pairs of concurrently used services, with size indicating how many times they were used together.
Each subsequent ring follows this pattern, dividing into further sub-segments, increasing the number of services used together.
This plot is also orderless, aiding navigation.
For example, the size of a segment for service A in the second ring with a parent service B, is the same size as the segment for service B in the second ring when service A is its parent.
Joint uses can thus be examined starting from a service of interest.
In creating the graph in this manner, each possible order of service combination appears in the plot.
Thus, combinations of three services have six segments in the third ring and combinations of four services have 24 in the fourth.

\section{Application to a single point of access}
\subsection{Network Map}
Beginning with the complete map, Figure 8(a), there are 75 nodes comprising 44 Sources and 31 Specialties (11 referring to other Specialties) with 386 edges representing 45,506 referrals.
\begin{figure*}
	\centering
	\includegraphics[width = 1\linewidth]{Networks.png}
	\caption{Network maps of referrals within our collaborators community health care services. (a) all Sources, Specialties and edges; (b) Specialty only network with all Specialty to Specialty referrals; (c) High activity network: edges with $ > 2 $ per month; (d) Low activity network: edges with $ \leq 2 $ per month.}
\end{figure*}
Whilst visually complex, the relationships between nodes can be explored interactively within Gephi by highlighting individual nodes to reveal its nearest connecting neighbours.
When sharing the network with collaborators, this was useful for highlighting key information, exploring the network and identifying services of interest.

Working through the network, two levels of referrals were identified.
Firstly, Figure 8(c) displays the bulk of activity from a few high activity services, formed by filtering the network to only include edges representing more than two referrals per month.
Consisting 36 nodes - 14 Sources, 22 Specialties (seven of which referred to other Specialties) and 81 edges - this network represents 93.1\% of all patient referrals. 
Secondly, Figure 8(d) displays the large number of low activity services and edges, formed by filtering the network to include edges which have two or fewer referrals per month.
Representing the remaining 6.9\% of referrals, there were a total of 74 nodes - 44 Sources, 30 Specialties (with 11 referring to other Specialties) and 305 edges.

\begin{table*}
	\small\sf\centering
	\begin{tabular}{L{5cm} L{5cm} R{2.6cm}}	
		\toprule
		Referring Specialty & Receiving Specialty & \multicolumn{1}{L{2.6cm}}{Number of referrals} \\
		\midrule
		Community Matron & Community Treatment Team & 117 \\
		Community Matron & Integrated Care Liaison & 179 \\
		Diabetes Service & Nutrition and Dietetics & 189 \\
		Speech and Language Services & Speech and Language Services & 223 \\
		Nutrition and Dietetics & Nutrition and Dietetics & 398 \\
		District Nursing Service & District Nursing Service & 483 \\
		District Nursing Service & Tissue Viability Services & 511 \\
		\bottomrule
	\end{tabular}
	\caption{7 high activity referral edges forming the bulk of activity in the Specialty to Specialty network, Figure 8(b)}
\end{table*}

To further understand this system, we calculated various network statistics.
In Figure 8(a), the average number of edges connecting each node is 5.147.
Furthermore, the directed network density with loops - the number of edges in the network divided by the total number of possible edges, with loops occurring when Specialties refer to themselves - is 0.17.
Due to the source-specialty structure of the network, we used an adapted density formula for this network:
\begin{equation*}
    G_D = \frac{|E|}{|N| \times |N_{spec}|}
\end{equation*}
Although displaying significant connectivity, these measures are low in comparison to our collaborator's thoughts that the network could be near completely connected, as noted in the Initial Steps section, which would correspond to a directed network density closer to 1.
To investigate further, the network was filtered and resized to look at Specialty to Specialty referrals only, Figure 8(b).
Containing 28 Specialties and 74 edges, this network represented 2,919 referrals with a directed graph density of 0.094.
Furthermore, eight nodes and seven edges represented 2,100 of these referrals - Table 4 - confirming that relatively few Specialties referred to each other.

\begin{figure*}[h!]
	\centering
	\includegraphics[width = 0.99\linewidth]{ChainsOfReferralTrip.png}
	\caption{Chord diagram for chains of length 1 - number of occurrences $>$ 20}
\end{figure*}
\begin{table*}
	\small\sf\centering
	\begin{tabular}{p{4.1cm} p{4.1cm} R{2.2cm} R{2.2cm} R{2cm}}	
		\toprule
		Referring Specialty & Receiving Specialty & \multicolumn{1}{L{2.3cm}}{Onward referrals within 14 days} & \multicolumn{1}{L{2.3cm}}{Onward referrals within 28 days} & \multicolumn{1}{L{2.3cm}}{Onward referrals overall} \\
		\midrule
		District Nursing Service & Tissue Viability Service & 69  & 91  & 225 \\
		Diabetes Service  & Nutrition and Dietetics  & 107 & 121 & 159 \\
		District Nursing Service & District Nursing Service & 66  & 73  & 122 \\
		Nutrition and Dietetics  & Nutrition and Dietetics  & 29  & 51  & 97 \\
		Community Matron  & Community Therapy Service & 34  & 44  & 65 \\
		Community Matron  & Community Treatment Team & 19  & 25  & 62 \\
		District Nursing & Nutrition and Dietetics  & 14  & 20  & 44 \\
		Community Matron  & Integrated Care Liaison & 41  & 42  & 42 \\
		Speech and Language Service & Speech and Language Service & 7   & 14  & 37 \\
		Community Matron  & District Nursing Service & 7   & 9   & 31 \\
		Community Matron  & Nutrition and Dietetics  & 6   & 9   & 22 \\
		\bottomrule
	\end{tabular}
	\caption{Chains that occur more than 20 times in the data}
\end{table*}
\begin{figure*}
	\centering
	\includegraphics[width = 0.9\linewidth]{Sunburst1.png}
	\caption{Example of joint uses of service - number of occurrences $>$ 20}
\end{figure*}
\begin{figure}
	\centering
	\includegraphics[width = \linewidth]{SunburstBC1.png}
	\caption{Example of interactive capability of the sunburst plot}
\end{figure}

\subsection{Chains of referral and concurrent use}
Next, we analysed chains of referrals consisting of a Source, first Specialty and second Specialty.
Only considering the first and second Specialties, 47 combinations representing 814 patient uses were found.
Altogether, there were nine different first Specialties and 23 different second Specialties with eight common between the two sets.
To visualise this data, a flow diagram was produced using the R package ``alluvial'' \cite{alluvial}, Figure 9.

Of the first Specialties, District Nursing Service (DNS) and Community Matron services were the most common, featuring in 17 and 15 chains, respectively, and accounting for 470 and 270 total patient uses, respectively.
In comparison, the next most common were Nutrition and Dietetics, and the Diabetes Service featuring in three and two chains, amounting to 114 and 161 patient uses, respectively.

For second Specialties, the maximum number of chains that a Specialty featured in was five, with a mean of 2.04 overall.
There was large range in the number of patient uses for these second Specialties: Nutrition and Dietetics, 325; Tissue Viability service, 227; DNS, 154; Community Treatment Team, 77; Community Therapy Service, 77; and Speech and Language Services, 62.
Significantly, 260 patient uses represented loops where the first and second Specialty were the same.
This occurs when Specialties consist of multiple teams that each provide different types of care which patients may be referred between.

In response to this information, care leads suggested that it would be useful to understand how the timing of these onward referrals, in particular those that occurred within four weeks of the first referral. 
Table 5 presents chains with more than 20 occurrences, recording how many occurred in the first 14 days, 28 days, and time span of the data.
This analysis could help identify inappropriate referrals, where patients may have required multiple referrals in the first instance or were referred to an incorrect service.

Investigating chains of three and four Specialties would be a natural next step, however we cannot present an extensive analysis here since few of these chains existed in our dataset.
For chains of length three, 66 combinations represented 196 patients uses, yet only two had more than ten occurrences.

We also visualised joint uses of service by an interactive sunburst plot, Figure 10. 
Highlighting different segments reveals which services were used at the same time, displaying a step by step chain and the number of occurrences, Figure 11.
Immediately, it is clear that DNS and Community Treatment Team are the most concurrently used services.
This map is visually complex, however its interactive capability helps overcome this for nuanced analysis \cite{west15} (for an example of the interactivity of sunburst plots, see \cite{sunburstexample}). 

\section{Discussion}
The aims of this work were to explore the large and complex system of community care through the use of data visualisation by exploring how patients aged 65 and over use multiple services and whether common patterns of referrals exist. 
Through collaboration with care leads and the exploration of patient level data, we applied several visualisation methods to a Trust's referral data in order to analyse the key dynamics of referrals within their community services.
Hence our first research question - ``How can data visualisation help understand complex dynamics in community health care?'' - was addressed by these visualisations as they helped to understand the complex dynamics of patient use of community services such as: concurrent use of multiple services, the timing of patient use and repeated use of individual services.

Having shared this work with care managers throughout, the main benefit of these methods was the opportunity to ask and investigate more refined questions around the nature and patterns of referrals as they designed their single point of access (SPA).
Notably, answers to these questions could be gained from exploring the raw data and further analysis of more complete data.
Whilst the sharing of the visualisations led to more detailed discussion, at the time of concluding this work the SPA was still in development; thus, we can only detail the resulting discussion topics and points raised.

The visualisations and analysis presented addressed our second research question - `` How can key patterns of referrals and timings of patient use be identified through data visualisation?'' - as discussed below.
Using a network representation, node and edge colouring, and network filtering helped to provide greater understanding of the Trust's community referral data.
This informed the service managers' thoughts around the design of a SPA by identifying directions for further investigation.
This included questions around what level of activity is appropriate within the system; and whether the dynamics and patterns presented within the network map were expected.

When interacting with the network in Gephi, service managers began to identify possible services for inclusion within the SPA.
They discussed what sort of activity it should handle, e.g. only external referrals from GP, social care and acute? and whether this would help to reduce some of the low level activity and help avoid inappropriate referrals.
Considering high activity, questions arose about whether natural groups of services existed and how referrals between them could be handled by a SPA and how the introduction of a point of triage may affect the structure of these referrals.
For example, would only handling Specialty to Specialty referrals help the SPA to have a positive effect on patient access through improved handling of multiple referrals for a single patient? and how could the SPA be designed to streamline referrals so that patients are referred directly to the appropriate services?

Evaluating chains and concurrent uses of community services enabled the analysis of sequences and the identification of common pathways.
Such information may be used to inform referral guidelines and service planning.
For example, after sharing this work, our collaborators suggested this method may help identify cases of inappropriate referrals in instances where the initial referral is short and the specialty acts as a ``point of triage'', rather than a point of care.
Thus, the SPA could be used to prevent this.
Similarly, such a referral may indicate that patients who are referred to a particular service, say the Diabetes service, often require another service, such as the Nutrition and Dietetics service, which could have been made alongside the initial referral, potentially improving the ease and speed of access.
Furthermore, plotting chains of community services helped our collaborators to understand what services patients used and if any typical sequences of use existed in the data.
This provided information that could be considered at the initial triage of referrals within a SPA by giving an indication of what may happen later in a patients care, aiding future planning of care.

The above discussions highlight how our third research question - ``How could the information gained from visualisation inform the future planning of services?'' - was addressed by this work having presented useful information to care leads that led to discussions about what considerations are important for the future planning of services.

Regarding community health care in the UK as a whole, the use of visualisation within different local contexts can provide a means to investigate and understand the key referral dynamics of different demographics.
The information gained from data and system analysis may have many practical implications within the sector \cite{hulsho12}.
Community health care is made up of several, semi-autonomous services, each with a distinct function, that are linked by an overarching purpose that they each contribute to achieving - the maintenance and improvement of patient health by ensuring equitable access to care that is free at the point of access \cite{foot14}.
Thus, for a complex and fragmented system of care, such as community health care \cite{edwards14}, these visualisation methods may have a significant impact by overcoming some of the complexities and difficulties that are present in this sector of care.
Given the range and depth of patient data and information that is collected, analysis using visualisation methods can help both researchers and care managers to learn more about these services and how they may be best organised to achieve their intended purpose \cite{zhang15}.
 Furthermore, these methods can help to identify the key dynamics of patient use amongst different demographics and help to highlight possible issues in how patient's access and use services. 
Thus, such studies can be broadly effective by informing care managers and staff about what problems are of chief concern across demographics and what questions to investigate when redesigning these systems \cite{sterman00, kucu11}. 
This is helpful in the community sector since it has seen many changes to its configuration and funding over the last few decades \cite{munton11}.

\subsection{Limitations and future work}
Through collaborative working, limitations of this work were identified alongside areas for future research.
Limitations in processing and using the data were introduced by working within the Safe Haven, for example Gephi was not available within the Safe Haven.
This increased the complexity of the mapping processes since the data were first processed in the secured setting and extracted for mapping.
A further limitation occurred in sharing this work.
When exploring the maps, collaborators would ask questions that could only be answered by patient level data. 
Not having this available would introduce a time lag in the information we could provide and stifle useful conversations. 

Furthermore, we obtained a single extraction of data for our mapping purposes, limiting the work due to the incompleteness of the data.
For example, we did not have complete information for every patient, and did not know patient entry points to community care.
It would have been insightful to apply these methods to include their first referral, but were limited to using index referrals.

The end date of the data added a further limitation since patients who entered the system later would use fewer services, introducing bias towards shorter referrals.
This could potentially be overcome using Kaplan-Meier curves to evaluate referral lengths, however; this does not overcome the limitation in identifying chains or concurrent referrals.

A solution to these issues is to work within the organisation, where data is more easily accessed and updated.
We therefore ran a seminar for care leads within mental health, physical health and social care to teach them how to implement some of these methods. 
It should be noted however, that access to more data may not improve the work.
Community services change rapidly with new configurations and referral guidelines regularly introduced \cite{edwards14}.
As a result, datasets that spans large time periods may include multiple configurations of the system.
This will lead to inaccurate conclusions or a misrepresentation of the system.
Given the dependency on the accuracy and format of the data required for these visualisations, the reliability and validity of these methods for use in other scenarios may be greatly affected.
In particular, they require that data is linked between services, and that data for a range of services is both available and of a consistent format.

Finally, having studied the setting of community health care, the dynamics of patient use can differ greatly from those found in other care settings. 
Since community services form a wide and large sector of care, the work may be limited in its application to other settings such as acute services \cite{foot14, palmer17}, particularly if uses of multiple services, or multiple uses of a single service are not common within a service - affecting the reliability and validity of the method. 
In application to other community settings, these methods will provide useful insight in scenarios where a mix of patients may use a mix of services over a given time period, and could be used to understand the referrals of patients between acute settings and community settings – such as the scenarios modelled in \cite{wol99, koizumi05}. 
A similar limitation may also exist given the cohort of patients (those aged 65 and over who use services in a specific London borough) since the patterns of use and the conclusions drawn may vary across demographics.
However, given the nature of community service, the reuse of services and the concurrent use of multiple services will still be relevant.
Additionally, since each service is often managed independently, implementing any changes or benefits suggested by studies such as this requires careful co-ordination and communication across services.
Furthermore, these services are often reorganised from the top down \cite{foot14}, it is important that the implementation of new knowledge and directions is carried out in a sustainable manner and does not become disrupted by the ever shifting landscape.

Some questions that arose from this mapping project that were not directly addressed include:
\begin{itemize}
\item Can groups of services which patients ``bounce between'' be identified by data visualisation?
\item Can data visualisation help to identify inappropriate referrals?
\item Can a patient's total care be described by including services outside of physical community care, e.g. acute care, social care and mental health?
\end{itemize} 

These would be good directions for the future of data visualisation and informatics used for health care planning.
Each addresses key difficulties in the provision of community care which are hard to identify from the raw data alone.

\section{Conclusions}
We produced several visualisations to aid the interpretation of referral data. 
Owing to the large amount of patient level data that are captured by services, such studies can provide useful insight that can be used to inform and guide the management and organisation of these services.
There are many methods in both mathematics and health care research that can be used to help improve and maintain these services \cite{hulsho12}; thus, implementing these methods within services can help to better inform health care.
In particular, simple studies can be effective, helping to understand what questions need to be asked and investigated - especially in settings where reorganisation and change occur frequently, making evaluation/understanding difficult \cite{foot14}.
Applied to community health care, these methods have both contributed to the published literature on health data visualisation and helped inform the organisation of community services.

Each analysis focusses on different referral characteristics of community health care.
The network helps understand the vastness and complexity of the system; identifying common groups of services and levels of patient activity, whilst quantifying patient reuse.
Analysing chains and concurrent uses of services provides insight into the progression of patient care and common combinations of services.

When used in conjunction, these maps produce a holistic understanding of the system, providing informative analysis in three ways.
Firstly, they help to understand complex data.
Secondly, they are accessible and aid the identification of individual or groups of services with interesting characteristics.
Thirdly, they stimulate conversation around what information is beneficial in planning these services.

\FloatBarrier
\begin{funding}
RP was supported by the Health Foundation as part of the Improvement Science PhD programme. The Health Foundation is an independent charity committed to bringing about better health and health care for people in the UK. MU and NJF were supported by the National Institute for Health Research (NIHR) Collaboration for Leadership in Applied Health Research and Care (CLAHRC) North Thames at Bart’s Health NHS Trust. The views expressed are those of the author(s) and not necessarily those of the NHS, the NIHR or the Department of Health.
\end{funding}
\bibliographystyle{SageV} 
\bibliography{bibliography} 
\FloatBarrier