Modelling and performance analysis of clinical pathways using the stochastic process algebra PEPA

Background Hospitals nowadays have to serve numerous patients with limited medical staff and equipment while maintaining healthcare quality. Clinical pathway informatics is regarded as an efficient way to solve a series of hospital challenges. To date, conventional research lacks a mathematical model to describe clinical pathways. Existing vague descriptions cannot fully capture the complexities accurately in clinical pathways and hinders the effective management and further optimization of clinical pathways. Method Given this motivation, this paper presents a clinical pathway management platform, the Imperial Clinical Pathway Analyzer (ICPA). By extending the stochastic model performance evaluation process algebra (PEPA), ICPA introduces a clinical-pathway-specific model: clinical pathway PEPA (CPP). ICPA can simulate stochastic behaviours of a clinical pathway by extracting information from public clinical databases and other related documents using CPP. Thus, the performance of this clinical pathway, including its throughput, resource utilisation and passage time can be quantitatively analysed. Results A typical clinical pathway on stroke extracted from a UK hospital is used to illustrate the effectiveness of ICPA. Three application scenarios are tested using ICPA: 1) redundant resources are identified and removed, thus the number of patients being served is maintained with less cost; 2) the patient passage time is estimated, providing the likelihood that patients can leave hospital within a specific period; 3) the maximum number of input patients are found, helping hospitals to decide whether they can serve more patients with the existing resource allocation. Conclusions ICPA is an effective platform for clinical pathway management: 1) ICPA can describe a variety of components (state, activity, resource and constraints) in a clinical pathway, thus facilitating the proper understanding of complexities involved in it; 2) ICPA supports the performance analysis of clinical pathway, thereby assisting hospitals to effectively manage time and resources in clinical pathway.


Introduction
Today, hospitals are asked to serve more and more patients while maintaining the quality of healthcare with limited medical staff and equipment. This situation causes many serious problems, including overcrowded emergency departments, delayed treatment of urgent patients, long waiting time and decreasing satisfaction of both doctors and patients [1]. Within such a context, it becomes essential to apply information and communications technology (ICT) to achieve more efficient hospital management. Health informatics (also named clinical informatics) applies ICT to healthcare and biomedicine for promoting public health, facilitating hospital management and reducing healthcare cost [2]. Among its various branches, clinical pathway, emerging in the 1980s [3], is a popular tool to outline the sequence and timing of actions necessary to a desired outcome with optimal efficiency [4]. The sequence of clinical actions performed by a multidisciplinary team moves a patient with a specific diagnosis progressively through a clinical experience to a desired healthcare effect [4,5].
Clinical pathway focuses on improving the efficiency of the healthcare process for patients, especially those with acute diseases. A number of factors affect clinical pathways, including changing amount of incoming patients, uncertain diagnosis duration and other unpredictable events. To date, the lack of formal modelling methods in existing techniques [6][7][8][9][10][11][12][13] means the description of clinical pathway is rather vague which results that the complex behaviours involved in clinical pathway cannot be adequately understood by hospital managers. For such an issue, a mathematical model is required to accurately describe these behaviours of a clinical pathway. A novel platform for more efficient clinical pathway management, therefore, is proposed in this paper. The paper features four key elements: 1. A clinical pathway management platform, Imperial Clinical Pathway Analyser (ICPA), is introduced for quantitatively analysing clinical pathway. This platform can construct models of clinical pathway using existing clinical data and conducts performance analysis based on these models. The analysis results can benefit hospitals by providing crucial information for clinical pathway management. 2. Developed from performance evaluation process algebra (PEPA) [14], a stochastic model clinical pathway PEPA (CPP) is introduced to accurately describe different aspects of a clinical pathway, including its state transitions and treatment activities as well as their associated resources and constraints. 3. Using CPP, performance analysis of a clinical pathway can be conducted. The analysis results provide a variety of useful information in the clinical pathway. Firstly, resource utilisation can help hospitals to optimise resource allocation. Secondly, the passage time under different patient inputs shows patients' expected residing time in hospitals. Thirdly, the maximum number of input patients reveals the capacity of hospitals. 4. A stroke clinical pathway obtained from Charing Cross Hospital of Imperial College London is demonstrated. We choose this example for medical and economic reasons. Firstly, stroke is a typical acute disease and the third most common cause of death worldwide. Hence any delay in treatment may result in severe disability [15,16]. Secondly, according to a recent National Audit Office report, 4-6% of the total NHS expenditure in the UK is spent on stroke treatment. It is predicted that the better management of stroke care can bring £20 m in annual savings, 550 fewer deaths and 1700 fewer cases of disability in the UK [17,18].

