Published on in Vol 7 (2023)

Preprints (earlier versions) of this paper are available at, first published .
Optimizing an Adolescent Hybrid Telemedical Mental Health Service Through Staff Scheduling Using Mathematical Programming: Model Development Study

Optimizing an Adolescent Hybrid Telemedical Mental Health Service Through Staff Scheduling Using Mathematical Programming: Model Development Study

Optimizing an Adolescent Hybrid Telemedical Mental Health Service Through Staff Scheduling Using Mathematical Programming: Model Development Study

Original Paper

1School of Mathematics, Cardiff University, Cardiff, United Kingdom

2Aneurin Bevan University Health Board, National Health Service, Newport, United Kingdom

*these authors contributed equally

Corresponding Author:

Daniel Gartner, MSc, PhD

School of Mathematics

Cardiff University

Senghennydd road

Cardiff, CF24 4AG

United Kingdom

Phone: 44 7843747862


Background: According to the World Health Organization, globally, one in seven 10- to 19-year-olds experiences a mental disorder, accounting for 13% of the global burden of disease in this age group. Half of all mental illnesses begin by the age of 14 years and some teenagers with severe presentations must be admitted to the hospital and assessed by highly skilled mental health care practitioners. Digital telehealth solutions can be useful for the assessment of young individuals remotely. Ultimately, this technology can save travel costs for the health service rather than assessing adolescents in person at the corresponding hospital. Especially in rural regions, where travel times can be high, this innovative approach can make a difference to patients by providing quicker assessments.

Objective: The aim of this study is to share insights on how we developed a decision support tool to assign staff to days and locations where adolescent mental health patients are assessed face to face. Where possible, patients are seen through video consultation. The model not only seeks to reduce travel times and consequently carbon emissions but also can be used to find a minimum number of staff to run the service.

Methods: To model the problem, we used integer linear programming, a technique that is used in mathematical modeling. The model features 2 objectives: first, we aim to find a minimum coverage of staff to provide the service and second, to reduce travel time. The constraints that are formulated algebraically are used to ensure the feasibility of the schedule. The model is implemented using an open-source solver backend.

Results: In our case study, we focus on real-world demand coming from different hospital sites in the UK National Health Service (NHS). We incorporate our model into a decision support tool and solve a realistic test instance. Our results reveal that the tool is not only capable of solving this problem efficiently but also shows the benefits of using mathematical modeling in health services.

Conclusions: Our approach can be used by NHS managers to better match capacity and location-dependent demands within an increasing need for hybrid telemedical services, and the aims to reduce traveling and the carbon footprint within health care organizations.

JMIR Form Res 2023;7:e43222




Worldwide, 10%-20% of children and adolescents experience mental health disorders, and delivering appropriate and timely child and adolescent mental health care challenges health services [1]. These challenges are often reported as structural, such as cost, transportation, or time constraints [2]. Alternative approaches to delivering mental health services in a way that is safe, appropriate, and timely can reduce cost and reduce the time to, for example, assess patients [2-7].

The use of technology to deliver health care is a growing area of clinical practice and research interest [2]. This approach involves using interactive technology to allow professionals, patients, and families at different geographic locations to interact as if they were meeting in person [2,3]. Using technology in this way is referred to as “telehealth” [8] and is being used globally and widely to deliver health care via assessment, consultation, and treatment comparable to in-person care [9-13]. Overall, the COVID-19 pandemic appears to have been a positive transition to the use of telepsychiatry, with it being viewed as a convenient and safe way to provide patient care [14,15].

Telehealth is reported to be beneficial for mental health provision and is becoming more widely adopted with children and adolescents, with mental health reported to be among the most active pediatric specialties [16-20]. Telehealth offers an opportunity to bridge the gap between supply and demand in child and adolescent mental health services [4]. There is a consensus of acceptability and satisfaction [21]. It can offer access to care that may have otherwise been unavailable, particularly in rural and other underserved settings [4]. It is reported to have improved resource efficiency and increased cost and time savings compared to traditional modes of practice [22]. It can allow health professionals to extend boundaries of practice and overcome barriers of proximity [22], increasing their daily scope and ability to work and extending their reach and integration of expertise into other services [23].

In the United Kingdom, the delivery of child and adolescent mental health services via telehealth is relatively new, compared to other countries such as Canada, Australia, and New Zealand, where it is widely used. Several pilot studies have been conducted in recent years in the United Kingdom; however, the sustainability of these projects tends to be the failure of health care staff in continuing its use after the pilot phase. This tends to be associated with factors such as busy staff naturally returning to their normal work patterns.

In this study, we developed a mathematical program that schedules mental health care practitioners and assigns them to either the base of the telehealth care service or to hospitals where staff would be required to assess or treat patients. Mathematical programming is a part of constrained optimization, and Crown et al [24] have provided a comprehensive definition and illustrations of the methodology in health care. We used this paradigm to find a minimum coverage for staff by satisfying time- and location-dependent demands and to minimize travel distances.


In 2019, The Health Foundation [25] funded a project within the Aneurin Bevan University Health Board, a National Health Service (NHS) Trust in Wales, for 15 months to establish a telehealth innovation for an improvement program with the objective to provide mental health appointments or assessments to children and adolescents. This newly established program is called “Connecting with Telehealth to Children in Hospital and Healthcare” (CWTCH). It is a quality improvement NHS project offering safer and more efficient appointments to the Child and Adolescent Mental Health Service (CAMHS) using telehealth technology. The aim of this project is to pilot a telehealth project in a CAMHS setting and to evaluate the use, suitability, and satisfaction among patients, parents, and professionals across a range of settings to demonstrate improved access and reduced waiting times to CAMHS, and time and cost savings for patients, their parents, and staff.

Introducing a Hub and Spoke Model

The telehealth technology is set up and linked to a range of health care and education sites. There is a main hub site (the current CAMHS site), which is in private rooms. The CAMHS staff involved in the CWTCH project included specialist CAMHS consultant psychiatrists, emergency liaison teams, and specialist eating disorder teams. The CAMHS hub site provides a wide range of telehealth services to other health care sites (which act as remote yet transferable spokes, in that the technology can be carried from one site to another by the research team using a highly secure and password-protected iPad or laptop device). These sites include, but are not limited to, conducting emergency assessments in pediatric wards, medicine reviews and follow-up appointments delivered at home, and early diagnosis and intervention delivered to general practices and school settings.

A referral to the hub site can be made by any member of staff working within the designated spoke sites. Initially, the spoke sites would contact the CAMHS team and request an appointment, and, if available, a time slot would be scheduled (often on the same day), and additional information about the project and consent forms would be electronically sent to the spoke site or delivered in person by the research team. A web link to the telehealth application (Attend Anywhere) would be sent to the person arranging the referral. This link would request the name, date of birth, and contact telephone number (in case of technology failing or disconnection) of the person who is having the appointment (eg, school pupil, patient, or parent). Once the site is connected, the hub site would be alerted that the patient is waiting in the “CAMHS Virtual Waiting Room.” The CAMHS member of staff would then join the call and start the appointment.

The Equipment

At the CAMHS site, there are a range of fully equipped private rooms that are set up with the technology required for taking appointments. This includes a PC at the hub site and an iPad or laptop device for the sites, all of which have a webcam, microphone, and speaker incorporated. As this is a quality improvement project set within the NHS, there are strict guidelines and regulations to follow when providing clinical care and outputs; therefore, a specialized communication platform has been used on all equipment used for the CWTCH project. This package is a safe and secure version of picture-to-picture style video (ie, the video is linked to both sites). The clinician end of the platform is password-protected and only accessible to a professional working within the hub site and is signed up to be part of the CWTCH project. The site is only available via a safe and secure link that is sent on to the user as a referral. The objective of our model is, given all the staffing and equipment constraints, how can we provide an efficient service that minimizes the number of staff required and contains the miles traveled to the different hospital sites.

In what follows, we provide a formulation of the mathematical model. We start with the sets and indices for modeling staff and locations. Furthermore, we turn to model parameters such as demand. Afterward, we will introduce the decision variables, model objective, and constraints.

Sets, Indices, and Parameters of Our Mathematical Model

Let denote the planning horizon, and let be the set of staff. Let denote the set of locations where staff are assigned to work. Let dl,t denote the expected demand at location l on day t. Let wi denote the number of patients that staff member i can treat. Furthermore, let mi,l denote the miles traveled (back and forth) if staff member i must travel to location l to see patients, which includes the miles to drive back to the home base. Table 1 provides an example that can be set up in a spreadsheet.

Table 1. Parameter setting for the distance parameter mi,l.
NameHospital 1 (miles)Hospital 2 (miles)Hospital 3 (miles)

Decision Variables

We introduce the binary decision variables xi,l,t = 1 if staff member iI works at location lL on day tT, 0 otherwise.