Motivation
The stroke clinical pathway investigated in this paper is for illustrative purposes. Stroke is a complex disease requiring a systematic integration of services, e.g. primary care, ambulance services, acute treatment and rehabilitation, post-acute rehabilitation, and often longterm health and care support in the community. Due to its complexity and requirement of various services, the stroke clinical pathway presents a significant challenge to existing generally fragmented health and social care services. Moving from the current fragmented approach to an integrated stroke system is a complex task. As simulation models are useful during the planning stage of complex service re-configuration, modelling methods are in demand to simulate and optimize the stroke clinical pathway. Figure 1 displays the abstraction of a general stroke clinical pathway, obtained from Charing Cross hospital of Imperial College London. A new 999 call from a patient or other hospitals initiates an instance of this pathway. The information flow is summarized as follows: 1. First, an ambulance scheduled by London Ambulance Service (LAS) picks up the patient, where a Fitness and Anthropometric Scoring Template (FAST) test is carried out. 2. The patient is sent to the accident and emergency (A&E) resuscitation department and referred to the stroke team, if the FAST test shows s/he potentially has a stroke. Otherwise s/he is sent to the normal emergency department. 3. Next, if the patient is further diagnosed to have a stroke, s/he is sent to the CT department; otherwise s/he is transferred to the normal A&E department. 4. If a CT scan shows the patient does not have a stroke, s/he will be switched to the non-stroke treatment department. If the patient has a haemorrhagic stroke, s/he is transferred to the Hyper-Acute Stroke Unit (HASU). If the patient has an ischemic stroke, clinicians need to further determine whether the patient needs thrombolysis therapy. 5. Afterwards, the patient is sent to the HASU to be cared by occupational therapists for two or three days. 6. Finally, the patient is discharged from hospital, and the community therapy team takes over.
As every patient has his/her own journey, modulated by clinical issues and availability of resources, the clinical pathway in Figure 1 is a model of a highly dynamic system. To model such a system, two challenges need to be addressed: 1. There are many uncertainties in the clinical pathway, so that a model may need to simulate pathways in a stochastic manner. For example, the stroke clinical pathway in Figure 1 has a changing number of incoming patients, and the time spent in each department for different patients may vary significantly. Patients with different diagnoses will be transferred to different departments, taking different routes through the pathway. Therefore a modelling method, which can cope with these complexities, is required.

2.
Performance analysis for different scenarios should be supported. For example, patients would be interested in the expected time they would spend in hospital, while hospitals need to estimate the maximum number of patients they can treat every day and manage the clinical pathway in a cost-effective way. Thus a clinical pathway management platform, which can explicitly evaluate the clinical pathway performance, such as passage time and throughput, would be of interest.