Objective Function

Our objective is to find a minimum staffing pattern to run the hybrid telehealth CAMHS service. Accordingly, we have the following objective function:

minimize z = Σi Σl Σt xi,l,t                                       (1)

To reduce travel costs, the CAMHS service decided to evaluate a second objective, which can be described mathematically using objective function (2). It minimizes the distance travelled by staff.

minimize z = Σi Σl Σtmi,lxi,l,t                            (2)


Because we want to cover the demand, the demand satisfaction constraint is as follows:

A member of staff cannot be assigned to multiple locations at the same time. Accordingly,

Finally, we introduce the decision variables and domains, which are represented using equation (5).

Ethical Considerations

This study was a service improvement study and was exempt from institutional review board approval. Study data were anonymized and deidentified.

We implemented the mathematical model in a decision support tool based on Excel (Microsoft Corp) using Open Solver and the COIN-OR optimization library.

Modeling the Weekday and Site-Dependent Demand

We used information from 2015 to 2018 to predict the demand at the different hospital sites. Table 2 provides a summary statistic about the weekday-dependent demand distribution.

The numbers reveal that on weekends, there is substantially lower demand than that on weekdays. Another observation is that more patients are seen at the beginning of the week. To predict site and weekday-dependent demand, we tested different time-series models such as additive and multiplicative decomposition approaches, exponential smoothing, and the Holt-Winters model, but the best performance was achieved using a multiple regression model with day of the week, bank holiday, and month as independent variables. We then linked the predictions from the multiple regression model with the mathematical program introduced in the previous section. This is implemented in Excel using an open-source solver, as the next sections will reveal.

Table 2. Weekday-dependent demand distribution.


Setting Up Staff Availability

Mental health care practitioners are either full-time, in which case they work 5 days a week and have 2 days off, or part-time, which varies from 2 to 4 working days in a week. In the interest of fairness, each practitioner works 2 weekends a month, as we expect there to be a demand 7 days a week. We have also taken into consideration that full-time workers will take approximately 3 days’ leave a month and part-time workers take 1-2 days’ leave depending on their hours.

Implementation in Excel

The model is made up of binary variables as a member of staff is either working (=1) or not (=0). The model must fit into the constraints as a mental health care practitioner cannot be sent to 2 separate locations at the same time. We also must ensure that there are enough staff to cover the demand of each hospital. Named ranges have been added to the model to further clarify what each constraint represents. The hospital names have been generalized to hospitals 1, 2, and 3, while “AA” stands for the telehealth application Attend Anywhere. Figure 1 shows how the mathematical model is implemented in OpenSolver.

Figure 1. Objective function and constraints parametrized in OpenSolver.


As our mathematical model is 3D, we had to create separate matrices for each of the distinct locations. We created hidden spreadsheets with 0-1 matrices, which represent the site-dependent rota. OpenSolver then reads these matrices and creates the constraints of our model in the backend. To increase the usability of the tool, we translated these matrices into the format shown in Tables 2 and 3 for the rota and mileage, respectively.

In what follows, we will provide the results of solving the models with the 2 different objectives. Table 3 provides the solution for a 1-week rota and objective function (1). Staff are scheduled 31 times, which means that they are off duty 21 times. The total number of miles travelled is 416. For simplicity, Tables 2 and 3 show 1-week rota and miles, but OpenSolver is set up to solve a 4-week problem (see Table 4).

Table 5 shows the mileage for the second objective; that is, minimizing travel distance for the staff. Although the staff are scheduled for the same number of days (n=31), only 47 miles are travelled in that week. One explanation of this phenomenon is that more mental health care practitioners are allocated to sites closer to their base; hence, by solving via the second objective with our current input values, we can save 369 miles being travelled by them while still using the same number of staff.

Table 3. Solution with the first objective.

October 14, 2019October 15, 2019October 16, 2019October 17, 2019October 18, 2019October 19, 2019October 20, 2019
KellyHospital 1Hospital 3AAaOFFbOFFHospital 1Hospital 2
JamesOFFHospital 2OFFHospital 2AAAAOFF
OliviaHospital 3OFFOFFOFFHospital 2Hospital 3Hospital 1
JosephOFFHospital 1Hospital 3AAAAOFFOFF
EmilyAAOFFHospital 1Hospital 3Hospital 1OFFOFF
MatthewOFFOFFHospital 2Hospital 1Hospital 3Hospital 2Hospital 3