Related work
The general impact of information technology on the clinical pathway like the influence of IT support on the satisfaction of both patients and medical staff is studied [8][9][10]. The clinical pathway can be implemented manually on paper [11] or electronically [12]. With a good understanding of the clinical pathway, a set of evidence-based recommendations forming guidelines for clinical practice can be developed to both formalize and optimize the care process [13]. Thus IT techniques embedded into clinical pathways can efficiently decrease undesired practice variability and improve clinician performance.
Some researchers further propose methods of modelling the clinical pathway. By using quantitative models, the influence of individual resources on overall pathway performance can be evaluated directly. However, little work has been done in the area of modelling clinical pathways with the aim of quantitatively improving system performance. Although in [19], a pathway model to facilitate the stroke care planning process is introduced, without a mathematical representation, the model performance cannot be shown explicitly. The work has been done in [20] applies the workflow graph to model the clinical pathway. Using this model, a similarity function is proposed to evaluate the temporal equivalence of two clinical pathways in order to reduce a complex pathway scenario into a simple one. In [21], ontology is used to describe the clinical pathway. This model allows the hierarchical representation of the clinical pathway, e.g., a clinical pathway can be described as a combination of a high-level outcome flow and a detailed workflow with care time constraints. However, the work done in [20] and [21] cannot build a model to explicitly measure the performance of the clinical pathway, such as throughput and passage time. Some researchers focus on analysing time and resource information in clinical pathway using stochastic Petri net. In [22], Rui et al. introduce the Probabilistic Time Constraint WorkFlow Nets (PTCWF-nets) to model a process. A static analysis method is then proposed to analyse each activity's probability of meeting its time constraints (e.g., deadline) in a process before the process is actually executed. In addition, they develop a dynamic method during the execution of the process [23]. This method can update remaining activities' probabilities of successful execution whenever some activities are completed and their actual durations are known. Time schedulability is only one aspect of performance analysis in clinical pathway and it is closely related to another aspect: resource analysis. In [24], they further apply PTCWF-nets to manage resources. Their approach can schedule a clinical pathway among multiple available resources and allocate each activity to an optimal resource, i.e., the resource that has the highest probability to finish the activity in time. Authors in [25] also attempt to model clinical pathway using Petri net. They introduce performance trees to provide a standard unifying framework for expressing performance measures and performance requirements. Benefit from performance trees, the Petri net model for clinical pathway can provide estimation of steady state distribution and passage time.
Besides the work has been done to model the clinical pathway using Petri net, process algebra is also introduced to formally specify the interactions of different entities in the clinical pathway [26]. Process algebra is a mathematical framework used to describe a complex parallel system. In this framework, both the behaviour and properties of the system are described in the form of algebra, facilitating accurate definition and rigorous reasoning about the system in mathematics. PEPA is an enhanced process algebra mainly used to describe and analyse the performance of concurrent systems [14]. It inherits most characteristics of process calculus while incorporating features to specify a stochastic model, which potentially behaves as a continuous time Markov process. Comparing PEPA with other frequently used modelling tools, a queuing network offers compositionality but lacks formal definition, while a Petri net has formal definition without good compositionality. Thus in paper [27], PEPA is used to model the healthcare system. Based on PEPA, the execution duration and throughput of the clinical pathway can be evaluated. However, the role of resources, which constrain the activities and further limit pathway outcome, is not explicitly shown in this model. Therefore, this paper proposes a general clinical pathway model based on the CPP to analyse the performance of system and optimize pathway output.
The remainder of this paper is organised as follows: the Method Section introduces the architecture of ICPA, defines the CPP model, and presents key theories in conducting performance analysis on clinical pathway; the Results Section reports our experimental tests of the CPP model's effectiveness; finally, the Conclusion Section summarises our work.

Method
A novel clinical pathway management platform, ICPA, is proposed to effectively manage clinical data and provide feedback to hospitals, aiming to improve healthcare systems by constructing models of clinical pathways. The architecture of ICPA is shown in Figure 2. Hospitals, treating various patients, take records of patients' treatment processes. The collected clinical data is stored in clinical pathway databases. As the specific disease studied in this paper is stroke, ICPA uses national stroke related databases, such as the Stroke Improvement National Audit Programme (SINAP) database [28], and the database containing stroke clinical data in Charing Cross hospital to parameterize the stroke clinical pathway model. By constructing the stroke clinical pathway model using our formal modelling method CPP, ICPA can analyse the performance of the clinical pathway, where throughput and passage time are estimated. Using analysis results, hospitals can efficiently reconfigure the clinical pathway. Hence, ICPA is a useful clinical pathway platform for hospitals to understand problems and find bottlenecks in the disease treatment process.
The core element of ICPA is the CPP modelling method. In ICPA the constructed model, whose modelling language should follow the rules of PEPA, is first checked by the CPP Model Checker. By applying the CPP modelling method, the clinical pathway can be modelled in a stochastic manner where the time duration of each activity in the disease treatment process is a variable. Furthermore, the CPP method supports multiple parallel patients, enabling competition among patients for the same treatment resources. As the underlying stochastic model of CPP is a continuous time Markov Chain, the steady state distribution and an estimation of passage time can be produced. In the following subsections, technical details of the CPP modelling method will be discussed.