aAA: Attend Anywhere.

bOFF: off day.

Table 4. Mileage for the first objective.

October 14, 2019October 15, 2019October 16, 2019October 17, 2019October 18, 2019October 19, 2019October 20, 2019
Table 5. Mileage for the second objective.

October 14, 2019October 15, 2019October 16, 2019October 17, 2019October 18, 2019October 19, 2019October 20, 2019

Principal Findings

In this study, we demonstrated that mathematical modeling can be used to determine a staff schedule for an adolescent hybrid telemedical service. We developed a mathematical program that schedules mental health care practitioners and assigns them to either the base of the telehealth care service or to hospitals where staff would be required to assess or treat patients. Our approach was able to find a minimum coverage for staff by satisfying time- and location-dependent demands and to minimize travel distances.

Findings and Contributions to the Literature

As demonstrated in our experimental study, our mathematical model can assign members of staff dates and locations. Although members of staff may be available during many days in the planning horizon, there is no guarantee that the solution provides a levelled assignment of staff to the locations. In Table 3, for example, the second member of staff (James) was never assigned to hospital 1 or 3, while Laura was never assigned to work on site at a hospital. In future work, a constraint that assigns a member of staff at least, for example, once in a fortnight to a hospital and working remotely, might be desirable.


The presented mathematical model has limitations because of its deterministic nature: it assumes that the demand is known in advance. However, the demand of staff needed for patients coming into hospitals has some level of uncertainty and cannot be estimated precisely. To create a more robust solution that considers uncertainty of demand, for example, a stochastic approach to the problem can be applied. In this scenario, we would assume that once a staff member is assigned a shift at a hospital, they cannot be relocated. Instead, an agency member is required to cover the unmet demand.


In this study, we have presented an approach to use mathematical programming for scheduling staff to a hybrid telehealth service to evaluate children’s and adolescents’ mental health. Our objectives were to find a minimum staffing pattern to not only run the service but also minimize travel times of staff working at various locations including the base of the telehealth service. In times of the COVID-19 pandemic, this base can also be the home of the staff member. In future work, we will extend our approach to incorporate demand uncertainty in a stochastic programming approach with the aim to provide a robust staffing pattern. Furthermore, we will increase the granularity of the planning horizon, for example, mornings and afternoons, such that staff members might be repositioned during the day, responding to the demand in a more flexible way.

Data Availability

The data to run the mathematical model are provided, for example, in Tables 1 and 2 in the manuscript.

Conflicts of Interest

None declared.

  1. Guidelines on mental health promotive and preventive interventions for adolescents. World Health Organization. 2020.   URL: [accessed 2023-03-15]
  2. Boydell KM, Hodgins M, Pignatiello A, Teshima J, Edwards H, Willis D. Using technology to deliver mental health services to children and youth: a scoping review. J Can Acad Child Adolesc Psychiatry 2014 May;23(2):87-99 [FREE Full text] [Medline]
  3. Myers KM, Vander Stoep A, McCarty CA, Klein JB, Palmer NB, Geyer JR, et al. Child and adolescent telepsychiatry: variations in utilization, referral patterns and practice trends. J Telemed Telecare 2010 Mar 02;16(3):128-133. [CrossRef] [Medline]
  4. Nelson E, Sharp S. A review of pediatric telemental health. Pediatr Clin North Am 2016 Oct;63(5):913-931. [CrossRef] [Medline]
  5. Flaum M. Telemental health as a solution to the widening gap between supply and demand for mental health services. Telemental Health 2013:11-25. [CrossRef]
  6. Thomas CR, Holzer CE. The continuing shortage of child and adolescent psychiatrists. J Am Acad Child Adolesc Psychiatry 2006 Sep;45(9):1023-1031. [CrossRef] [Medline]
  7. Michalski DS, Kohout JL. The state of the psychology health service provider workforce. Am Psychol 2011 Dec;66(9):825-834. [CrossRef] [Medline]
  8. Hilty DM, Marks SL, Urness D, Yellowlees PM, Nesbitt TS. Clinical and educational telepsychiatry applications: a review. Can J Psychiatry 2004 Jan 01;49(1):12-23. [CrossRef] [Medline]
  9. Cruz M, Krupinski EA, Lopez AM, Weinstein RS. A review of the first five years of the University of Arizona telepsychiatry programme. J Telemed Telecare 2005 Jun 24;11(5):234-239. [CrossRef] [Medline]
  10. Elford R, White H, Bowering R, Ghandi A, Maddiggan B, St John K, et al. A randomized, controlled trial of child psychiatric assessments conducted using videoconferencing. J Telemed Telecare 2000 Jun 24;6(2):73-82. [CrossRef] [Medline]
  11. Myers KM, Valentine JM, Melzer SM. Feasibility, acceptability, and sustainability of telepsychiatry for children and adolescents. Psychiatr Serv 2007 Nov;58(11):1493-1496. [CrossRef] [Medline]
  12. Myers KM, Valentine JM, Melzer SM. Child and adolescent telepsychiatry: utilization and satisfaction. Telemed J E Health 2008 Mar;14(2):131-137. [CrossRef] [Medline]
  13. Pesämaa L, Ebeling H, Kuusimäki ML, Winblad I, Isohanni M, Moilanen I. Videoconferencing in child and adolescent telepsychiatry: a systematic review of the literature. J Telemed Telecare 2004 Jun 24;10(4):187-192. [CrossRef] [Medline]
  14. Huang HC, Ougrin D. Impact of the COVID-19 pandemic on child and adolescent mental health services. BJPsych Open 2021 Aug 05;7(5):e145 [FREE Full text] [CrossRef] [Medline]
  15. Smith AC, Thomas E, Snoswell CL, Haydon H, Mehrotra A, Clemensen J, et al. Telehealth for global emergencies: implications for coronavirus disease 2019 (COVID-19). J Telemed Telecare 2020 Mar 20;26(5):309-313. [CrossRef]
  16. Mitchell SA, Maclaren AT, Morton M, Carachi R. Scott Med J 2009 Aug 01;54(3):13-16. [CrossRef]
  17. Pakyurek M, Yellowlees P, Hilty D. The child and adolescent telepsychiatry consultation: can it be a more effective clinical process for certain patients than conventional practice? Telemed J E Health 2010 Apr;16(3):289-292. [CrossRef] [Medline]
  18. Burke BL, Hall RW, SECTION ON TELEHEALTH CARE. Telemedicine: pediatric applications. Pediatrics 2015 Jul;136(1):e293-e308 [FREE Full text] [CrossRef] [Medline]
  19. Goldstein F, Myers K. Telemental health: a new collaboration for pediatricians and child psychiatrists. Pediatr Ann 2014 Feb;43(2):79-84. [CrossRef] [Medline]
  20. Yellowlees P, Burke MM, Marks SL, Hilty DM, Shore JH. Emergency telepsychiatry. J Telemed Telecare 2008 Sep 01;14(6):277-281. [CrossRef] [Medline]
  21. Kruse CS, Krowski N, Rodriguez B, Tran L, Vela J, Brooks M. Telehealth and patient satisfaction: a systematic review and narrative analysis. BMJ Open 2017 Aug 03;7(8):e016242 [FREE Full text] [CrossRef] [Medline]
  22. Dinesen B, Nonnecke B, Lindeman D, Toft E, Kidholm K, Jethwani K, et al. Personalized telehealth in the future: a global research agenda. TMT 2018 May 02;2(3). [CrossRef]
  23. Sharan P, Malhotra S. Telepsychiatry: the bridge across the access gap in child and adolescent mental health. J Indian Assoc Child Adolesc Ment Health 2022 Jul 22;3(2):18-20. [CrossRef]
  24. Crown W, Buyukkaramikli N, Thokala P, Morton A, Sir MY, Marshall DA, et al. Constrained optimization methods in health services research-an introduction: report 1 of the ISPOR Optimization Methods Emerging Good Practices Task Force. Value Health 2017 Mar;20(3):310-319 [FREE Full text] [CrossRef] [Medline]
  25. Cwtch launch (connecting with telehealth to children in hospital). NHS Wales.   URL: [accessed 2023-03-15]

CAMHS: Child and Adolescent Mental Health Service
CWTCH: Connecting with Telehealth to Children in Hospital and Healthcare
NHS: National Health Service

Edited by A Mavragani; submitted 04.10.22; peer-reviewed by D Gopukumar; comments to author 08.12.22; revised version received 02.01.23; accepted 23.01.23; published 28.03.23


©Abigail Palmer, Gemma Johns, Alka Ahuja, Daniel Gartner. Originally published in JMIR Formative Research (, 28.03.2023.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR Formative Research, is properly cited. The complete bibliographic information, a link to the original publication on, as well as this copyright and license information must be included.