Definition of CPP
Inheriting and developed from PEPA, the basic elements of CPP are state components, resource components and activities. A state component represents the status of a patient by showing in which department the patient is being treated. A resource component is used to specify the state of each resource, which can be either busy or idle. The third component is the activity, which decides transitions between different state components. As each activity relies on one or more resources, the state transition can only take place when the associated resource components are in their idle states. Therefore, the number of resources constrains the frequency of state transitions and limits the system throughput. The model defined by CPP which represents states and resources separately is suitable for resource optimization and status monitoring of patients. Definitions of CPP are as follows. Definition 1. In CPP, the clinical pathway is represented by a five-tuple, < S, R, Act, C, F C >, where: • S is a finite set of states s S, showing places that patients are being treated; • R is a finite set of resources, r R, required during treatment; • Act is a finite set of activities a Act; Each activity, a, is represented by a two-tuple (a, rate), where a is the action type and rate is one over the mean value of execution duration which is an exponentially distributed random variable; • C is a set of constraints c C; • F C is a set of functions that determine action rate: Definition 2. In CPP, the set S and R are basic components. Given that these components can be commonly denoted as P or Q, the syntax of the terms in CPP can be defined as follows: • The sequential operator '.' defines the order of P and Q; • The choice operator '+' indicates competition between P and Q; • The cooperation operator L determines the interaction between P and Q over the action set L.
For example, P def = (α, rate).Q means that the component P becomes Q with the completion of the activity (a, rate). The expression P + Q represents that the system can behave either as P or Q. It enables all the activities of P and Q, and the first completed activity determines how the system behaves. The cooperation operator in the expression P L Q forms the basis of composition and can specify two components working cooperatively with shared activities defined in L.

Three key parts of the CPP model
The CPP model consists of three key parts, namely state definition, resource specification and system description, which are used to show how the number of resources in the healthcare system affects the total throughput and the overall response-time for treatment.

State definition
The state definition part shows how patients proceed through healthcare system. It consists of multiple state components representing places that patients are being treated. Based on their corresponding pathology states, patients with different diagnosis results are transferred to various departments. Two related state components are connected by sequential and choice operators. The sequential operator shows the time sequence of states, while the choice operator represents competition between two states. Here is an example of the state component definition: It shows that patient can move from the state Patient place1 to Patient place2 or Patient place3 with probabilities of r place2 and r place3 after the completion of the activity whose action type is a.

Resource specification
The resource specification part defines all resources including equipment and medical staff required by state components. Transition between different state components requires the availability of corresponding resources. Assume the resource Resource place1 needed by the state component Patient place1 is defined as where Resource_busy place1 represents that the resource is currently busy in completing the activity whose action type is a, while Resource_idle place1 shows the resource is currently idle waiting for the completion of activity whose action type is b. The activities with action type of b and a can occur in: where the state Patient place0 is the previous state of Patient place1 and Patient place2 is the next state of Patient place1 . With completion of the activity whose action type is b, patients can move from Patient place0 to Patient place1 . Meanwhile, the resource required by Patient place1 becomes busy in treating the patient. After the treatment, denoted as the activity with the action type of a, the resource becomes idle again waiting to treat another patient.

System description
The last part of the CPP model is the system description part, describing the whole clinical pathway by using the cooperation operator to denote interactions between components. Suppose only one patient defined in Eqn. 4 where b and a are the action types on which two components Patient place0 and Resource_ idle place1 synchronise. More specifically, the patient which is currently in the initial state Patient palce0 can only be scheduled to the following states when successive treatments are carried out. As the healthcare system usually contains multiple patients and multiple copies of resources, it is necessary to represent parallel patients and resources as follows: where || is the parallel combinator, equivalent to ∅ , showing that two components are in parallel. Therefore, we can describe the system which consists of multiple Patient place0 and Resource_idle place1 in the form of Resource busy place1 def = (α, rate α ).Resource idle place1 (8) Then the system description part is: The number of copies of the inserted resource Wait_room0_idle should be sufficiently large to guarantee that at least one copy is available at any time, that is Num Wait_room0 ≥ Num Patient . Moreover, the action rate rate g must be large enough to enable instant transition from Wait_-room0_busy to Wait_room0_idle whenever at least one copy of resource is in its idle state Resource_idle place1 . With definitions in Eqn.4,8,9, the CPP model for a simple clinical pathway can be constructed. For more complex clinical pathway, we can augment this model to contain more state components and more resources.

Key techniques of performance analysis using CPP
Rooted in a continuous time Markov process [14], CPP model can be used to estimate the performance of clinical pathway including throughput (the number of patients that the healthcare system can serve every day) and resource utilisation (the percentage of time that a resource is in use).

The underlying stochastic process
The basic idea of a Markov process is that the distribution of time until the next state change is independent of the time which has elapsed since the last state change. Let the state transition rate between states S i and S j be If there are no direct connections between these two states, then the transition rate q S i ,S j = 0 . Let X(t) = S i indicate that at time instance t, the system behaves as S i . After a tiny amount of time δt, the probability that the system is in state S j is (11) where O(δt) goes to zero faster than δt. Suppose that the infinitesimal generator for the process Q is a square matrix whose off-diagonal elements are q S i ,S j and diagonal elements are formed as the negative sum of the non-diagonal elements of each row, The evolution of the continuous time Markov process is represented by a first order differential equation [29]: where P(t) is a square matrix with (i, j)th entry p i, j standing for the probability Pr(X(t) = S j |X(0) = S i ). As performance analysis is usually concerned with system behaviour over a significant period of time, it is necessary to study the steady state behaviour of the system. If the steady state distribution exists, then the proportion of time that the process spends in state S j is represented as: Therefore, we can define: where N is the total number of states, subject to the normalisation condition i π i = 1 . Then Eqn.12 becomes: q S1,S1 q S1,S2 · · · q S1,SN q S2,S1 q S2,S2 · · · q S2,SN . . . . . . . . . As We can therefore use Eqn.10,16 to obtain steady state distribution.
Here is a simple example to explain the above process. Suppose the system behaviour can be modeled by a two state Markov process whose state transition diagram is shown in Figure 3. Then the generator matrix is as follows: We can therefore get steady state distribution from: which is: Calculating the resource utilisation and system throughput The steady state distribution π i stands for the proportion of time that the process spends in state S i . By finding in which state S i the resource is busy, we can calculate the resource utilisation. For example, if the resource at place i is busy in state S 1 , S 3 and S 4 , then its utilisation can be obtained by π(Resource_busy placei ) = π(1) + π(3) + π(4). If this resource has multiple copies, we can calculate its average utilisation by where Num Resource placei is the total number of Resourceplacei copies.
In the clinical pathway model, suppose that there is a patient who completes the activity with the action type λ leaves the hospital. The throughput of pathway is estimated by the expected number of completed activities with action type l. Given the definition of resource Resource placeN in the last place of the care process as follows: (21) where the completion of activity (λ, rate λ ) enables the resource to become idle. Then the throughput T can be represented by: showing that the system throughput is associated with the utilisation of the resource whose state transition depends on the type λ activity.
Let us introduce the CPP model for a simple clinical pathway (see Figure 4) to show how to analyze the resource utilisation and throughput. Suppose the CPP model is defined as follows: The equilibrium state can only be maintained if the Markov process is irreducible that every state can be reached from all other states. Therefore CPP constructs a cyclic model in which the discharged patient will return to its initial state Patient place0 . The state space of this simple CPP model is shown in Figure 5, where each state is represented by a five-tuple. For example, in state S 5 : (0, 1, i, b, i), the first element 0 represents the first patient is in the place 0 ; the second element 1 represents the second patient is in the place 1 ; the third element i represents the first waiting room is idle; the fourth element b represents the second waiting room is busy; and the last element i represents the resource in the place 1 is idle.
The generator matix Q has the following form: Therefore, we can obtain resource utilisation and throughput: We can use PEPA eclipse plugin [30] to simulate the developed CPP model, from which resource utilization and throughput can be directly obtained.

Critical assessments-state explosion problem
When there are many patients and multiple copies of resources involved in the system description part, the state explosion problem occurs. For instance, when there are eight patients, eight waiting rooms and three resources in Figure 4 clinical pathway, the number of states increases from 10 to 75582. Then the dimension of generator matrix Q becomes 75582 × 75582. Hence, calculating steady state distribution by solving Eqn.16 turns out to be computational intensive and requires large storage space. To address these problems, this paper uses two methods which are state aggregation and fluid analysis.
It has been pointed out in [31,32], by exploiting the strong equivalence relations, we can generate the aggregated CTMC where the number of states can be reduced. Consider again the simple CPP model in Eqn.23. As the states S 2 , S 3 , S 4 and S 5 shows that there is one patient in place1, one patient in place0, one waiting room is busy and the resource is idle, the aggregated state S 2 can be used to represent them without considering which patient is in place1 and which waiting room is occupied: (27) Similarly, we use S 4 to represent S 7 and S 8 , and S 5 to represent S 9 and S 10 : (Wait room0 idle||Wait room0 busy) γ ,α Resource busyplace1 S10 = (Patientplace1||Patientplace1) β (Wait room0 idle||Wait room0 idle) γ ,α Resource busyplace1 (28) Therefore, the number of aggregated states is reduced to 5. The state transition diagram is shown in Figure 6, and the generator matrix Q' is as follows: and further obtain resource utilisation and throughput: Utilisation Resourceplace1 = π (Resource busy place1 ) = π 4 + π 5 = 0.47 T = 3 * Utilisation Resourceplace1 = 1.41 (31) which are similar with Eqn.26.
Although the number of states can be reduced by using the aggregation method (implemented in PEPA eclipse plugin), when the amounts of patients and resources become extremely large, the state aggregation method cannot solve the state explosion problem well. Hence, fluid analysis of stochastic process model is used in [27] to analyze systems of size 10 1000 states and beyond. This approach approximates the state space by using a set of ordinary differential equations to describe the time evolution of state components. Assume that, the mean number of component P i at time t is denoted as N (P i (t)), then a differential equation can be used to represent the changes in N(P i (t)) as:  where the initial conditions are: By solving these equations, we can obtain the time evolution of each component. The details of fluid analysis can be found in [33]. By exploring the time evolution of P i , we can find the mean time that P i reaches its maximum. For example, Figure 7 shows N(Resource_busy place1 (t)), whose maximum can be reached within two days. With the introduction of fluid analysis, state explosion problem can be addressed.

Calculating passage time
Based on fluid analysis, the mean passage time of a patient to be discharged can be estimated by using a stochastic probe [34]. For example, if we are interested in the time by which a Patient place0 component has done its first a activity, we can attach a probe to Patient place0 to remember whether it has performed a activity. The probe can be defined as follows: where the initial conditions are:  takes for an individual Patient place0 component to perform its first a action (see Figure 8). In this paper, we use a tool, Grouped PEPA Analyser, developed in [35] to simulate the CPP model. This tool can estimate resource utilisation and passage time based on fluid analysis.

Results
In this section, the CPP modelling method is applied to model the stroke clinical pathway. It begins with the parameter settings of experiment. Then detailed description of the CPP model for stroke clinical pathway is shown. By simulating the pathway using the CPP modelling method, we can optimize the resource allocation, estimate the passage time and find the maximum throughput with the current resource distribution.

Experiment setup
In order to improve stroke service in London, the NHS investigates seven HASUs opened in 2010 including the one in Charing Cross Hospital. To ensure appropriate and consistent measurements, the SINAP database is used. Among the datasets published by NHS [36], the HASU activity data which contains clinical information for HASU in Charing Cross Hospital is shown in Table  1. It can be used to calculate transition probabilities in To build the formal model of stroke clinical pathway, parameters involved in pathway including execution time of each care activity and the number of resources available at each department should be estimated in advance. Some of them can be directly obtained from Table 1, where we can find the number of beds available in HASU is 20 and the median length of stay in HASU is 2 days. Moreover, NHS records the average time from 999 call to arrive hospital to be 62 minutes. As the FAST test is carried out on ambulance, the mean time of FAST test is therefore assumed to be 1 hour. Other parameters such as the number of stroke teams in A&E and CT scanners are not extracted directly from NHS databases, and they are estimated by consulting related documents and stroke experts. In this paper, we assume that there are 3 stroke teams and 3 CT scanners in Charing Cross Hospital. The number of ambulances is set to be unlimited, ignoring the influence of the ambulance in the model. Moreover, the mean lengths of stay in A&E and CT scan departments are assumed to be 0.75 hour and 3 hours, respectively. All the parameters and their value are summarized in Table 2.
This paper applies CPP to model the main stream of the pathway where only the patients who can finally go to the HASU are analyzed. Hence the pathway in Figure  1 is simplified as it is shown in Figure 9.

The CPP model of the stroke clinical pathway
The pathway model contains three parts, which are state definition, resource specification and system description. The CPP representation of these three parts is as follows.
In order to get the average patient incoming rate to 4, the parameter Num patient is set to 1000 and r income is 0.004.

Three performance analysis scenarios
Three scenarios are tested in this subsection to show the application of the CPP model in performance analysis.
The CPP model can detect the optimal resource allocation, estimate the passage time and determine the maximum throughput of the healthcare system.

Scenario 1: Resource optimization
Initially there are 3 stroke teams, 3 scanners and 20 beds available in the stroke clinical pathway. As the average patient input is around 4, it may happen that the resource utilisation is low. Hence, we investigate the influence of resource quantity on system throughput. By varying the numbers of stroke teams, scanners and beds, we can find from Figure 10 that the largest throughput that can be achieved is 3.95 patients/day, slightly smaller than 4 patients/day. We cannot have the maximum throughput value exactly equal to the number of input patients. It can be explained from the definition of parallel input patients Patient Home [Num patient ], where Numpatient is 1000 and the input rate is 0.004. Theoretically, the number of input patients per day should be 1000 * 0.004 = 4. On the first day, 4 patients on average fall ill and are treated sequentially through the clinical pathway. As the mean time for the patient staying in HASU department is 2 days, it is possible that these 4 patients are still in the pathway on the next day. Hence, they cannot return to the state Patient Home on the second day, meaning that the number of patients at Patient Home is slightly smaller than 1000. Therefore, there is a trivial difference between the maximum throughput and the number of input patients. However, this small difference does not influence the performance analysis process. Figure 10 is used to show how our performance analysis result guides medical staff to find optimal resource allocation, i.e., the amount of resource is kept minimal while still maintaining the maximum throughput in the clinical pathway. The three 3D graphs look similar and they actually demonstrate the process of reducing  We can obtain the optimal number of each resource in Table 3 and find that the resource utilisation can be increased while the system throughput is maintained. It is notable that the CPP model can find the optimal resource allocation with varying number of input patients. For example, with an input of 4 patients per day, the optimal resource allocation is 1 stroke team, 1 scanner and 8 beds; if the input rate increases to 0.006, meaning that there are 6 patients falling ill every day, the optimal resource allocation is found to be 1 stroke team, 1 scanner and 12 beds.
The state NotFinished becomes Finished once the activity whose action type is treat_HASU is completed. When we attach this probe to the patient state component as follows:

Patient Home treat HASU NotFinished
The mean time of a patient from falling ill to leaving the HASU can be obtained. Figure 11 shows the probability that a patient is discharged from the HASU within a specific time duration when there is 1 stroke team, 1 scanner and 8 beds available. We can see that 90% of patients can be discharged within 2.5 days and only 14% of patients can be discharged within 1 day. Estimation of the whole passage time not only tells patients when they can be discharged, but also informs doctors the resource occupation time.

Scenario 3: Maximum input estimation
We can also examine the maximum throughput with different parameter settings. For example, if the pathway model uses the initial parameters, in Figure 12 we can see that when the number of input patients increases from 1 to 100, the maximum throughput is around 10 patients/day. When the input number is 10, the throughput reaches 9.74 patients/day, slightly smaller than the maximum value (this difference has been discussed in the Resource optimization subsection). Any further increase in the number of input patients has trivial contribution to the system throughput.
Therefore, by simulating the CPP model, we can find the maximum number of input patients that can be supported by the healthcare system. This maximum input estimation is significant for hospital to determine whether it can accept more stroke patients or not. For example, suppose there are already 10 patients on average coming to the hospital from the surrounding area. If the national health community asks whether this hospital can serve patients from larger area, meaning that more than 10 patients will arrive every day, by estimating the maximum input this hospital can determine whether this is possible and whether more resources are required to support the increased number of patients.

Conclusions
This paper introduces a clinical pathway management platform, ICPA, whose core element is the stochastic model CPP. CPP can unambiguously describe a variety of elements in a clinical pathway. Using CPP, the clinical pathway can be quantitatively analyzed and this performance analysis can provide a range of useful information for facilitating clinical pathway management. A realworld stroke clinical pathway, obtained from Charing Cross hospital of Imperial College London, is employed to demonstrate the practical applicability of ICPA. Three scenarios were tested to show that ICPA can assist hospitals to improve healthcare system by 1) reducing Table 3 Comparison of resource utilisation: The utilisations of resources resulting from the model with initial and optimal parameter sets are compared.  Figure 11 Passage time. It shows the probability that a patient can be discharged within a specific time. This figure is obtained when the model uses an optimal parameter set. When the model uses the initial parameter set, we get the same figure, showing that the system passage time remains the same. redundant resources 2) predicting patient passage time 3) estimating the maximum patient input. The approach presented in this paper can be used effectively to manage the clinical pathways within one hospital. There are multiple revenues for extending the work and we discuss four possible directions below.
1. CPP model can be extended to incorporate survival analysis by collecting clinical data including patient recovery speed and survival rate. The augmented model can then be used to examine the influence of treatment delay on patients' recovery processes. Therefore, the results from the ICPA can be used to increase patient recovery probability and decrease the recovery time.
2. Multiple hospitals can be managed concurrently using ICPA. At present, there are seven hospitals in London with HASU departments to treat stroke patients. ICPA can be extended to combine their clinical data to build a uniform model. By analysing this model, patients can be dynamically scheduled to different hospitals in order to optimise their treatment process.
3. The stroke clinical pathway discussed in this paper is described in the coarse granularity. With clinical data, ICPA can be applied to analyse an element in the clinical pathway in the fine granularity. For example, the HASU department, one element of the stroke clinical pathway, needs to treat patients with multiple therapies. If this type of information can be obtained and modelled by CPP, ICPA can view HASU as a clinical pathway and conducts performance analysis on it. 4. A user friendly interface can be build to facilitate medical staff's access to ICPA. Currently, ICPA only provides analysis results such as optimal resource allocation to medical staff. By interpreting these performance analysis results, medical staff can optimally re-allocate medical resources and re-configure treatment process. In the future, we plan to develop a user portal to help medical staff construct the clinical pathway model by themselves. method design. JB performed simulation and drafted the manuscript. BC defined the research theme and helped to draft the manuscript. RD participated in the design and coordination. RK defined the research theme and participated in method design. All authors read and approved the final manuscript.