Universidad de Sevilla: Programa de Doctorado en Farmacia
Universidad de Sevilla: Programa de Doctorado en Farmacia
FACULTAD DE FARMACIA
Línea de Investigación de
Tecnología Farmacéutica y Ciencias del Medicamento
Tesis Doctoral
Autor:
María Isabel Fernández García
Directores:
Marta Casas Delgado
José María Maestre Torreblanca
1. INTRODUCCIÓN 1
1.1. Gestión de Inventarios en Farmacia Hospitalaria . . . . . . . . . . 2
1.1.1. Retos de la gestión de inventarios . . . . . . . . . . . . . . 2
1.1.2. Técnicas de gestión de inventarios . . . . . . . . . . . . . . 7
1.2. Hipótesis y Objetivos . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3. Métodos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.1. Métodos para la previsión de la demanda . . . . . . . . . 10
1.3.2. Métodos para la gestión de inventarios . . . . . . . . . . . 10
1.4. Publicaciones relacionadas con la tesis doctoral . . . . . . . . . . 12
1.4.1. Publicaciones anteriores a la tesis doctoral . . . . . . . . . 12
1.4.2. Publicaciones que conforman la tesis doctoral . . . . . . . 14
ARTÍCULOS DE REVISTA 17
ARTÍCULOS DE CONGRESO 40
i
4. IMPACTO ECONÓMICO DE LA APLICACIÓN DE TÉCNI-
CAS DE CONTROL PREDICTIVO BASADO EN MODELO A
LA GESTIÓN DE UN SERVICIO DE FARMACIA 41
ARTÍCULOS DE REVISTA 53
ARTÍCULOS DE CONGRESO 63
12.RESULTADOS Y DISCUSIÓN 88
13.CONCLUSIONES 100
ii
13.1. Estimación de la demanda . . . . . . . . . . . . . . . . . . . . . . 101
13.2. Aplicación de técnicas de MPC en simulación . . . . . . . . . . . 101
13.3. Validación en entorno real . . . . . . . . . . . . . . . . . . . . . . 101
13.3.1. Primera prueba . . . . . . . . . . . . . . . . . . . . . . . . 102
13.3.2. Segunda prueba . . . . . . . . . . . . . . . . . . . . . . . . 103
13.4. Aportaciones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
13.4.1. Mejoras en aspectos generales . . . . . . . . . . . . . . . . 103
13.4.2. Optimización del pedido . . . . . . . . . . . . . . . . . . . 103
13.4.3. Confianza . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
13.4.4. Aplicabilidad . . . . . . . . . . . . . . . . . . . . . . . . . 104
13.5. Limitaciones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
13.5.1. Diseño . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
13.5.2. Stock actualizado . . . . . . . . . . . . . . . . . . . . . . . 105
13.6. Investigaciones futuras . . . . . . . . . . . . . . . . . . . . . . . . 105
13.6.1. Ampliación . . . . . . . . . . . . . . . . . . . . . . . . . . 105
13.6.2. Cooperación con otros centros . . . . . . . . . . . . . . . . 105
BIBLIOGRAFÍA 107
iii
Capítulo 1
INTRODUCCIÓN
Contenidos
1.1. Gestión de Inventarios en Farmacia Hospitalaria . . . . . . . . . . . 2
1.3. Métodos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
1.1. Gestión de Inventarios en Farmacia Hospitalaria
2
marse nunca por completo a causa de las urgencias hospitalarias, los ingresos
no programados y los cambios de tratamiento tanto de pacientes ingresados
como externos que acuden a revisión.
3
existen restricciones económicas y presupuestarias que obligan a priorizar y
optimizar los recursos disponibles. Es muy importante procurar una adecua-
da rotación de stocks que reduzca en lo posible la inmovilización de medi-
camentos y su consiguiente caducidad. Es importante resaltar que el coste
económico de algunos de los medicamentos de los que dispone un Servicio
de Farmacia de Hospital llega a los varios miles de euros por unidad. De
hecho, el valor inmovilizado en medicamentos puede suponer un tercio del
presupuesto de un centro hospitalario [42] y hasta un 35 % de las compras
en bienes y servicios en un hospital provienen del Servicio de Farmacia [3].
4
cesidad de espacio es especialmente significativa en el caso de medicamentos
que requieren refrigeración. Además de los medicamentos termolábiles clási-
cos como las insulinas, los bloqueantes neuromusculares, las vacunas, ciertos
citostáticos, etc. hay que añadir los nuevos anticuerpos monoclonales de uso
en diversas enfermedades autoinmunes, que cada día son más frecuentes y
numerosos. Los frigoríficos o cámaras frigoríficas tienen una capacidad de al-
macenamiento limitada, lo que supone una restricción considerable, además
del coste de adquisición y mantenimiento de los mismos.
5
mal a través de una aplicación específica que justifique mediante un
informe la necesidad del medicamento en cuestión. Es la Agencia
Española de Medicamentos y Productos Sanitarios (AEMPS) la que
autoriza y da conformidad al suministro.
◦ Distribuciones controladas. En muchas ocasiones la baja disponibili-
dad de determinados medicamentos por parte del proveedor obligan
a una distribución controlada del mismo, y en estos casos su gestión
pasa a realizarse también a través de esta aplicación comentada. Pa-
ra su solicitud es necesario aportar un informe médico que justifique
la necesidad del tratamiento y que el paciente cumple los criterios
establecidos por la AEMPS para acceder al mismo. Es competencia
de la AEMPS autorizar finalmente o no el suministro.
◦ Estupefacientes. Lo mismo ocurre con los estupefacientes cuya com-
pra requiere además del envío de un vale oficial sin cuya recepción
no se entrega el pedido.
6
o de medicamentos enviados. Estas incidencias deben ser resueltas de
inmediato, sobre todo aquellas que afectan al producto recién solicitado.
La no resolución puede implicar que el medicamento no se sirva o que
se produzca una demora en su entrega.
7
valor económico siguiendo la distribución de Pareto: en el grupo A se inclu-
yen aquellos artículos que representan en torno a un 15 % del total en cuanto
a unidades pero un alto porcentaje (alrededor del 75 %) del capital del stock
total, en el grupo B se incluyen aquellos que suponen en torno a un 20 %
en unidades y alrededor de un 20 % del capital, y en el grupo C aquellos
que representan la mayor parte del stock en unidades (alrededor del 65 %)
y solamente un pequeño porcentaje del capital (un 5 % aproximadamente).
Según esta clasificación la mayor parte del valor económico del stock inmo-
vilizado se encuentra en un pequeño porcentaje del stock total. Es por ello
que puede ajustarse la frecuencia de los pedidos en función de la importancia
económica de cada grupo. En concreto, a mayor peso económico se asigna
mayor frecuencia, lo que permite reducir tanto la cantidad pedida como el
nivel medio de inventario de estos medicamentos.
8
niveles de stock con un stock de seguridad o bien se han implementado soluciones
sobre el comportamiento de la demanda. No obstante, las decisiones tomadas,
dado que se desconoce el riesgo asumido realmente, pueden conducir a considerar
valores de stock de seguridad subestimados que no cubran del todo la demanda
o bien a puntos de pedido ineficientes.
9
1.3. Métodos
10
stock de un Servicio de Farmacia Hospitalaria real. El MPC es una estrategia de
alto rendimiento, muy popular para el diseño de controladores basados en mo-
delos debido a su capacidad de manejar interacciones entre distintas variables,
restricciones en las variables controladas y requerimientos de optimización de un
modo sistemático. Se trata de un método de control muy versátil con múltiples
aplicaciones en la industria y en diversos campos, que utiliza un modelo mate-
mático del sistema para predecir su evolución como una función de la secuencia
de acciones implementadas en un determinado horizonte de tiempo [8].
Las relaciones causa/efecto que se producen en los sistemas pueden ser ca-
racterizadas mediante modelos matemáticos. El conocimiento del modelo que
caracteriza el sistema permite calcular acciones de control sobre el sistema para
que éste se comporte como deseamos. El MPC emplea el modelo del sistema para
calcular las acciones óptimas de control desde el punto de vista de una cierta
función definida a lo largo de un horizonte temporal de N pasos hacia el futuro.
En cada instante de tiempo discreto se calcula la actuación óptima para los pró-
ximos N pasos para que el sistema siga a la referencia de acuerdo con la función
y se desecha el resto. Es decir, que el MPC realiza un recálculo constante de las
acciones de control en cada instante de tiempo de acuerdo a la información más
reciente disponible, optimizando la secuencia de acciones o estados futuros de un
sistema a lo largo de un horizonte dado.
Las dificultades que presenta la gestión de stocks son fácilmente modelables
en el marco de las técnicas de MPC. De hecho, ha sido considerado en múltiples
ocasiones como una estrategia adecuada para este tipo de problemática y se ha
empleado con éxito tanto en la industria como en cuestiones similares [37, 38, 33,
25, 13, 20, 28, 24, 32, 31, 34].
Estas técnicas explotan directamente datos para optimizar las acciones fu-
turas, los niveles de stock en este caso, a lo largo de un horizonte de tiempo
dado, considerando restricciones en las variables del sistema y la incertidumbre
de la demanda. Por ello, junto a los datos históricos de consumos, a partir de las
estimaciones disponibles acerca del comportamiento esperado de la demanda e
introduciendo una serie de restricciones en un modelo matemático, como embala-
je, tiempo de entrega, pedido mínimo, stock máximo almacenable, stock mínimo
11
necesario, precio de compra, etc., el sistema podrá predecir la evolución del stock.
Adicionalmente, se probará también a predecir la probabilidad de rotura de stock
con un nivel de riesgo controlado.
12
para el congreso de la Sociedad Andaluza de Farmacia Hospitalaria 2010,
titulada “Impacto económico de la aplicación de técnicas de control predic-
tivo basado en modelo a la gestión de un Servicio de Farmacia”. Se aplicó
una metodología en simulación muy básica a dos medicamentos en cuestión
partiendo del histórico de datos reales de un hospital de entradas y salidas
de los mismos en el periodo de estudio. Este trabajo podría ser catalogado
como una prueba de concepto que sirvió para ilustrar las posibilidades de la
aplicación del control predictivo en este contexto. Asimismo, cabe destacar
que fue una de las 3 comunicaciones escogidas para su presentación oral en
el congreso.
13
de decisión.
14
laboratorio. En esta publicación la doctoranda es segunda autora detrás de
uno de sus directores de tesis.
2 ©2020 IEEE. Este artículo aparece en la tesis impreso con autorización de IEEE y se corresponde con la
versión final de: I. Fernandez Garcia, P. Chanfreut, I. Jurado and J. M. Maestre, “A Data-based Model Predictive
Decision Support System for Inventory Management in Hospitals,” publicado en IEEE Journal of Biomedical
and Health Informatics, doi: 10.1109/JBHI.2020.3039692.
15
TRABAJOS REQUERIDOS
PARA PRESENTAR LA TESIS
EN LA MODALIDAD DE
COMPENDIO DE
PUBLICACIONES (ACUERDO
7.2/CG 17-6-11)
16
ARTÍCULOS DE REVISTA
17
Capítulo 2
APLICACIÓN DE CONTROL
PREDICTIVO ECONÓMICO A
GESTIÓN DE INVENTARIOS
EN HOSPITALES
18
Control Engineering Practice 71 (2018) 120–128
a r t i c l e i n f o a b s t r a c t
Keywords: In this paper, we present experimental results from the application of model predictive control (MPC) to inventory
Model predictive control management in a real hospital. In particular, the stock levels of ten different drugs that belong to the same
Hospital pharmacy laboratory have been controlled by using an MPC policy. The results obtained after four months show that
the adopted approach outperforms the method employed by the hospital and reduces both the average stock
levels and the work burden of the pharmacy department. This paper also paper presents some practical insights
regarding the application of advanced control methods in this context.
© 2017 Elsevier Ltd. All rights reserved.
✩ The authors would like to acknowledge Junta de Andalucía (Pharmacontrol Project, P12-TIC-2400), for funding this work.
* Corresponding author.
E-mail addresses: [email protected] (J.M. Maestre), [email protected] (M.I. Fernández), [email protected] (I. Jurado).
https://doi.org/10.1016/j.conengprac.2017.10.012
Received 14 February 2017; Received in revised form 23 October 2017; Accepted 24 October 2017
0967-0661/© 2017 Elsevier Ltd. All rights reserved.
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
whenever the stock is below the threshold. In general, these methods In this work, we deal specifically with a recently proposed type of
optimise their parameters based on assumptions such as constant delay MPC approach; that is, of economic MPC. Under this paradigm, the
times and Gaussian distributions for demand. See (Brewer, Button, & controller takes the economic objective of the process being controlled
Hensher, 2001; Tayur, Ganeshan, & Magazine, 1999) for similar policies. as the objective function of the control system (Rawlings, Angeli,
Given the cross-cutting nature of the problem, in the last few decades & Bates, 2012). Hence, the proposed controller tries to minimise the
many solutions have been proposed to deal with this issue from different expenses associated with inventory operations management in the
areas of research. For example, in Parlar (1988), game theory is applied pharmacy department. In particular, we present for the first time real
to an inventory system where two products with random demands are results from a pilot implementation of MPC in a hospital, which was
considered. In Axsäter (1993), an inventory system with one warehouse
located in San Juan de Dios hospital in the Spanish city of Córdoba. In
and 𝑁 retailers is considered. The strategy at the warehouse is similar
contrast to our previously published works (Jurado, Maestre, Velarde,
to an echelon stock, with a periodic review order-up-to-S policy. Optimal
Ocampo-Martinez, Fernández, Tejera, & del Prado, 2016; Maestre Torre-
production control and stock-rationing policies are applied in Ha
blanca, Velarde, Jurado, Ocampo-Martinez, Fernandez, Isla Tejera, & del
(1997), where the problem is formulated as a queueing control model.
In addition, in the area of control theory, some research related to Prado Llergo, 2014; Velarde, Maestre Torreblanca, Jurado, Fernandez,
inventory problems – for example, (Ortega & Lin, 2004)– where the Isla Tejera, & del Prado Llergo, 2014), where we carried out simulations
objective is to reduce inventory variation, reduce demand amplification to assess several stochastic MPC methods to control inventory levels of
and optimise ordering rules. In this area, the basic approaches can individual medicines in a simpler problem setup (e.g., neither storage
be classified within stochastic control theory and deterministic control costs nor storage limits were considered), here we work with all of
theory. Several applications of stochastic control theory to operations the drugs belonging to a given laboratory, which is more practical in
research are described in (Neck, 1984). A sliding-mode inventory policy a real world scenario. Also, to gently introduce this methodology to the
is proposed in Ignaciuk and Bartoszewicz (2010), which also uses pharmacy staff, we designed an MPC strategy that was inspired by the
stochastic approaches. An implementation of deterministic control the- approach followed by the pharmacists to work as a decision support
ory applied to production–inventory control using frequency domain, system for them. The controller recommends either placing an order for
was presented by Wikner (1994). the drugs or not doing anything. In this very first implementation, we
In this article, we work with model predictive control (MPC), which also decided to use the mean consumption of drugs during the last year
is a successful control method with multiple applications in the industry. as the future demand forecast and we aimed to avoid stockouts by means
MPC uses a mathematical model of the system being controlled to pre- of a safety stock. In this way, the transition towards the implementation
dict its evolution as a function of the sequence of actions implemented
of more sophisticated configurations of the MPC will be smoother.
during a certain horizon (Camacho & Bordons, 2004). In this way, it is
The rest of this paper is structured as follows. In Section 2, the
possible to calculate the inputs that optimise a given cost function that
problem setting of inventory management in hospitals is presented.
penalises any deviation of the expected evolution of the system with
Section 3 describes the formulation of the MPC controller that we
respect to the target behavior. From the sequence of actions calculated,
implemented. Section 4 presents the results of the application of this
only that corresponding to the current time step is actually applied to the
system; the rest is discarded and the optimisation is repeated at the next controller during four consecutive months and compares these results
time instant in a receding horizon fashion. As a computer based control with historical data from the hospital’s database. Finally, Section 5 ends
approach, it is possible to include issues such as constraints, delays in the paper with some concluding remarks and guidance for future work.
the problem variables, and disturbances explicitly in the formulation
of the optimisation problem. In other words, MPC provides us with a 2. Problem formulation
continuous replanning policy that recalculates control actions at each
time instant according to the most recent information available that is
This section presents the mathematical model used to build the MPC
relevant to the problem being solved, such as unexpected consumption
peaks, variation in prices, demand forecast, strikes on the delivery optimisation problem.
companies, and so on.
In the literature, MPC has been considered on many occasions as 2.1. Pharmacy inventory system
a suitable strategy for this type of problem. For example, in Wang,
Rivera, Kempft, and Smith (2004) and Wang, Rivera, and Kempf (2005)
To define a general system, it will be assumed that there are 𝑁𝑖
an MPC policy deals with supply chain management in semiconductor
different drugs in the pharmacy inventory. Depending on the demand
manufacturing. Likewise, in Maestre, Muñoz de la Peña, and Camacho
and the orders, the stock level of each will vary. The stock level evolution
(2011), distributed MPC is applied in simulation to the MIT Beer Game.
for each drug is represented by a discrete linear model, which for the
In Stoica, Arahal, Rivera, and Rodríguez-Ayerbe (2009), robust MPC is
used to control a production–inventory system. In Perea-López, Ydstie, particular case of drug 𝑖 is
and Grossmann (2003), a model predictive control strategy is used
to maximise profit in supply chains with multiproduct, multiechelon 𝑠𝑖 (𝑡 + 1) = 𝑠𝑖 (𝑡) + 𝑜𝑖 (𝑡 − 𝜏𝑖 ) − 𝑑𝑖 (𝑡), (1)
distribution networks with multiproduct batch plants. In Schwartz, where 𝑠𝑖 (𝑡) ∈ Z is the stock of drug 𝑖, 𝑜𝑖 (𝑡) ∈ Z is the number of ordered
Wang, and Rivera (2006), a simulation-based optimisation is presented
items of the drug 𝑖 at time 𝑡, considering only one provider, 𝜏𝑖 is its
to decide, optimally, the internal parameters of internal model control
corresponding transport delay, therefore, 𝑜𝑖 (𝑡 − 𝜏𝑖 ) is the number of
and the model’s predictive control policies for inventory management in
ordered items of the drug 𝑖 at time 𝑡 − 𝜏𝑖 and delivered at 𝑡, and 𝑑𝑖 (𝑡)
supply chains under uncertainties are supply and demand. An approach
represents the aggregate demand of drug 𝑖.
for applying control strategies to inventory management problem in
a production–inventory system is presented in Schwartz and Rivera To differentiate the drugs that need to be ordered from those that
(2010), which uses an internal model control and model predictive do not, a new variable is introduced, 𝛿𝑖 (𝑡), which is a Boolean variable.
control to calculate decision policies for inventory management. In Sub- If 𝛿𝑖 (𝑡) = 1, then an order for drug 𝑖 is placed during time 𝑡, otherwise
ramanian, Rawlings, Maravelias, Flores-Cerrillo, and Megan (2013), a 𝛿𝑖 (𝑡) = 0. That way, the number of ordered items can also be represented
distributed model predictive control is proposed to optimise supply as 𝛿𝑖 (𝑡 − 𝜏𝑖 )𝑜𝑖 (𝑡 − 𝜏𝑖 ), and 𝑜𝑖 (𝑡) ∈ Z represents the number of ordered
chains, particularly cooperative model predictive control. Finally, a items of drug 𝑖, only in those cases where 𝛿𝑖 (𝑡) = 1. This is one of the
variation of MPC is used for the management of inventories and supply complicating issues of this type of application because it leads to mixed-
chains in Rasku, Rantala, and Koivisto (2004). integer optimisation problems.
121
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
min 𝐽 ∶= 𝛽1 𝐽1 (𝑜, 𝑡) + 𝛽2 𝐽2 (𝑜, 𝑡) + 𝛽3 𝐽3 (𝑜, 𝑡), (2) Fig. 1. Unit doses storage room.
𝑜
where 𝐽1 , 𝐽2 and 𝐽3 are the terms associated with stock levels, orders
and expenses, respectively. Weights 𝛽1 , 𝛽2 and 𝛽3 prioritise the differ-
ent terms. The solution of the problem can be substantially changed
depending on the values of these weights.
The terms in the objective function (2) are described next in decreas-
ing priority:
(1) 𝐽1 : Stock levels. The objective here is to maintain the stock levels
as low as possible while satisfying clinical needs. Whenever an
order is placed, the calculations are done to guarantee the exis-
tence of a safety stock, which is enough to satisfy the maximum
demands registered during two days in a row, which is obtained
from the hospital’s historical data. Hence, once an order is deliv-
ered, there is no need to make a new one, at least in the following
two days. We used the method presented in Maestre, Isla Tejera,
Fernandez, del Prado Llergo, Álamo Cantarero, and Camacho
(2012) to calculate the numerical values of these bounds values
for the stock. The mathematical condition is expressed as
𝑁𝑖
∑
𝑁 ∑
min 𝐶𝑜,𝑖 𝑠𝑖 (𝑡 + 𝑘), (3)
𝛿𝑖 ,𝑜𝑖 ∀𝑖 Fig. 2. Drug storage shelves.
𝑘=0 𝑖=1
As can be seen, each of the three objectives are translated into ∙ Order constraints. The formulation of these constraints is done
economic terms. Furthermore, the problem considers the following using the definition of the order variable, which is defined by
constraints: means of two variables: the Boolean 𝛿𝑖 (𝑡) and 𝑜𝑖 (𝑡). If 𝛿𝑖 (𝑡) = 1,
122
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
MPC is the methodology that is used here to solve the stock man-
agement problem. The basics of this strategy are the computation of
a prediction of the system’s output over a prediction horizon (𝑁) by
using a model of the process. An optimisation problem is built upon
the predicted trajectory and the control goals to calculate the optimal
sequence of inputs during a control horizon of length 𝑁𝑢 . (After the
control horizon, the inputs are assumed to be zero). The first is the
control value computed for the current time instant, and it is the only
one that is applied to the process: the rest are discarded. This process is
repeated at each time instant in a receding horizon fashion.
𝛿𝑖 (𝑡) = 0, ∀𝑡 ∈ {working days} The MPC that results from the direct implementation of the inventory
management problem presents some challenging features, such as non-
when the Boolean 𝛿𝑖 (𝑡) is used. Alternatively, 𝑜𝑖 (𝑡) has to be zero convex constraints and integer optimisation variables. For this reason,
in the non-working days. we exploited some properties of the problem to reduce its complexity:
123
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
∙ In the first place, the minimum bound for an order of drug 𝑖, Table 1
𝑖 , can be assumed to be 0 once it has been decided that Stock safety levels for two days without new orders being delivered, unit price, and units
𝑂min
per box.
an order is going to be placed to the laboratory. In particular,
𝑖 Safety level Prices/unit Units/box
the need for 𝑂min stems from the minimum budget required by
𝑖
the laboratory 𝑂$ ; that is, 𝑂min units are enough to satisfy the 1 0.99 0.98
minimum budget constraint imposed by 𝑂$ when the drug is 1 573 531 440 0.47 10
2 205 135 100 0.71 5
considered individually. Hence, these are redundant constraints
𝑖 3 50 40 30 2.91 10
and we just take 𝑂min = 0 once it is known that an order will be 4 50 30 30 1.87 10
med #
placed. 5 7 6 5 31.44 4
∙ Once it has been decided to place an order for one drug, then 6 14 7 5 37.09 4
there is really no need to consider the binary variables of the rest 7 12 10 7 1.49 10
8 12 10 7 1.45 10
of the drugs because they all belong to the same laboratory. By 9 13 9 7 1.25 20
assuming an aggregate cost for placing an order, we can consider 10 124 74 68 0.15 50
̂ at time step 𝑡, so that 𝛿(𝑖) = 𝛿(𝑡)
only one binary variable 𝛿(𝑡) ̂ for
any drug 𝑖 that belongs to the laboratory used in the experiments.
Consequently, the number of binary variables becomes simply January 2017. It must be noted that it is not possible to provide the real
𝑁𝑢 , which considerably reduces the computation burden of the names of the drugs here for the sake of confidentiality.
problem. Before the test period, the hospital provided historical data regarding
∙ States and orders are relaxed to have a continuous optimisation stock levels, demands and orders of the medicines considered corre-
problem in these variables, which generates a mixed integer lin- sponding to the period 1 September 2015 to 1 September 2016. The
ear program. There are specific techniques to solve this problem information was analyzed to generate bound levels for the controller.
(e.g., branch and bound (Lawler & Wood, 1966), genetic al- Table 1 shows the stock needed for each item to attain a certain
gorithms (Summanwara, Jayaramana, Kulkarnia, Kusumakarb, safety level during two consecutive days with no orders delivered. For
Guptab, & Rajesh, 2002) and the cutting-plane method (Cook, example, if the stock for drug #1 is 573 and the demand behaves as in
Kannan, & Schrijver, 1990)) but, given the low number of binary the historical data, then it would be possible to avoid stockouts during
variables, we have performed an exhaustive search on them to two days with a 100% guarantee. A lower stock implies assuming a
compute the solution. certain risk for this drug according to the data. Here, we used the 100%
∙ The solution of the problem is rounded up to have a number safety level as a lower bound for the stock during the horizon, which
of boxes since drugs are generally not sold in units. Note that usually corresponds to 10–15 days of average consumption for most
the rounding procedure guarantees the availability of drugs for medicines. More information regarding the construction and use of this
the prediction horizon but it generates sub-optimality in the type of table in hospital pharmacy is provided in Maestre et al. (2012).
solution. For example, if only one drug is required, then it may Note that the use of a safety stock is a very common practice in this
be necessary to complete the order with others. There are many context and was also previously used by the pharmacy department. In
feasible options to solve this issue and in principle there is no addition, given that it is based on empirical data, a certain connection
guarantee that the choice made by the controller is optimal. can be established with Jurado et al. (2016), where chance constraints
∙ Finally, we considered here 𝑁𝑢 = 1, which captures the mental are calculated by using this type of information. It should also, be noted
process of the pharmacy staff by analyzing whether an order that Table 1 provides information regarding the price of the drugs under
should be placed at the current time step. Simulations with larger study and the number of units in each box.
control horizons are also included to assess the effect of the 𝑁𝑢 The management method of the hospital before the application of
on performance. the MPC consists of a reorder point policy. More specifically, orders are
placed whenever the stock of a certain drug is below a certain threshold.
Remark 5. Orders are calculated to make stock levels greater than the If the amount to be ordered is enough to satisfy the minimum budget of
bound values used in the optimisation along the horizon (as long as the laboratory, the then order is placed. Otherwise, the pharmacists look
the demand behaves as expected). However, checking step 2 focuses at other items provided by the same laboratory to complete the order.
only on avoiding this problem during the next 𝑁 days. Hence, the Nevertheless, additional factors are taken into account by the pharmacy
bound levels become a sort of replenishment references when the order staff that can modify the strict application of the reorder point method,
is calculated and stock levels can be below them. In other words, the such as offers, coming holidays and the number of inpatients using a
controller makes its calculations to guarantee that an average demand certain drug.
can be satisfied during the whole prediction horizon without violating Given that it was the first implementation of MPC in the hospital, we
the safety bounds; otherwise an order is placed. Note also that the decided to use the same demand forecast used by the pharmacy staff,
safety stock is enough to guarantee the satisfaction of clinical needs which is very simple: the expected daily demand is its average value
of the hospital in the worst 48 h scenario recorded during the last calculated during the last year. With this forecast, the horizon of the
year according to the hospital data, which is a rather conservative controller 𝑁 was set to 12 days by using a simulation based trial and
assumption. Finally, if a stockout occurs, then a drug loan can be asked error approach. This result is also coherent with the aforementioned
from one of the neighboring hospitals, which mitigates the consequences choice of the safety levels. Hence, the policy of the controller can be
derived from such an event. described as follows: if the constraints of the problem can be satisfied by
the expected evolution of the stock levels with no items being delivered
during the next 12 days, then the controller suggests not to place a
4. Case study and results new order; otherwise, an optimal order is calculated for the drugs
under study. Acquisition costs are set by prices and storage costs are
In this section, we present the results obtained from the application calculated as the opportunity cost of the money invested on stocked
of the MPC policy to manage the inventory levels of a group of ten drugs items. The other costs that are considered by the controller are based on
provided by the same laboratory, considering that all management goals information provided by the pharmacy staff regarding average times of
are equally relevant; that is, 𝛽1 = 𝛽2 = 𝛽3 = 1. The test was performed placing orders, salary, and so on.
in San Juan de Dios hospital, which is located in the Spanish city of The evolution of the stock levels and the orders placed during the test
Córdoba, during the four-month period from 2 September 2016 to 3 period are shown in Fig. 4. As can be seen, the fact that all drugs have
124
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
the same provider allows us to group the requests to save costs and also be worse with our approach because more orders are placed when this
to satisfy the minimum budget constraint imposed by the laboratory. parameter is examined individually. Consequently, the average order
These results are analyzed by means of the following key performance size drops. However, from a global perspective, the order rate was also
indicators (KPI), which have been computed to highlight and quantify reduced. During the previous year, 31% of days an order was placed to
the differences with respect to the previous policy used by the hospital: the laboratory. During the test period, the order rate dropped to 12.5%.
This happened because the MPC policy groups orders; that is, once a
∙ Mean value (𝜇𝑖 ): the importance of this value goes beyond request is made to the laboratory, several drugs are ordered together at
its meaning as a statistic. The mean value of drug 𝑖 allows the same time, which saves both money and time.
us to quantify the average amount of money invested on this Table 2 also shows an assessment of the MPC implemented with
medication. respect to versions with longer control horizon. In particular, the initial
∙ Standard deviation (𝜎𝑖 ): the standard deviation of drug 𝑖 provides state and the demand obtained during the test period were used to test
us with information regarding the fluctuations of stock levels. MPC controllers with 𝑁𝑢 ∈ {3, 5, 7, 9}. As it turns out, the controller be-
∙ Maximum (𝑀𝑖 ): maximum number of items stocked in the period comes less conservative with these control horizons because it considers
of study. several order points in the horizon. Consequently, stock levels are lower
∙ Minimum (𝑚𝑖 ): minimum number of items stocked in the period on average but this has a cost in terms of stockouts. Nevertheless, we
of study.
must remark that the simulations were carried out at the same value
∙ Number of stockouts (𝑆𝑂𝑖 ): stockouts registered for drug 𝑖 in the
for the rest of the parameters that define the controller; that is, we
period of study.
studied changes on 𝑁𝑢 ceteris paribus. Had any of these controllers been
∙ Order rate (𝑂𝑅𝑖 ): number of days where an order for drug 𝑖
implemented, then we should have tuned all the parameters carefully
was placed divided by the days of the period of study. This KPI
by using the data provided by the hospital.
is important because it is closely related to the activity of the
Fig. 5 shows a comparison between the results with the previous
pharmacy department.
hospital policy and the MPC based ones. The boxplots are drawn
∙ Average order (𝐴𝑂𝑖 ): number of items ordered on average when
following the usual standards: a box is plot for each drug, where the
an order for drug 𝑖 was placed during the period of study.
central red mark is the median and the lower and upper edges represent,
The results regarding these KPI are shown in Table 2. In general, respectively, the 25th and 75th percentiles. In addition, whiskers are
most drugs improve their average, standard deviation, and maximum extended to the most extreme values not considered as outliers.1 Finally,
values. The minima indicate that there was no shortage of medicines
during the MPC period, although it was close for medicines #3 and #8 1 Points are depicted as outliers when they are outside the range [𝑄 −1.5⋅(𝑄 −𝑄 ), 𝑄 +
1 3 1 3
because there was no stock in certain moments. The order rate seems to 1.5 ⋅ (𝑄3 − 𝑄1 )], where 𝑄1 and 𝑄3 are, respectively, the 25th and 75th percentiles.
125
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
Table 2
KPI based comparison between the previous hospital policy, the MPC implemented in the experiment, and other versions of the controller tested via simulation with longer control horizon.
𝜇𝑖 𝜎𝑖 𝑀𝑖 𝑚𝑖 𝑆𝑂𝑖 𝑂𝑅𝑖 𝐴𝑂𝑖 𝜇𝑖 𝜎𝑖 𝑀𝑖 𝑚𝑖 𝑆𝑂𝑖 𝑂𝑅𝑖 𝐴𝑂𝑖
Sep 1st, 2015–Sep 1st, 2016 Sep 2nd, 2016–Jan 3rd, 2017 (Real MPC 𝑁𝑢 = 1)
1 1282.81 604.95 2387 −1 1 0.07 748.07 741.07 256.67 1365 150 0 0.20 480.62
2 217.40 98.41 447 −7 6 0.06 129.56 224.65 62.59 314 34 0 0.18 98.33
3 37.38 20.17 98 −2 9 0.04 34.61 58.54 30.21 120 0 0 0.13 26.36
4 57.90 20.83 100 0 0 0.05 32.50 67.99 14.37 78 38 0 0.07 26.66
5 12.07 5.97 27 0 0 0.09 6.36 10.78 3.71 15.00 1 0 0.16 6.46
med #
Table 3 Table 4
Overall results for the experiment period for the hospital (estimated), the implemented KPI of the previous hospital policy in the same period, one year before.
MPC and the assessed MPC via simulation.
𝜇𝑖 𝜎𝑖 𝑀𝑖 𝑚𝑖 𝑆𝑂𝑖 𝑂𝑅𝑖 𝐴𝑂𝑖
Real Simulated MPC
Sep 2nd, 2015–Jan 3rd, 2016
Hospital 𝑁𝑢 = 1 𝑁𝑢 = 3 𝑁𝑢 = 5 𝑁𝑢 = 7 𝑁𝑢 = 9 1 557.19 341.93 1378 −1 1 0.10 608.33
#Orders 41 16 35 35 34 35 2 222.67 111.91 447 −7 6 0.07 133.75
Savings (e) – 644.89 977.43 829.05 761.91 796.39 3 24.33 23.12 98 −2 9 0.04 32.00
#Stockouts 6 0 11 10 8 9 4 62.65 19.76 100 10 0 0.06 31.43
med #
Remark 6. We used twelve months and not four to assess the hospital 5. Conclusions
policy due to several reasons: (i) the activity of the pharmacy depends on
the period of the year; for example, Spanish people go on holidays either We have presented results from the application of an economic MPC
in July or August; (ii) in some periods of the year, there can be special policy to control inventory levels in the pharmacy department of a
126
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
Fig. 5. Boxplot results comparing results of the hospital policy (1), the implemented MPC policy (2), and the simulated MPC controllers with 𝑁𝑢 = 3 (3), 𝑁𝑢 = 5 (4), 𝑁𝑢 = 7 (5), and 𝑁𝑢
= 9 (6).
medium size hospital located in Spain. Our results show that, even with clear that the design of software for stock management in this context
a conservative and simple formulation of the controller, it is possible to should take into account the uncertainty generated by these events.
outperform the policy of the hospital. For this reason, we believe that Our experience has also taught us that the implementation of this
there is room to improve on these results by more aggressively tuning type of techniques requires the pharmacy staff to be trained so they
the controller (at least for some medicines) and exploiting the recent can place trust in methods that are novel for them. The tools are
bloom on stochastic MPC formulations, some of which have even been programmed provide them with a decision support system that they can
tested in simulation in a simplified version of this problem (Jurado et overrule at will, and it takes some time before they feel completely com-
al., 2016). In addition, the simulations performed with longer control fortable with the lower average inventory levels. Discussions regarding
horizons offer better economic results but at the cost of more stockouts. the placement of new orders when the controller was recommending
There is a trade-off between conservativeness and economic savings not to do anything emerged in different moments of the test period.
that is determined by the choice of the parameters of the controller. In the end, the controller was only forced to calculate a new order on
Simulations based on the data from the information systems of the one occasion, and the results showed that following the advice of the
hospital are essential to find the best tuning. program would not have led to stockout. Hence, it is necessary to train
Nevertheless, some comments regarding the accuracy of the infor- the pharmacy staff but also to tune the system to a risk level that they
mation systems of the hospital are in order. The staff working in the can feel comfortable with.
pharmacy are usually saturated with the amount of work that they have. Another noteworthy point is that the simplicity of the problem can
In fact, it is not rare that the workforce is occasionally enhanced by be deceiving. Even when the system dynamics can be modeled by means
temporary contracts. During the peak periods of work, the databases of integrators and delays, reality is more complex. As we just saw, issues
may be updated later than they should be; for example, an order is may arise regarding the accuracy of the hospital’s information systems.
delivered and the drugs are available (and possibly used) but this is In addition, delivery delays are not constant and prices can change from
only included in the information system following a certain delay (even time to time due to the offers made by laboratories. There may even
days in the worst cases). There are other common disturbing issues. be need to change the constraints of the problem; for example, when
For example, a member of staff forgets to reflect in the information a refrigerator is broken or when some drugs are offered so cheaply
system that a certain drug was taken, an event that generates errors that it can be preferable to allow extra space for stocking. In this
in the information. Consequently, there is a need for stocked items to dynamical problem setup, the role of the pharmacist is essential to
be counted several times a year so that these errors can be detected take advantage of the receding horizon nature of the MPC controller
and corrected. In addition, drugs may be returned from the departments because the problem can be updated with the most recent information
at the hospital, which usually have a small stock of items themselves. available in a flexible manner. For example, if two different orders
This is translated into negative demands that increase the pharmacy’s happen to be delivered on the same day, then the stock is simply updated
stock unexpectedly. During the experiment period, we would speak daily with the items received and the calculations are repeated without these
with the pharmacy staff to see how the stock was evolving and avoid pending deliveries. Without this cooperation, the orders calculated by the
problems in the information handled by the controller. However, it is controller will not be completely accurate and a certain trend to overrule
127
J.M. Maestre et al. Control Engineering Practice 71 (2018) 120–128
the controller can emerge. Hence, the interface between the controller Lawler, E., & Wood, D. (1966). Branch-and-Bound methods: a survey. Operations Research,
and the pharmacists has to be very carefully designed to maximise the 14(4), 699–719.
Maestre, J., Isla Tejera, B., Fernandez, I., del Prado Llergo, J.,Álamo Cantarero, T., &
usability and usage of the software.
Camacho, E. (2012). Análisis y minimización del riesgo de rotura de stock aplicado a
After looking into our results, we can conclude that the fact that the la gestión en farmacia hospitalaria. Farmacia Hospitalaria, 36(3), 130–134.
implemented controller was using 𝑁𝑢 = 1 increased the conservative- Maestre, J. M., Muñoz de la Peña, D., & Camacho, E. F. (2011). Distributed model
ness of the solution and also helped to avoid stockouts. The simulations predictive control based on a cooperative game. Optimal Control Applications &
show that longer horizons relaxed the policy of the controller and they Methods, 32(2), 153–176.
Maestre Torreblanca, J., Velarde, P., Jurado, I., Ocampo-Martinez, C., Fernandez, I.,
would have required a different choice for the other parameters. In Isla Tejera, B., & del Prado Llergo, J. (2014). An application of chance-constrained
addition, it has been beneficial to consider joint orders for all of the model predictive control to inventory management in hospitalary pharmacy. In 53rd
medicines that belong to the laboratory. Orders are placed in a smarter IEEE conference on decision and control, CDC 2014, (pp. 5901–5906).
way because they are completed based on the controller and not on the Mingers, J., & White, L. (2010). A review of the recent contribution of systems thinking
to operational research and management science. European Journal of Operational
decisions of the staff, which was the case whenever the reorder point of
Research, 207 (3), 1147–1161.
one of the drugs required an order to be placed. Neck, R. (1984). Stochastic control theory and operational research. European Journal of
Finally, we expect to test more advanced formulations of the con- Operational Research, 17 (3), 283–301.
troller in the future, also taking into account the lessons learned during Ortega, M., & Lin, L. (2004). Control theory applications to the production–inventory
this test. In particular, we plan to explore ways of implementing the problem: a review. International Journal of Productions Research, 42(11), 2303–2322.
Parlar, M. (1988). Game theoretic analysis of the substitutable product inventory problem
policy based on integer programming; that is, looking for the optimum with random demands. Naval Research Logistics (NRL), 35(3), 397–409.
of the problem and not an approximation provided by the relaxations Perea-López, E., Ydstie, B., & Grossmann, I. E. (2003). A model predictive control strategy
performed. for supply chain optimization. Computers & Chemical Engineering , 27 (8), 1201–1218.
Rasku, H., Rantala, J., & Koivisto, H. (2004). Model reference control in inventory and
supply chain management. In First international conference on informatics in control,
References
automation and robotics.
Rawlings, J. B., Angeli, D., & Bates, C. N. (2012). Fundamentals of economic model
Alvarez, L., & Callejon, G. (1999). The hospitalary pharmacy specialist handbook (in spanish), predictive control. In 2012 IEEE 51st annual conference on decision and control (pp.
vol. 1. In T. Bermejo, B. Cuña, V. Napal, & E. Valverde (Eds.), (pp. 43–46). Spanish 3851–3861).
Society of Hospitalary Pharmacy. Schwartz, J. D., & Rivera, D. E. (2010). A process control approach to tactical inventory
Axsäter, S. (1993). Optimization of order-up-to-s policies in two-echelon inventory systems management in production-inventory systems. International Journal of Production
with periodic review. Naval Research Logistics (NRL), 40(2), 245–253. Economics, 125(1), 111–124.
Bertrand, J. W. M., & Fransoo, J. C. (2002). Operations management research method- Schwartz, J. D., Wang, W., & Rivera, D. E. (2006). Simulation-based optimization of
ologies using quantitative modeling. International Journal of Operations & Production process control policies for inventory management in supply chains. Automatica,
Management , 22(2), 241–264. 42(8), 1311–1320.
Brewer, A. M., Button, K. J., & Hensher, D. A. (2001). Handbook of logistics and supply-chain Sterman, J. D. (2000). Business dynamics - systems thinking and modelling in a complex world.
management. Pergamon. New York: McGraw-Hill.
Cachon, G. (2001). Stock wars: inventory competition in a two-echelon supply chain with Stoica, C., Arahal, M., Rivera, D., & Rodríguez-Ayerbe, P. and Dumur, D. (2009).
multiple retailers. Operations Research, 49(5), 658–674. Application of robustified model predictive control to a production-inventory system.
Camacho, E. F., & Bordons, C. (2004). Model predictive control in the process industry (2nd In Proceedings of the 48th conferece on cecision and control (CDC).
ed.). London, England: Springer-Verlag. Subramanian, K., Rawlings, J. B., Maravelias, C. T., Flores-Cerrillo, J., & Megan, L. (2013).
Çetinkaya, S., & Lee, C. (2000). Stock replenishment and shipment scheduling for vendor- Integration of control theory and scheduling methods for supply chain management.
managed inventory systems. Management Science, 46(2), 217–232. Computers & Chemical Engineering , 51, 4–20.
Cook, W., Kannan, R., & Schrijver, A. (1990). Chvátal closures for mixed integer program- Summanwara, V., Jayaramana, V., Kulkarnia, B., Kusumakarb, H., Guptab, K., & Rajesh,
ming problems. Mathematical Programming , 47 (1), 155–174. J. (2002). Solution of constrained optimization problems by multi-objective genetic
Dong, J., Zhang, D., & Nagurney, A. (2004). A supply chain network equilibrium model algorithm. Computers & Chemical Engineering , 26(10), 1481–1492.
with random demands. European Journal of Operational Research, 156(1), 194–212. Tayur, S., Ganeshan, R., & Magazine, M. (1999). Quantitative models for supply chain
Größler, A., Thun, J.-H., & Milling, P. M. (2008). System dynamics as a structural theory management. Kluwer Academic Publisher.
in operations management. Production and Operations Management , 17 (3), 373–384. Velarde, P., Maestre Torreblanca, J., Jurado, I., Fernandez, I., Isla Tejera, B., & del
Ha, A. Y. (1997). Stock-rationing policy for a make-to-stock production system with two Prado Llergo, J. (2014). Application of robust model predictive control to inventory
priority classes and backordering. Naval Research Logistics (NRL), 44(5), 457–472. management in hospitalary pharmacy. In Proceedings of the 2014 IEEE emerging
Ignaciuk, P., & Bartoszewicz, A. (2010). LQ optimal sliding mode supply policy for periodic technology and factory automation, ETFA 2014 (pp. 1–6).
review inventory systems. IEEE Transactions on Automatic Control, 55(1), 269–274. Wang, W., Rivera, D. E., & Kempf, K. G. (2005). A novel model predictive control algorithm
Jurado, I., Maestre, J., Velarde, P., Ocampo-Martinez, C., Fernández, I., Tejera, B. I., & del for supply chain management in semiconductor manufacturing. In Proceedings of the
Prado, J. (2016). Stock management in hospital pharmacy using chance-constrained 2005 American Control Conference (pp. 208–213).
model predictive control. Computers in Biology and Medicine, 72, 248–255. Wang, W., Rivera, D. E., Kempft, K. G., & Smith, K. D. (2004). A model predictive
Kouvelis, P., Chambers, C., & Wang, H. (2006). Supply chain management research and control strategy for supply chain management in semiconductor manufacturing under
production and operations management: review, trends, and opportunities. Production uncertainty. In Proceedings of the 2004 American Control Conference (pp. 4577–4582).
and Operations Management , 15(3). Wikner, J. (1994). Dynamic modelling and analysis of information flows in production-
inventory and supply chain systems. Profil, Linköping.
128
28
Capítulo 3
SISTEMA PREDICTIVO DE
SOPORTE A LA DECISIÓN
BASADO EN DATOS PARA LA
GESTIÓN DE INVENTARIOS
EN HOSPITALES
29
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 1
TABLE I
i.e., si (t) for all i ∈ M, and sets a number of days for R ESULTS PROVIDED DAILY TO THE PHARMACY SERVICE BY THE
DECISION - SUPPORT SYSTEM .
which future information is required. Considering the latter,
and the information in D, the MPDSS automatically provides Numbers of days (n)
the following results:
1 2 ··· N
• Minimum quantity of each med i that should be ordered
to obtain 0% probability of stockout during the next n 1 o1,1 o1,2 ··· o1,N
Meds (i)
days according to historical data, calculated as 2 o2,1 o2,2 ··· o2,N
t̂+n
.. .. .. ..
X . . . .
oi,n (t) = max 0, max di (k) − si (t) , (11)
t̂∈T̂ M oM,1 oM,2 ··· oM,N
k=t̂
P P P
Cn i ci oi,1 i ci oi,2 ··· i ci oi,N
where T̂ = {1, 2, . . . , t − n − 1}.
• Total cost of the order that ensures a 0% probability of 1 p1,1 p1,2 ··· p1,N
Meds (i)
stockout for all meds during the same period, i.e., 2 p2,1 p2,2 ··· p2,N
.. .. .. ..
X
Cn (t) = ci oi,n (t). (12) . . . .
i∈M
M pM,1 pM,2 ··· pM,N
Correspondingly, it could be determinedP the total amount Q Q Q
of items that the pharmacy must order i oi,n (t). Pn i (1 − pi,1 ) i (1 − pi,2 ) ··· i (1 − pi,N )
• Probability of stockout for each med i ∈ M, assuming
that no order is placed, for a different number n of days
ahead, i.e., potential problems. Another simplification is the probability
of constraint satisfaction provided in Table I, which is cal-
pi,n (t) = p (si (t + n) ≤ 0) . (13)
culated empirically using the available data. To have robust
where p(si (t+n) ≤ 0) denotes the probability of si (t+n) statistical guarantees such as those given in [31], a very large
R2.5. being lower or equal to 0. Notice that pi,n (t) = 0 entails number of scenarios are required and the database may not
that there is no period of length n stored in D in which contain enough data. Even when there are some possibilities
the cumulative demand of i surpassed the amount of units to mitigate these issues, e.g., filtering data to remove outliers,
in stock. Additionally, note that the stock and demand are generate additional scenarios using resampling methods, etc.,
related through (3). Thus, it is possible to consider the their impact must be evaluated.
stochasticity from the viewpoint of the stock.
• Probability of not having stockout for all meds, assuming IV. C ASE S TUDY AND R ESULTS
that no order is placed, i.e.,
Y The proposed DB-MPDSS has been tested during a four-
Pn (t) = (1 − pi,n (t)) . (14) month period in the hospital San Juan de Dios, which is
i∈M located in the Spanish city of Córdoba. To this end, a group of
11 drugs was selected for the study; all of them supplied by the
That is, on the one hand, the DSS provides the quantities same laboratory. The hospital pharmacy provided the historical
of the minimum drugs that should arrive at the pharmacy to data of demand and orders for these 11 drugs during the last
cover the patients’ demands according to historical records, previous two years, which allowed us to calculate the historical
and, on the other hand, it assesses the risk of this not occurring. evolution of the stock levels. For confidentiality reasons, the
The analysis of data allows a more accurate calculation of name, prices, and further specific information about the drugs
these values, which conventionally are estimated based on are not disclosed in this paper.
the pharmacist’s experience and intuition. In view of the During the test period, the stock levels of the 11 drugs under
information contained in Table I and the constraints described study were introduced daily into the system by the pharmacy
in Section II, it is the pharmacist who decides when and how service. Considering this, the DB-MPDSS automatically cal-
many units of each drug should be ordered to the laboratories. culated the values described in Section III for periods of 2 to
Hence, the MPDSS does not undermine the human decision- 8 days, that is: minimum order quantities to prevent stockouts
making power, but augments the information available for during the corresponding number of days (see Table II) and
managing the inventory, thus facilitating current and future probabilities of this occurring in case no order is placed (see
decisions. Table III). In the same way, the DB-MPDSS provided the
Finally, it must be remarked that the use of the proposed total costs of the orders to assure 0% probability of stockout
DB-MPDSS policy also involves some risks. To begin with, (also in Table II), which, for the reasons mentioned above,
it is assumed that future demand realizations are contained are calculated considering unitary prices ci = 1 for all drugs
in the database, which may bias suggested orders due to i = 1, ..., 11. It can be seen that the number of items to order
issues such as extreme demand peaks in the past, abrupt increases with the number of days without placing any order
demand increments, and seasonal behaviour, to name a few due to the progressive increase in the cumulative patients’
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 6
Meds (i)
Meds (i)
5 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0
6 0 10 160 240 250 270 350 6 0 0.09 0.47 0.84 1.31 2.53 7.59
7 0 0 0 0 0 0 40 7 0 0 0 0 0 0 0.09
8 0 0 0 0 20 20 120 8 0 0 0 0 0.09 0.28 0.75
9 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0
11 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0
Cn 0 64 218 298 382 406 680 Pn 1 99,73 98,61 96,31 92,33 85,70 71,94
400
med #1
med #2
20
200 10
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
med #3
med #4
20 10
10 5
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
100
med #5
med #6
50 500
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
med #7
med #8
100
200
50
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
100
med #10
med #9
50
50
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
med #11
50 Stock
0 Orders
10 20 30 40 50 60 70 80 90 100 110
k [days]
med #2
500
20
10
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
5
med #3
med #4
10
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
100 1000
med #5
med #6
50 500
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
med #7
med #8
200
50
100
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
med #10
med #9
50 50
0 0
10 20 30 40 50 60 70 80 90 100 110 10 20 30 40 50 60 70 80 90 100 110
k [days] k [days]
med #11
50 Stock
Orders
0
10 20 30 40 50 60 70 80 90 100 110
k [days]
TABLE IV
KPI COMPARISON BETWEEN THE DB-DSS IMPLEMENTED IN THE EXPERIMENT AND THE OBTAINED SIMULATION RESULTS WITH THE MPC
CONTROLLER IN [34].
5 71.09 66.97 22.94 25.85 105 105 30 22 0 0 0.043 0.009 4.80 20.00
6 531.17 934.35 218.33 218.10 935 1172 86 253 0 0 0.274 0.256 264.25 288.33
7 116.20 42.42 18.85 21.74 129 99 69 -1 0 3 0.068 0.077 37.50 23.33
8 198.32 174.47 53.02 44.96 339 259 84 44 0 0 0.154 0.197 73.06 56.96
9 65.85 39.37 23.70 16.73 80 80 0 -20 0 1 0.068 0.068 33.75 33.75
10 73.37 59.69 17.25 15.73 102 79 39 24 0 0 0.068 0.051 8.50 10.00
11 68.23 47.75 17.46 17.21 97 73 33 18 0 0 0.068 0.043 8.50 10.00
TABLE V R EFERENCES
OVERALL PERFORMANCE COMPARISON OF THE DB-DSS AND THE MPC
APPROACH IN [34] [1] T. A. Zwaida, Y. Beauregard, and K. Elarroudi, “Comprehensive liter-
ature review about drug shortages in the canadian hospital’s pharmacy
#Orders Savings [e] #Stockouts supply chain,” in 2019 International Conference on Engineering, Sci-
ence, and Industrial Applications (ICESI), 2019, pp. 1–5.
DB (Experimental results) 34 - 0 [2] R. P. Saha E., “An overview of impact of healthcare inventory manage-
MPC (Simulation results) 31 649.5 4 ment systems on entrepreneurship,” in Entrepreneurship in Technology
for ASEAN. Managing the Asian Century. Springer, Singapore, 2017.
[3] S. Dı́az–Maroto, “Gestión de stock del material sanitario en el servicio
de farmacia del hospital general penitenciario (ii): Informatización y
TABLE VI aplicación de la clasificación abc al análisis de consumo,” Farm Hosp.,
KPI DURING THE FOUR - MONTHS PERIOD PREVIOUS TO THE EXPERIMENT. vol. 19, pp. 165 – 168, 1995.
[4] D. C. Feibert, B. Andersen, and P. Jacobsen, “Benchmarking healthcare
logistics processes – a comparative case study of danish and us hos-
µi σi Mi mi SOi ORi AOi pitals,” Total Quality Management & Business Excellence, vol. 30, no.
1-2, pp. 108–134, 2019.
1 375.75 87.90 568 183 0 0.265 56.03 [5] T. Bermejo, B. C. na, V. Napal, and E. Valverde,
“Manual del residente de farmacia hospitalaria,” Sociedad
2 13.73 6.43 33 0 0 0.179 10.86 Española de Farmacia Hospitalaria, 1999. [Online]. Available:
3 11.94 5.14 21 0 0 0.094 7.27 http://www.sefh.es/sefhpublicaciones/fichalibrolibre.php?id=22
[6] L. Alvarez and G. Callejon, The hospitalary pharmacy specialist hand-
4 8.84 1.67 11 6 0 0 0 book (in Spanish). Spanish Society of Hospitalary Pharmacy, 1999,
Meds (i)
[15] H. Tunc, O. A. Kilic, S. A. Tarim, and B. Eksioglu, “The cost of using Isabel Fernández received her Master degree in
stationary inventory policies when demand is non-stationary,” Omega, Pharmacy by the University of Seville, Spain. Cur-
vol. 39, no. 4, pp. 410 – 415, 2011. rently, she is the pharmacy manager of hospital San
[16] A. K. Purohit, D. Choudhary, and R. Shankar, “Inventory lot-sizing Juan de Dios in Córdoba, Spain, and is exploring
with supplier selection under non-stationary stochastic demand,” Inter- the application of advanced computation methods for
national Journal of Production Research, vol. 54, no. 8, pp. 2459–2469, pharmacy management as a part of her PhD research.
2016.
[17] W. W. Nasr and I. J. Elshar, “Continuous inventory control with
stochastic and non-stationary markovian demand,” European Journal of
Operational Research, vol. 270, no. 1, pp. 198 – 217, 2018.
[18] A. Gutierrez-Alcoba, R. Rossi, B. Martin-Barragan, and E. M. Hen-
drix, “A simple heuristic for perishable item inventory control under
non-stationary stochastic demand,” International Journal of Production
Research, vol. 55, no. 7, pp. 1885–1897, 2017.
[19] Y. Cao and Z.-J. M. Shen, “Quantile forecasting and data-driven inven-
tory management under nonstationary demand,” Operations Research
Letters, vol. 47, no. 6, pp. 465 – 472, 2019.
[20] L. Janssen, J. Sauer, T. Claus, and U. Nehls, “Development and
simulation analysis of a new perishable inventory model with a closing
days constraint under non-stationary stochastic demand,” Computers
Industrial Engineering, vol. 118, pp. 9 – 22, 2018. Paula Chanfreut received her Master degree in
[21] A. J. Kleywegt, V. S. Nori, and M. W. P. Savelsbergh, “The stochastic in- Industrial Engineering by the University of Seville,
ventory routing problem with direct deliveries,” Transportation Science, Spain, in 2019. Currently, she is a pre-doctoral
vol. 36, no. 1, pp. 94–118, 2002. fellow under the University Professor Training Pro-
[22] S. F. V. E. Biagi M., Carnevali L., “Hospital inventory management gram (FPU) at the Dep. of Systems and Automation
through markov decision processes @runtime,” in Quantitative Eval- Engineering, University of Seville.
uation of Systems. QEST 2018. Lecture Notes in Computer Science.
Springer, Cham, vol. 11024, 2018.
[23] K. Mubiru, “Joint replenishment problem in drug inventory management
of pharmacies under stochastic demand,” Brazilian Journal of Opera-
tions Production Management, vol. 15, no. 2, pp. 302–310, Jun. 2018.
[24] G. Wang, A. Gunasekaran, E. W. Ngai, and T. Papadopoulos, “Big data
analytics in logistics and supply chain management: Certain investiga-
tions for research and applications,” International Journal of Production
Economics, vol. 176, pp. 98 – 110, 2016.
[25] R. Y. Zhong, S. T. Newman, G. Q. Huang, and S. Lan, “Big data
for supply chain management in the service and manufacturing sec-
tors: Challenges, opportunities, and future perspectives,” Computers &
Industrial Engineering, vol. 101, pp. 572 – 591, 2016.
[26] W. M. A. and F. S. E., “Data science, predictive analytics, and big data:
A revolution that will transform supply chain design and management,”
Isabel Jurado graduated in Industrial Engineering
Journal of Business Logistics, vol. 34, no. 2, pp. 77–84, 2013.
and presented her doctoral thesis in 2013 on Con-
[27] A. Gunasekaran, T. Papadopoulos, R. Dubey, S. F. Wamba, S. J. Childe,
trol of Communication Network Systems in 2007
B. Hazen, and S. Akter, “Big data and predictive analytics for supply
from the University of Seville. She is currently a
chain and organizational performance,” Journal of Business Research,
professor and researcher at the Loyola Andalucı́a
vol. 70, pp. 308 – 317, 2017.
University. Her lines of research include control
[28] I. Jurado, J.M. Maestre, P. Velarde, C. Ocampo-Martinez, I. Fernández,
systems through communication networks, robust
B. I. Tejera, and J. del Prado, “Stock management in hospital pharmacy
control, predictive control and distributed systems.
using chance-constrained model predictive control,” Computers in
Biology and Medicine, vol. 72, pp. 248 – 255, 2016. [Online]. Available:
http://www.sciencedirect.com/science/article/pii/S0010482515003790
[29] J.M. Maestre, P. Velarde, I. Jurado, C. Ocampo-Martinez, I. Fernandez,
B. I. Tejera, and J. del Prado Llergo, “An application of chance-
constrained model predictive control to inventory management in hos-
pitalary pharmacy,” in 53rd IEEE Conference on Decision and Control,
CDC 2014, Los Angeles, CA, USA, December 15-17, 2014, pp. 5901–
5906.
[30] G. Schildbach, L. Fagiano, C. Freic, and M. Morari, “The scenario
approach for stochastic model predictive control with bounds on closed-
loop constraint violations,” Automatica, vol. 50, no. 12, pp. 3009–3018,
2014.
[31] G. C. Calafiore and M. C. Campi, “The scenario approach to robust José M. Maestre received the PhD on automation
control design,” IEEE Transactions on automatic control, vol. 51, no. 5, and robotics by the University of Seville, where he
pp. 742–753, 2006. works as full professor. His main research interests
[32] P. J. Van Overloop, J. M. Maestre, A. D. Sadowska, E. F. Camacho, are the control of distributed systems, the integra-
and B. De Schutter, “Human-in-the-loop model predictive control of tion of service robots in the smart home, and the
an irrigation canal [applications of control],” IEEE Control Systems applications of control to cyber-physical systems.
Magazine, vol. 35, no. 4, pp. 19–29, 2015.
[33] M. Inoue and V. Gupta, ““weak” control for human-in-the-loop systems,”
IEEE Control Systems Letters, vol. 3, no. 2, pp. 440–445, 2019.
[34] J.M. Maestre, I. Fernández, and I. Jurado, “An application of economic
model predictive control to inventory management in hospitals,” Control
Engineering Practice, vol. 71, pp. 120 – 128, 2018.
ARTÍCULOS DE CONGRESO
40
Capítulo 4
IMPACTO ECONÓMICO DE
LA APLICACIÓN DE
TÉCNICAS DE CONTROL
PREDICTIVO BASADO EN
MODELO A LA GESTIÓN DE
UN SERVICIO DE FARMACIA
41
A continuación se presenta una copia de la comunicación aceptada por la
Sociedad Andaluza de Farmacia Hospitalaria en su congreso anual de 2010:
AUTORES
Fernández García MI, Maestre Torreblanca JM, Cuenca López F.
TÍTULO
IMPACTO ECONÓMICO DE LA APLICACIÓN DE TÉCNICAS DE CON-
TROL PREDICTIVO BASADO EN MODELO A LA GESTIÓN DE UN SER-
VICIO DE FARMACIA
OBJETIVOS
La gestión del stock presenta problemas fácilmente modelables en el marco de
las técnicas de control predictivo basado en modelo (MPC): incertidumbres en la
demanda o las cantidades almacenadas, retrasos en la entrega de pedidos, límites
máximos y mínimos de unidades, rotación de stock para evitar caducidades, etc.
El objetivo de este estudio es demostrar las ventajas resultantes de la aplicación
de esta metodología a la gestión de un Servicio de Farmacia de un Hospital de
Tercer Nivel.
MÉTODOS
A partir de datos reales de entradas y salidas, se obtiene un modelo que ca-
racteriza el comportamiento de la demanda diaria del medicamento en cuestión,
se fijan una serie de datos (cantidad mínima y máxima en stock, mínimo número
de unidades por pedido), y se realizan simulaciones con una política de gestión
de stock a partir de MPC. Se aplicó esta metodología a 2 medicamentos.
RESULTADOS
En el periodo en estudio se solicitaron 10200 unidades del primer medicamen-
to, distribuidas en 4 pedidos. Se obtuvo una media de 2700 unidades con una
desviación típica de 868. Las simulaciones efectuadas arrojan que se podrían ha-
ber pedido 8000 unidades repartidas en 4 pedidos, obteniendo una media de 2430
unidades con una desviación típica de 543. De la misma forma se estudió el segun-
do medicamento, del cual se realizaron 3 pedidos de 80 unidades (240 unidades en
total), obteniéndose así un nivel medio de 106 unidades con una desviación típica
de 30. Aplicando la misma metodología de simulación, se extrae que se podrían
haber pedido 200 unidades en 4 pedidos, obteniendo una media de 59 unidades
42
con una desviación típica de 14. La política implementada por el MPC habría
supuesto un ahorro de más de 9000 euros en el periodo considerado (5764 y 3350
euros respectivamente, por las 2200 y 40 unidades de menos solicitadas de cada
uno de los medicamentos).
CONCLUSIONES
La simulación efectuada es contundente al comparar ambas políticas de ges-
tión. Al ahorro económico se suman ventajas como la reducción del espacio de
almacenamiento y el consiguiente control de caducidades. Se podría disponer de
un stock mucho más controlado y estable, gracias al MPC
43
Capítulo 5
APLICACIÓN DE TÉCNICAS
DE CONTROL PREDICTIVO A
LA GESTIÓN DE STOCKS EN
FARMACIA HOSPITALARIA
44
A continuación se presenta una copia de la comunicación aceptada por la
Sociedad Española de Farmacia Hospitalaria en su congreso anual de 2015:
AUTORES
Fernández García MI, Isla Tejera B, del Prado Llergo JR, Velarde Rueda P,
Jurado Flores I, Maestre Torreblanca JM
TÍTULO
APLICACIÓN DE TÉCNICAS DE CONTROL PREDICTIVO A LA GES-
TIÓN DE STOCKS EN FARMACIA HOSPITALARIA
OBJETIVOS
La adquisición y almacenamiento de medicamentos son dos de las principales
tareas de gestión que lleva a cabo el Servicio de Farmacia de un hospital. Por
una parte deben satisfacerse las necesidades clínicas en todo momento, pero las
limitaciones económicas y las restricciones logísticas obligan a usar estrategias
de compra que permitan almacenar la mínima cantidad. De ahí la importancia
de aplicar una buena política de gestión que satisfaga objetivos contrapuestos.
El objetivo de esta comunicación es evaluar y comparar tres técnicas de gestión
diferentes para optimizar el número de pedidos que realiza el Servicio de Farmacia
de un hospital.
MATERIAL Y MÉTODOS
Las técnicas evaluadas se basan en la utilización de un modelo matemático para
predecir la evolución del stock a partir de las estimaciones disponibles acerca del
comportamiento esperado de la demanda. Este tipo de técnicas son conocidas
como Control Predictivo Basado en Modelo. Las técnicas evaluadas son:
45
patrones de comportamiento similares a los ya registrados, las restricciones
son satisfechas.
46
Capítulo 6
INNOVACIÓN PARA
OPTIMIZACIÓN DE GESTIÓN
47
A continuación se presenta una copia de la comunicación aceptada por la
Sociedad Española de Farmacia Hospitalaria en su congreso anual de 2018:
AUTORES
Fernández García MI, Maestre Torreblanca JM, Jurado Flores I, Casas Del-
gado M
TÍTULO
INNOVACIÓN PARA OPTIMIZACIÓN DE GESTIÓN DE STOCKS
OBJETIVOS
La adquisición y almacenamiento de medicamentos es una de las principales
tareas de gestión que realiza un Servicio de Farmacia Hospitalaria. Por una parte
deben satisfacerse las necesidades clínicas, pero las limitaciones de recursos eco-
nómicos y las restricciones logísticas obligan a utilizar estrategias de adquisición
que minimicen la cantidad almacenada, asegurando, con cierto grado de certeza,
que se podrá responder a la demanda en la clínica. De ahí la importancia de apli-
car una buena política de gestión que satisfaga dichos objetivos contrapuestos.
El objetivo de este estudio es la implantación de nuevos sistemas que mejoren la
eficiencia de la gestión en los Servicios de Farmacia Hospitalaria.
MATERIAL Y MÉTODOS
Se ha diseñado un controlador para la optimización del stock mediante técni-
cas de control predictivo. Para ello se ha seleccionado un proveedor en concreto
y 10 medicamentos que se solicitan al mismo. Se han establecido una serie de pa-
rámetros como son stock mínimo, stock máximo almacenable, embalaje, pedido
mínimo al proveedor, tiempo estimado de entrega de pedidos, etc. y, teniendo en
cuenta también los consumos de los 12 meses anteriores, se ha diseñado un algo-
ritmo que automatiza la gestión de inventario explotando las sinergias existentes
entre los pedidos a un mismo proveedor. Para ello, el controlador simula la evolu-
ción esperada de los niveles de stock durante un intervalo de tiempo, calculando
así el pedido óptimo para el conjunto de medicamentos considerado.
Durante un periodo de 4 meses se han introducido diariamente en el programa
desarrollado los datos de stock de los 10 medicamentos en cuestión y de forma
automática el software ha calculado el pedido para dicho grupo de medicamen-
tos. Desde el Servicio de Farmacia se ha seguido fielmente la recomendación del
48
controlador a la hora de realizar los pedidos.
RESULTADOS Y CONCLUSIONES
Durante estos 4 meses, en comparación con el mismo periodo del año anterior,
se han reducido considerablemente tanto el número de pedidos al proveedor como
el stock promedio de estos medicamentos. Se ha estimado un ahorro económico
de 644.89 euros y además se ha reducido la carga de trabajo en el Servicio de
Farmacia. No se ha producido ninguna rotura de stock.
La metodología propuesta ha mejorado la gestión a diferentes niveles: garantiza
el abastecimiento con una disminución del nivel de inventario y del número de
pedidos, lo que libera espacio y reduce la carga de trabajo, además de generar
ahorros económicos.
Se puede considerar que la aplicación de este tipo de políticas en este contexto
es prometedora además de fácil de implementar. Como línea futura de trabajo
se pretende ampliar la cantidad de medicamentos controlados de esta forma au-
tomatizada mediante la incorporación de otros proveedores al programa, con la
intención de validar también otra de las técnicas que han sido propuestas durante
el periodo de investigación en este campo y que hasta el momento sólo han podido
ser estudiadas a nivel de simulación.
PALABRAS CLAVE Gestión Optimización Pedido
49
Capítulo 7
GESTIÓN y RIESGO DE
ROTURA DE STOCK
50
A continuación se presenta una copia de la comunicación aceptada por la
Sociedad Española de Farmacia Hospitalaria en su congreso anual de 2019:
AUTORES
Fernández García MI, Maestre Torreblanca JM, Jurado Flores I, Casas Del-
gado M
TÍTULO
GESTIÓN y RIESGO DE ROTURA DE STOCK
OBJETIVOS
Un Servicio de Farmacia debe disponer de niveles de stock suficientes pa-
ra atender las necesidades clínicas del hospital (pacientes ingresados, consultas,
quirófanos, hospital de día, pacientes externos, etc...) pero el elevado impacto
económico de muchos medicamentos y las restricciones presupuestarias obligan a
optimizar la gestión, evitando el dispendio de recursos y la aparición de proble-
mas relacionados con la falta de espacio o las caducidades. Además, debe tenerse
en cuenta también el impacto que la política de pedidos tiene sobre la carga de
trabajo del personal en el Servicio de Farmacia.
El objetivo de este trabajo es la mejora de la eficiencia de la gestión en los
Servicios de Farmacia Hospitalaria mediante un software que estima de riesgo
de rotura de stock, haciendo diferentes propuestas de pedidos y sirviendo como
herramienta de soporte a la toma de decisión del personal de farmacia.
DISEÑO
Se ha seleccionado un proveedor y 11 medicamentos que se solicitan al mismo
junto con parámetros como stock mínimo y máximo, embalaje, pedido mínimo y
tiempo estimado de entrega de pedidos. Asimismo, se proporcionan al programa
los consumos de los 24 meses anteriores. El software calcula, partiendo del nivel de
inventario actual, la probabilidad de rotura de stock de cada medicamento durante
los 8 días siguientes utilizando para ello los históricos de demanda suministrados.
Además, propone al farmacéutico las cantidades necesarias para garantizar el
abastecimiento para cada uno de los días, indicando el coste y el impacto en
términos de probabilidad de rotura.
CIRCUITO Y ETAPAS
Recopilación de datos a parametrizar, históricos de consumos, diseño y vali-
51
dación real.
IMPLANTACIÓN
Durante un periodo de 3 meses se ha utilizado el programa como herramienta
de ayuda a la toma de decisión en el Servicio de Farmacia, valorando sus propues-
tas para 2, 3, 4 ó 5 días, el importe del pedido en cada caso, y la probabilidad de
rotura de stock si no se hiciese pedido.
RESULTADOS Y LIMITACIONES
Durante estos 3 meses, en comparación con el mismo periodo del año ante-
rior, se han reducido considerablemente tanto el número de pedidos al proveedor
(un 30 % menos) como el stock promedio de estos medicamentos (579 unidades
menos). No se ha producido ninguna rotura de stock.
El diseño actual requiere introducir manualmente los datos de stock, lo que
dificulta la extensión a más medicamentos. Como mejora, se considerará la co-
nexión directa del sistema con el programa de gestión del centro para tomar los
datos directamente.
APLICABILIDAD A OTROS SERVICIOS DE FARMACIA
La metodología propuesta para optimizar el stock ha demostrado mejorar la
gestión, garantizando el abastecimiento de la demanda en todo momento, y pro-
porcionando además importantes ventajas como la disminución del espacio de al-
macenamiento necesario, reducción de la carga de trabajo mediante la reducción
del número de pedidos, además de ahorros económicos en base a la disminución
del nivel medio de stock.
La gran ventaja del programa es la confianza que proporciona al personal
respecto al abastecimiento de la demanda con unos niveles de incertidumbres
controlados. Por ello, este método es un soporte de gran valor y una herramienta
aplicable para mejorar la gestión de un Servicio de Farmacia.
PALABRAS CLAVE Gestión Riesgo Stock
52
ARTÍCULOS DE REVISTA
53
Capítulo 8
GESTIÓN DE INVENTARIOS
EN HOSPITALES USANDO
CONTROL PREDICTIVO CON
RESTRICCIONES DE
PROBABILIDAD
54
Computers in Biology and Medicine 72 (2016) 248–255
art ic l e i nf o a b s t r a c t
Article history: One of the most important problems in the pharmacy department of a hospital is stock management. The
Received 27 April 2015 clinical need for drugs must be satisfied with limited work labor while minimizing the use of economic
Accepted 18 November 2015 resources. The complexity of the problem resides in the random nature of the drug demand and the
multiple constraints that must be taken into account in every decision. In this article, chance-constrained
Keywords: model predictive control is proposed to deal with this problem. The flexibility of model predictive control
Hospital pharmacy allows taking into account explicitly the different objectives and constraints involved in the problem
Inventory management while the use of chance constraints provides a trade-off between conservativeness and efficiency. The
Model predictive control solution proposed is assessed to study its implementation in two Spanish hospitals.
Chance constraints
& 2015 Elsevier Ltd. All rights reserved.
Stochastic Control
Pharmacy Management Stockout Risk
http://dx.doi.org/10.1016/j.compbiomed.2015.11.011
0010-4825/& 2015 Elsevier Ltd. All rights reserved.
I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255 249
More strategies are presented in [6], where a competitive and optimization variables, i.e., the computational burden of this
cooperative selection of inventory policies in a supply chain with method is greater. Finally, multiple MPC oversimplifies the com-
stochastic demand are studied. On the other hand, Rezapour and putation of the control actions due to the low number of scenarios
Farahani [7] develops a model to design a supply chain network considered. In addition, all these methods have in common that
with deterministic demand. the existence of a very severe scenario may result in an increase of
In this work, a model predictive control (MPC) strategy is conservativeness [26].
proposed given the flexibility offered by its framework to handle In this paper, which is an extension of the previous works
multi-variable interactions, constraints on the problem variables, [27,28], CC-MPC is used to solve the problem of inventory man-
and optimization requirements in a systematic manner. Moreover, agement in hospital pharmacies. In particular, the formulation of
MPC has been successfully applied in the industry [8] and in the problem is generalized with respect to the aforementioned
similar problems. Some works based on the application of MPC works, where a Gaussian behavior of the demand is assumed. The
are, for example, [9,10], where MPC is used to supply chain man- mathematical development of the controller presented here can
agement in semiconductor manufacturing. Another example can
be applied even if the demand is only characterized statistically
be found in [11], where a distributed MPC algorithm with low
based on historical data. Likewise, the case of several hospitals that
communication burden is tested by using the MIT Beer Game (a
cooperate in order to relax their risk levels is another contribution
supply chain benchmark). An extension of this scheme for systems
of this work. It must be also remarked that this article has been
with more than two controllers is also tested with supply chains in
carried out in the context of a project named Pharmacontrol,
[12]. In [13], a robust MPC technique is used in a production-
whose goal is to improve the inventory management in two
inventory system. Finally, in [14] the problem of managing
inventories and supply chains is treated to reduce the number of Spanish hospitals.
tuning parameters with a technique based on a variation of MPC. The remainder of the paper is organized as follows. First, a
In the particular case of the stochastic control problems, i.e., description of the pharmacy inventory management optimization
those where the system being controlled is subject to uncertain- problem is shown in Section 2. Section 3 presents the MPC
ties and/or unknown disturbances, the control policy can guar- statement for this problem. In Section 4, some simulations are
antee that the actual variables do not violate the constraints at the shown and the corresponding results are discussed. Finally, in
cost of an additional conservatism. That is, the actions imple- Section 5 the conclusions are drawn.
mented by the control policy are designed to deal with worst-case
scenarios, which results in a waste of resources [15]. In this
situation, it is acceptable to assume a low level of risk to save 2. Pharmacy inventory management
resources. To this end, the original constraints of the problem can
be formulated in a probabilistic manner. The use of chance con- In this section, the mathematical background needed to build
straints was introduced in [16] and has been studied in a stochastic the optimization problem to be solved by the CC-MPC is presented.
programming framework [17].
The implementation of MPC in combination with chance con-
straints is known as chance-constrained MPC (CC-MPC). The 2.1. System definition
rationale of this approach is to replace hard constraints with
probabilistic constraints and the nominal cost function with its In general, it will be assumed that there are Ni different drugs
expected value in the MPC formulation [18], leading to a stochastic in the pharmacy inventory. The stock level of each one follows an
optimization problem. CC-MPC offers advantages as robustness, evolution depending on the orders and on the demand. This
flexibility, low computational requirements, and the possibility of evolution is represented by a discrete linear model, which for the
including the level of reliability associated with the constraints particular case of drug i is
[19,20]. Furthermore, since CC-MPC takes into account the
X
npi
expected performance of the closed loop with probabilistic con- si ðt þ 1Þ ¼ si ðtÞ þ oji ðt τji Þ di ðtÞ; ð1Þ
straints instead of directly trying to assure robust constraint j¼1
satisfaction, it avoids the conservatism present in other robust
MPC techniques, e.g.: [21,22]. where si A Z is the stock of drug i, oji A Z is the number of ordered
There are other alternatives in the stochastic MPC literature items to the j-th of the npi providers of the drug i, τij is its corre-
that are also suitable for this type of problem. One option to deal sponding transport delay, and di(t) represents the aggregate
with constraints on the inputs and states while optimizing some demand of drug i.
The number of ordered items can be modeled as oji ¼ δi ðt
j
performance criterion, also in the presence of uncertainties or
τji Þoji ðt τji Þ, where δi ðtÞ is a Boolean variable, that is, δi ðtÞ ¼ 1 if an
j j
disturbances, is the scenario-based MPC method proposed in [23].
This method is based on the optimization of the control inputs order of drug i to provider j is placed during time t, otherwise
over a finite horizon, subject to robust constraints under a finite δji ðtÞ ¼ 0, and oji A Z represents the number of ordered items of
number of random scenarios of the uncertainty and/or dis- drug i to provider j, only in those cases where δi ðtÞ ¼ 1.
j
X
N X
Ni X
npi
min δji ðt þ kÞðpji oji ðt þ kÞ þ C jsh;i Þ
δji ;oji 8 i;j k ¼ 0 i ¼ 1 j ¼ 1
X
N X
Ni X
N X
Ni
þ C s;i si ðt þ kÞ þ C o;i si ðt þ kÞ: ð5Þ
k¼0i¼1 k¼0i¼1
1. J1: Demand satisfaction. The main objective is the minimization There are also some considerations about the minimum number
of stockout probability. The main issue here is that the demand of items to order:
is not known in advance, i.e., it is stochastic. There may also be - The distributors do not work if the number of items ordered is
uncertainty in the transport delays. For this reason, it is usual in too low. Hence, there is a minimum of items to order at each
practice to set a safety stock to mitigate the impact of uncer- time, minitemj . Likewise, the pharmaceutical laboratories require
i
tainty. There are two possibilities in the way the safety stock is a minimum amount of money to be spent. That is translated into
set: it can be either fixed or variable. The former proposes that a minimum order size, minlabj . Taking into account these quan-
i
the minimum stock level is introduced as a fixed parameter in tities
the optimization problem. The latter treats the safety stock as an
minoj ¼ maxðminitemj ; minlabj Þ:
optimization variable. This term is expressed as i i i
X
N X
Ni
C os;i λstockout ;
i
min ð3Þ - Non-working daysof the laboratory (e.g., Sundays, holidays)
δ j j
;o
i i
8 i;j k ¼ 0 i ¼ 1
must be taken into account, which leads to the following con-
straint:
with
( δji ðtÞ ¼ 0; 8 t2
= fworking daysg: ð9Þ
1 if si ðt þ kÞ oSimin ;
λ i
stockout ¼ ð4Þ
0 if si ðt þ kÞ 4Simin ;
Operational constraints.These constraints take into account
where λstockout indicates whether the safety stock condition is
i
the limited capacity of the pharmacy for placing orders and
violated, Simin is the minimum stock level allowed for the drug i, receiving shipments. This fact limits the number of orders
I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255 251
placed along a time horizon of length N, i.e., where sðtÞ ¼ ½s1 ðtÞ; …; sNi ðtÞ, dðtÞ ¼ ½d1 ðtÞ; …; dNi ðtÞ and oðt τÞ ¼
Pnpi j
j ¼ 1 δi ðt τ i Þui ðt τ i Þ represents the total number of items
j j j
N X
X npi
δji ðt þ kÞ r Δi ; ð10Þ ordered. Note that system (14) is equivalent to (1).
k¼0j¼1
The control variables taken into account in this problem are
where Δi is the maximum number of orders of drug i that can be δji ðtÞ and oji ðtÞ, both components of the control variable o(t). Solving
placed along N. the optimization problem by using directly the control variable o
Economical constraints. The money spent during the time (t) (i.e., δi ðtÞ and oji ðtÞ together) is a difficult task, since they have
j
j
2.3. Cooperation between different hospitals the quantity of ordered items is oi ðt þ kÞ ¼ 0. Furthermore, the
variable oji ðtÞ can be considered as a real one to relax the problem.
Different hospitals can cooperate to reduce their safety stocks Notice that the solution obtained is still integer due to the problem
in case they are close and the consumption of certain drugs is features. In addition, the vector of control variables foji ðtÞ; …; oji ðt
uncorrelated between them. Consequently, the expenses derived þ NÞg is reduced by eliminating the components oji ðt þkÞ that are
from loans between them are low or can even be neglected. This equal to zero. Hence,
way, the hospitals can focus on the joint stockout probability
8 δi ðt þ kÞ ¼ 0;
j
k A f0; 1; …; Ng;
instead of the individual one, which should be higher, resulting in
lower safety and average stock levels. In the simplest case, each then
hospital would solve its original optimization problem with dif- 2 3
2 3 oji ðtÞ
ferent constraints. Likewise, it is also possible to formulate this oji ðtÞ 6 7
6 7 6 ⋮ 7
problem in the context of distributed control, where the hospitals 6 ⋮ 7 6 7
6 7 6 oj ðt þ k 1Þ 7
are agents that have to reach a consensus on the safety levels. The 6 oj ðt þ kÞ 7 6 i 7
- 6 7
optimization problem is
6 i
6
7
7 6 oj ðt þ k þ 1Þ 7 ;
6 ⋮ 7 6 i 7
4 5 6 7
X
H 6 ⋮ 7
j
oi ðt þ NÞ 4 5
min Jh ; ð12Þ j
oi ðt þ NÞ ~
o |fflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflffl}
h¼1
oji ðtÞ |fflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflffl}
o~ i ðtÞ
j
where Jh stands for the cost of each hospital and H is the number
of collaborating hospitals. The overall objective function taking is ~
where oji ðtÞ A RN þ 1 and o~ i ðtÞ A RN þ 1 is a reduced vector of non-
j
given by zero orders, where
3 X
X H
N
X
Jh ¼ βi;j J i;j ðo; tÞ; N~ ¼ N 1 δi ðt þ kÞ ;
j
i¼1j¼1
k¼0
where the demand, expenses, and orders terms are like in (3)–(6). is the number of non-zero orders.
The difference here is that, in the demand term, the probability The vector reduction from oji ðtÞ to o~ i ðtÞ can be represented by
j
i ðt τ i Þ di ðtÞ;
h
shi ðt þ1Þ ¼ shi ðtÞ þ oj;h j
8 h A f1; …; Hg: ð13Þ ~
where M A RðN þ 1ÞðN þ 1Þ is a matrix that reduces the dimension of
j¼1
the order vector oji ðtÞ depending on the value of δi ðtÞ. It is defined
j
as
8
< 1 if δj ðtÞ ¼ 1 4 i ¼ j;
3. Model predictive control Mði; jÞ ¼
i
ð15Þ
: 0 if δj ðtÞ ¼ 0 3 ia j:
i
The control strategy used to solve the stock management pro-
As direct consequence, o~ i ðtÞ contains only non-null compo-
j
blem is MPC. This strategy is a control method based on output
predictions over a prediction horizon ðNÞ calculated using a model nents, i.e., the orders that are non-zero.
Taking into account the integer nature of the variable δi ðtÞ, the
j
of the process [8]. From the optimization of the objective function
subject to constraints, a set of future control signals is obtained. resulting optimization problem is a mixed integer one (MIP). There
Only the control value computed for the time instant k is applied are different techniques to solve them like branch and bound [29],
to the process, the rest of them are discarded. This process is genetic algorithms [30] or the cutting-plane method [31]. In this
repeated in a receding horizon fashion. article, an exhaustive search approach has been implemented. This
means that the optimization problem is solved for each possible
realization of fδi ðtÞ; …; δi ðt þ NÞg. This way, Boolean variables are
j j
3.1. MPC setup
removed from the optimization. The optimal solution corresponds
with the combination of the values of fδi ðtÞ; …; δi ðt þ NÞg that
j j
In this section, the implementation of the control problem will
be detailed. The objective is the minimization of the objective provides the minimal value of the objective function.
function (2). Consider the system defined by
Remark 1. It is necessary to pay special attention to the con-
sðt þ 1Þ ¼ sðtÞ þ oðt τÞ dðtÞ; ð14Þ straints while solving this problem. It is not possible to impose the
252 I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255
where D Rn , d is a stochastic vector defined over a set E Rs , and ϕ1 ð Smin þ sðt þ 0Þ þ oðt þ 0Þ þ oðt þ 1ÞÞ Z 1 δs ;
1
m is the number of constraints. It is assumed that there is a set of Smin þ sðt þ 0Þ þ oðt þ 0Þ þ oðt þ1Þ Z ϕ1 ð1 δs Þ;
1
events F, formulated by subsets from E and a probability dis- oðt þ 0Þ þ oðt þ 1Þ Z Smin sðt þ 0Þ þ ϕ1 ð1 δs Þ;
tribution P, defined over F. Hence, for each A E, the probability P 1
oðt þ 0Þ oðt þ 1Þ r Smin þ sðt þ 0Þ ϕ1 ð1 δs Þ:
(A) is known. In addition, it is assumed that the functions
G i ðo; Þ : E-R; 8 o, i are random variables and the probability Iteratively (e.g., k ¼3) and according to the previous development,
distribution P is independent of the decision variable o. it can written as
For addressing this problem, it is necessary to rewrite the 1
oðt þ0Þ oðt þ 1Þ oðt þ 2Þ r Smin þ sðt þ 0Þ ϕ2 ð1 δs Þ;
optimization problem as a deterministic equivalent in which the
constraints are verified with a certain probability. These stochastic where ϕ2 ðÞ denotes the cumulative distribution function of the
constraints are called chance constraints. These constraints can be variable dðt þ 0Þ þ dðt þ1Þ þdðt þ 2Þ.
formulated by two different manners as discussed below. Generalizing for a prediction horizon N,
2 3 2 3 2 3
1 0 0 ⋯ 0 oðt þ 0Þ 1 1
Joint Chance Constraint: The stochastic formulation of the joint 6 1 1 0 ⋯ 0 7 6 oðt þ 1Þ 7 61 17 " #
6 7 6 7 6 7
chance constraints is given by the objective function (12), 6 7 6 7 6 7 sðt þ 0Þ
6 7 6
6 1 1 1 ⋯ 0 7 6 oðt þ 2Þ 7 r 6 1 1 7 7 6 7
subject to 6 7 6 7 6 7 Smin
4⋮ ⋮5 4 ⋮ 5 4⋮ ⋮5
PðG i ðo; dÞ rg i ; 8 iÞ 4 1 δx ; 1 1 ⋯ 1 oðt þN 1Þ 1 1
o A D; 2 1 3
ϕ0 ð1 δs Þ
where δx A ½0; 1 is the risk that the constraints of the 6 1 7
6 ϕ1 ð1 δs Þ 7
optimization problem are not fulfilled. 6 7
6 7
6 ϕ 1 ð1 δs Þ 7;
Individual Chance Constraint: Individual chance constraints are 6 2 7
6 ⋮ 7
formulated with the same objective function (12), sub- 4 5
1
ject to ϕN 1 ð1 δs Þ
PðG i ðo; dÞ rg i Þ 41 δxi ; 8 i 1
where ϕN 1 ð1 δs Þ is the cumulative distribution function of the
o A D; random variable dðt þ 0Þ þ dðt þ 1Þ þ dðt þ 2Þ þ ⋯ þ dðt þ N 1Þ.
where it writes one equivalent by each stochastic Remark 2. It is also possible to assume that the behavior of the
constraint. disturbances can be adjusted as a function of a certain probability
distribution. In [27], a normal distribution is used to characterized
The aggregate demand dðtÞ in (14) includes a stochastic dis- the behavior of the perturbations, with mean μ and standard
turbance component given its uncertain nature. Due to the pre- deviation σ, i.e., dðtÞ ¼ Nðμ; σ Þ. This assumption could be extended
sence of these uncertainties, the constraints have a stochastic to other patterns or even work directly with historical data, like in
nature, i.e., they can not be written as deterministic ones. There- this case.
fore, the constraints can be expressed as
Pðsðt þ kÞ ZSmin Þ Z 1 δs ; 8 k A f1; ‥; Ng;
4. Case study and results
where δs is the probability of having less stock than Smin . This
expression can be developed along N and obtain the mean and In this section, CC-MPC is going to be applied to manage the
standard deviation of the state. orders of two drugs available in the hospitals San Juan de Dios and
For the first time instant along N (i.e., k ¼1), it yields Reina Sofía (both located at Córdoba, Spain). These drugs are not
Pðsðt þ 0Þ þoðt þ 0Þ dðt þ 0Þ Z Smin Þ Z 1 δs ; only expensive because of their prices but also because of their
Pð dðt þ 0Þ Z Smin sðt þ 0Þ oðt þ0ÞÞ Z 1 δs ; maintenance costs, since they must be stored in a fridge. Due to
this fact, the reduction of their stock levels is a priority. Due to
Pðdðt þ 0Þ r Smin þ sðt þ 0Þ þ oðt þ 0Þ Þ Z 1 δs ;
|fflfflfflffl{zfflfflfflffl} |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} confidentiality reasons, the specific names and prices of these
Random Deterministic
drugs are going to be omitted.
which can be rewritten as Regarding the controller, a prediction horizon N ¼8 days has
been considered. The evolution of the stock is modeled by using
ϕ0 ð Smin þ sðt þ 0Þ þ oðt þ0ÞÞ Z 1 δs ;
the discrete-time linear model in (14). The orders of these drugs
where ϕ0 ðÞ is the cumulative distribution function of the random have a minimum amount of 4 units and the maximum has been
variable dðt þ 0Þ. The deterministic equivalent for this chance set to 1000. The prices of the drugs are respectively 227 and 298
I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255 253
Fig. 2. Real and simulated stock evolution and placed orders for drug 1.
Fig. 3. Real and simulated stock evolution and placed orders for drug 2.
euros per unit, respectively, and each order placed implies an of their behavior has been calculated for these drugs based on
additional cost of 2 euros. The deliveries of these drugs usually historical data.
have a delay of 2 days with respect to the moment in which the If implemented in a hospital, the CC-MPC optimization problem
order was placed. The initial values of the stock levels are 500 and should be solved daily to compute the optimal orders to steer the
1520, respectively. For simplicity, neither storage cost nor storage stock levels as desired. For this simulation, the stock reference
limits have been considered at this stage of the proposed work. (security stock) has been set to 2. All optimization problems were
The only constraint implemented with respect to the stock is that computed by using linear programming routines (linprog in
the probability of stockout event has to be lower than 0.001 (i.e., it Matlab) on a machine with an Intel Core 2 Duo CPU with 3.33 GHz
is requested a reliability level of 99.999 %). Finally, the demand and 8 GB RAM. The time needed to calculate the optimal sequence
term of (14) is non-deterministic. A probabilistic characterization of actions per drug and day was below 10 s. If we take into account
254 I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255
Table 1 The results of the simulations show that CC-MPC allows redu-
Comparison of the behavior of the drug 1 applying CC-MPC and hospital policy. cing the average drug stock level and the work burden in the
pharmacy while satisfying the drug demand. The key for the
Approach Orders Stock-out Mean Desviation
improvement lies on the better time and order size of the pro-
CC-MPC 5 0 39 14 posed approach. Therefore, this control strategy leads to a more
Hospital historical data 9 0 43 11 efficient use of the resources by the pharmacy department.
Currently, this control approach is translated to C language as a
software tool to be implemented in the hospitals that collaborate
Table 2
in this work.
Comparison of the behavior of the drug 2 applying CC-MPC and hospital policy.
drinking water networks, in: Proceedings of the 19th IFAC World Congress, Emerging Technology and Factory Automation, ETFA 2014, Barcelona, Spain,
IFAC, Cape Town, South Africa, 2014, pp. 6240–6245. September 16–19, 2014, pp. 1–6.
[27] J. Maestre Torreblanca, P. Velarde, I. Jurado, C. Ocampo-Martinez, I. Fernandez, [29] E. Lawler, D. Wood, Branch-and-bound methods: A survey, Op. Res. 14 (4)
B. Isla Tejera, J. del Prado Llergo, An application of chance-constrained model (1966) 699–719.
predictive control to inventory management in hospitalary pharmacy, in: [30] V. Summanwara, V. Jayaramana, B. Kulkarnia, H. Kusumakarb, K. Guptab,
Proceedings of the 53rd IEEE Conference on Decision and Control, CDC 2014, J. Rajesh, Solution of constrained optimization problems by multi-objective
Los Angeles, CA, USA, December 15–17, 2014, pp. 5901–5906. genetic algorithm, Comput. Chem. Eng. 26 (10) (2002) 1481–1492.
[28] P. Velarde, J. Maestre Torreblanca, I. Jurado, I. Fernandez, B. Isla Tejera, J. del [31] W. Cook, R. Kannan, A. Schrijver, Chvátal closures for mixed integer pro-
Prado Llergo, Application of robust model predictive control to inventory gramming problems, Math. Program. 47 (1) (1990) 155–174.
management in hospitalary pharmacy, in: Proceedings of the 2014 IEEE
ARTÍCULOS DE CONGRESO
63
Capítulo 9
APLICACIÓN DE CONTROL
PREDICTIVO ROBUSTO EN
GESTIÓN DE INVENTARIOS
DE FARMACIA
HOSPITALARIA
64
Application of Robust Model Predictive Control to Inventory
Management in Hospitalary Pharmacy
P. Velarde, J. M. Maestre, I. Jurado, I. Fernández, B. Isla Tejera and J. R. del Prado
Abstract— Inventory management is one of the main tasks usually used, which means that when inventory drops below
that the pharmacy department has to carry out in a hospital. level s an order is placed to raise it back to S. Alternatively,
It is a complex problem that requires to establish a tradeoff a fixed size Q can be assigned to the orders and then s is
between different and contradictory optimization criteria. The
complexity of the problem is increased due to the constraints defined as the reorder point. Note that other periodic review
that naturally arise in this type of applications. In this paper, inventory control are possible as well, see for example [7]
which corresponds to preliminary works performed to imple- or [2]. Nevertheless, these policies lack of enough flexibility
ment robust and advanced control techniques for pharmacy to take into account all the factors involved in this opti-
management in two Spanish hospitals, we propose, assess mization problem in a systematic manner. For this reason,
and compare three robust model predictive control(Chance-
Constraints, Multi-Scenarios approach and Tree-Based Meth- in this work we propose to apply model predictive control
ods) as a mean to relieve this issue. (MPC) to the pharmacy department inventory management
problem. MPC is a popular control strategy for the design
I. INTRODUCTION of high performance model-based process control systems
Failures in the stock management in a hospital pharmacy because of its ability to handle multi-variable interactions,
may have catastrophic social and economical consequences. constraints on control (manipulated) inputs and system states,
On the one hand, the clinical needs of the hospital have to and optimization requirements in a systematic manner. MPC
be satisfied; the social cost of the unavailability of medicines takes advantage of a system model to predict its future
may be enormous as it may lead to the loss of human lives. evolution starting from the current system state along a
On the other hand, it is not possible to raise the average stock given prediction horizon. Due to its high versatility, MPC
levels too much. Hospitals have tight budgets that impose has become one of the most popular control techniques in
constraints on the stock management. In [1] it is estimated industrial applications [3]. In fact, similar problems such
that about 35% of hospital expenses on services and goods as supply chain management have also benefited from the
are due to the pharmacy department. In European countries, application of MPC. For example, [8] and [9] applied MPC to
where the health care system is public, these expenses are supply chain management in semiconductor manufacturing.
millionaire. Therefore, inventory management is one of the In [4] a popular supply chain benchmark, the MIT Beer
main tasks that a pharmacy department has to carry out Game, is used to test a distributed MPC algorithm with
in a hospital. It is a complex problem because it requires low communicational burden. Likewise, in [6] robust MPC
to establish a tradeoff between contradictory optimization is applied to production-inventory system. Finally, in [5] a
criteria. In addition, other factors that typically complicate variation of MPC is used to reduce the number of tuning
inventory management problems have also to be taken into parameters when managing inventories and supply chains.
account in this context. For example, there are constraints In the design of predictive controllers for dynamical sys-
on the placement of stocked drugs. Room is not endless, tems subject to disturbances and/or uncertainty, it is well
specially for those drugs that have to be preserved at low known that even if the controller finds a feasible solution,
temperature, and thus have to be stored in a fridge. Delays there is a certain probability that real outputs may violate
on drug deliveries and non deterministic demands are also the system constraints. Therefore, it would be desirable to
major issues in this context. replace and/or reformulate the original constraints involving
Typically, the pharmacy managers apply very simple in- random variables by probabilistic statements, allowing not
ventory control policies. In particular, an (s, S) policy is only the treatment of the uncertainty but also avoiding
possible unfeasibility of the optimization problem behind the
The authors would like to acknowledge Junta de Andalucı́a (Pharmacon- predictive controller.
trol Project, P12-TIC-2400), for funding this work. In this work, which has been performed in collabora-
P. Velarde, J. M. Maestre and I. Jurado are with the
Departamento de Ingenierı́a de Sistemas y Automática tion with two hospitals in Spain, we assess the use of
Universidad de Sevilla, 41092 Sevilla, Spain. Emails: three Robust Model Predictive Control (Chance-Constraints,
{pepemaestre,pabvelrue,ijurado}@us.es. Multi-scenario approach and Tree-based MPC) to inventory
I. Fernández is with the Pharmacy Department, Hos-
pital San Juan de Diós, Córdoba, Spain e-mail: management in Hospitalary Pharmacy, and it is a preliminary
[email protected] work of the project Pharmacontrol. The goal of this project
B. Isla Tejera, J. R. del Prado are with Pharmacy is to update the inventory management system of these
Department, Hospital Universitario Reina Sofı́a, Córdoba,
Spain e-mail: [email protected], hospitals so it is possible to reduce the average inventory
[email protected]. while maintaining the same clinical guarantees. In order to
npi j
min
j
δij (t + k)(pji uji (t + k) + Csh,i
j
)
X δi ,ui ∀i,j
si (t + 1) = si (t) + oji (t − τij ) − di (t), (1) Ni
N P
k=0 i=1 j=1
P
j=1 + Cs,i si (t + k).
k=0 i=1
oji
where si ∈ R is the stock of drug i, ∈ R is the number of (3)
ordered items to the j-th of the npi providers of the drug i, τij 3) Minimize the number of orders placed. The human
is its corresponding transport delay, and di (k) stands for the resources of the pharmacy department are limited.
aggregate demand of drug i. Note that the number of ordered Thus, it is convenient to minimize the fixed costs
items can be decomposed as oji = δij (t − τij )uji (t − τij ), with introduced every time an order is placed. This goal
δij (t) being a boolean variable whose value is one only if is better understood when it is taken into account
an order of drug i to provider j is placed during time t – that, for example, in a hospital such as Reina Sofı́a
otherwise its value is zero – and uji ∈ R being the actual more than twelve thousand orders are placed during
number of ordered items in case an order is placed. This a year. Mathematically, this condition is equivalent to
decomposition is introduced to simplify accounting for costs the following minimization problem:
that are related to the placement of orders. npi
Ni X
N X
We consider the following costs associated to the inventory
X
min Cop,i δij (t + k). (4)
management problem: δ
k=0 i=1 j=1
j
• pi is the price that the j-th provider offers for drug i.
In addition, different constraints have to be taken into
We will assume for simplicity that this price does not
account:
depend on the number of ordered items.
j • Storage constraints. On one hand, the stock of drug
• Csh,i is the shipping costs of asking drug i to provider
j. i has to be greater than a safety stock minsi , whose
• Cop,i represent the costs associated to placing an order
mission is to provide an extra guarantee so that the
of drug i. probability of lack of inventory is reduced. On the other,
• Cos,i is the cost of running out of stock of drug i, that
there may be room constraints that limit the maximum
is, the cost of shortage. In this case it is possible to number of drug samples that can be stored. Therefore,
ask for help to other hospitals. These loans require to
contract special deliveries, which may have a high cost. si ∈ [minsi , maxsi ]. (5)
In addition, the risk of not being able to satisfy the • Order constraints. The constraints on the orders re-
clinical needs of the hospital is maximum at this point. quire the use of two different variables. The first one
• Cs,i is the cost of storage of drug i. is a boolean variable that represents whether an order
The goals of a pharmacy manager can be summed up in the of drug i has been placed to provider j during time t.
following list. Note that the goals are provided in decreasing Thus, δij (t) ∈ [0, 1]. In case of placing an order it has
priority: to be taken into account that there is both a minimum
1) Demand satisfaction. In other words, the probability and a maximum number of items that can be ordered,
of drug shortage has to be minimized. The demand of that is,
the drugs is non deterministic. The same may happen
with the transport delay associated to the shipments. uji ∈ [minuj , maxuj ]. (6)
i i
A. Model Predictive Control
• Operational constraints. The pharmacy has a limited MPC is a control strategy based on the explicit use of
capacity for placing orders and receiving shipments. For a dynamic model to predict the process output at future
this reason a limit has to be imposed on the number of time instants over a prediction horizon (N ) [3]. The set of
orders placed during an horizon of length N , that is, future control signals is calculated by optimizing a criterion
npi
N X or objective function. The predicted outputs depend on
the known past inputs and outputs values up to instant k
X
δij (t + k) ≤ ∆i , (7)
k=0 j=1 and on the future control signals. Only the control signal
calculated for instant k is sent to the process whilst the next
where ∆i is the maximum number of orders of drug i
control signals are neglected. Some advantages that MPC
that can be placed during the horizon.
presents over other optimization control methods include the
• Economical constraints. We will consider a constraint
relative ease of implementation, the ready extension to the
on the amount of money that can be spent during
multivariable case, and the natural addition of constraints in
the horizon N , being max$ the maximum amount.
the optimization.
For simplicity, we will ignore the expenses due to the
In this work, MPC has been used to solve the problem.
stocked goods. Thus, this goal can be mathematically
Next, we examine the terms involved in expression (9). The
translated as:
first one is related to the satisfaction of the demand. As it has
been said, the demand has a random behavior. Therefore, all
Ni np
N P Pi
P
δij (t + k)(pji uji (t + k) + Csh,i
j
+ Cop,i ) we can do is to minimize the probability of drug shortage,
k=0 i=1 j=1 as it was shown in expression (2).
≤ max$
(8) B. MPC programming
In the following, we will present some considerations
III. O PTIMIZATION PROBLEM AND M ODEL P REDICTIVE
about the inventory control problem in order to ease its
C ONTROL IN P HARMACY I NVENTORY
implementation. Hence, the objective function will minimize
As it was stated in Section II, the objective of the opti- the number of orders placed and the expenses made. Con-
mization problem is threefold; the demand has to be satisfied, sider the system defined by:
the fixed assets reduced and the number of orders minimized.
The system can be represented according to Figure 1. s(t + 1) = s(t) + o(t − τ ) − d(t), (10)
where s(t) = [s1 (t), ..., sNi (t)] is the aggregated stock vector
for the npi different drugs, d(t) = [d1 (t), ..., dNi (t)] is the
np
Pi j
corresponding demand and o(t−τ ) = δi (t−τij )uji (t−τij )
j=1
represents the total number of items ordered. As it can be
seen, system (10) is equivalent to (1).
The problem to solve is the following:
min J
o
Fig. 1. Block System subject to (10) and (5)-(8). In this particular problem, we
have to deal with two variables of control: a boolean variable
System inputs are the estimated drug demands, disturbance δij (t) and uji (t), which are components of the control variable
and constraints. The outputs are the optimal stock levels, o(t). Since finding these two variables together by solving
minimum costs and data about when and how many orders the optimization problem is a difficult task, due to the dif-
should be delivered. The performance index considered in ferent nature of them, this problem will be solved by means
this work involves a multicriteria weighted function where of an exhaustive search algorithm, solving the problem one
demand satisfaction, expenses and number of orders are time for each possible scenario depending on the value of
included. Note that these terms are defined in Section II as {δij (t), ..., δij (t + N )}. With this algorithm, the optimization
goals of a pharmacy manager, i.e., problem is solved with respect to the variable uji (t).
It is straightforward to see that if δij (t + k) = 0, k ∈
min J = β1 Dem(u, t) + β2 Expenses(u, t) {0, 1, ..., N }, the number of ordered items oji (t + k) = 0.
u (9) Therefore, to simplify the problem, the vector of control
+β3 Orders(u, t) variables {uji (t), ..., uji (t + N )} is reduced eliminating the
where Dem, Expenses and Orders are respectively the components uji (t + k) that are multiplied by a δij (t + k) = 0,
terms associated to demand satisfaction, costs and orders. that is:
Note that the outputs of the problem depend strongly on the
weights β, which prioritizes the different terms. If δij (t + k) = 0, k ∈ {0, 1, ..., N },
uji (t) C. Chance Constraints MPC
uji (t)
..
.. . The aggregate demand d(t) has associated a stochastic
.
j
disturbance, due to the uncertain nature of d(t). As the state
ui (t + k − 1)
j
u (t + k) → ,
is influenced by additive uncertainties d(t), the constraints
j
i ui (t + k + 1)
..
can not be represented in a deterministic way. Therefore they
..
.
. are rewritten in a probabilistic manner, e.g.:
uji (t + N )
uji (t + N )
P (s(t + k) ≥ smin ) ≥ 1 − δs , ∀k ∈ {1, .., N },
| {z }
uji (t)
| {z }
u’ji (t)
where δs is the probability of failure, so it is the risk bound
N 0 +1
where uji (t) ∈R N +1
and u’ji (t) ∈R , being of stockout.
The optimization problem can be written, as:
N
X
N0 = N − 1 − δij (t + k)
min E[J], (11)
k=0 u
Subject to:
the number of decision variable. Note that this operation, i.e.
to reduce the vector uji (t) to u’ji (t), can be achieve by means s(t + 1) = s(t) + o(t − τ ) − d(t) (12)
of a simple change of variable:
P (si ∈ [minsi , maxsi ]) ≥ 1 − δs (13)
uji (t) = M u’ji (t),
uji ∈ [minuj , maxuj ]. (14)
N +1 N 0 +1
where M ∈ R ×R . i i
V. C ONCLUSIONS
As it can be seen, inventory management is one of the
main tasks that a pharmacy department has to carry out in
a hospital. It is a complex problem that requires to establish
a tradeoff between different and contradictory optimization
criteria. In this work we have described three control-based
methodologies for decision-making in a pharmacy depart-
ment to address prevention and control problems in the
inventory management.
The proposed methodologies optimizes the management
of the stock while guaranteeing with a very high probability
that the drugs will be available for the patients. In this sense,
the MPC framework is particularly useful because of its
favorable properties, such as ease of constraint-handling.
Finally, it is worthwhile to mention that the proposed
technique may provide important economical savings based
on the reduction of the average level of stocked drugs while
still guaranteeing the satisfaction of the clinical needs of
the hospital. Future work will include the extension of the
current framework to consider some of the issues that have
not been addressed in this paper and the real implementation
of this control policy into the hospitals that collaborate in this
project.
R EFERENCES
[1] T. Bermejo, B Cuña, V. Napal, and E. Valverde. The hospitalary phar-
macy specialist handbook (in Spanish). Spanish Society of Hospitalary
Pharmacy, 1999.
[2] A. M. Brewer, K. J. Button, and D. A. Hensher. Handbook of logistics
and supply-chain management. Pergamon, 2001.
71
Capítulo 10
OPTIMIZACIÓN DE LA
DEMANDA EN FARMACIA
HOSPITALARIA
72
Optimization of the Demand Estimation in Hospital
Pharmacy
A. J. López Ramı́reza , I. Juradoa , M. I. Fernández Garcı́ab , B. Isla Tejerac , J. R. Del Prado Llergoc
and J. M. Maestre Torreblancaa
a
Departamento de Ingenierı́a de Sistemas y Automática Universidad de Sevilla, 41092 Sevilla, Spain.
e-mail: {ijurado,pepemaestre}@us.es.
b
Pharmacy Department, Hospital San Juan de Diós, Córdoba, Spain
e-mail: [email protected]
c
Pharmacy Department, Hospital Universitario Reina Sofı́a, Córdoba, Spain
e-mail: [email protected], [email protected].
Abstract—Traditionally, the problem of hospital pharmacy variations on a hospital’s ability to operate successfully under
management of inventories has been paid little attention. This normal and emergency demand conditions.
problem is treated in this paper as a work-in-progress. The main
objective is to estimate the demand of stock in different services In [15], the logistics activities of the hospital pharmacy
of the hospital pharmacy, obtaining a reliable method for future are optimized. The solution is based on the Just-In-Time (JIT)
planning and management. A better demand estimation implies a concept and on an information system that will replace the
better management and therefore, significant savings in inventory central hospital pharmacy with a virtual hospital pharmacy,
costs. spreading the actual stock of pharmaceuticals in the clinics of
Some methods will be described an applied to series of all hospitals in the same geographical area.
data from the Hospital Universitario Reina Sofı́a (Córdoba). The Nowadays, the costs associated to the stocks are very high;
results will be compared in order to establish the best strategy therefore, the main objective is to provide the client in the due
to implement.
date, without accumulating excessive stocks ([5]). In fact, the
stocks may represent the 30% of the volume of the business
I. I NTRODUCTION in a company, therefore, small reductions of the stock may
suppose a great increase in the benefits. Therefore, a main issue
A proper stock management has been always a key point here is to define the amount of existences that, theoretically,
in the business science, because, the storage associated costs should have the company.
have been always a important part of the business costs.
Nevertheless, the financial costs associated to the stocks immo- In the field of stock management, demand estimation is
bilization are the reason for the relevance of stock management considered a very important subject, since, it would allow to
techniques in recent times. know the future demand in advance, and that makes possible
an efficient stock management. That way, the future demand
These stock management techniques pursue the minimiza- estimation presents a series of potential benefits, like client
tion of the stock costs, while the demand is satisfied without service improvement, stock level reduction, personal adminis-
delays ([1], [2], [3], [4]). tration improvement,... Nevertheless, the demand estimation
constitutes a critical process in the companies nowadays,
The importance of the stock management lies in the fact because, although there are a lot of statistical methods, they
that it is impossible to acquire immediately the orders in the are not used properly, or they are unknown ([6]).
place and moment that they are needed, in the quantity, quality
and minimal price. In this paper, the results of a collaboration with the
pharmacy service of the Hospital Universitario Reina Sofı́a
In [5], a method to determine the best value for the stock (Córdoba) are presented. In this case, a proper stock man-
as a function of the risk level and the number of days without agement is fundamental, that is, the patient’s needs have to be
stockouts is proposed. The problem addressed in [12] is a covered in the most economical way; and a fundamental tool
comparison of inventory costs and service levels of an in- for a proper stock management is the demand estimation.
house three-echelon distribution network vs. an outsourced
two-echelon distribution network. Therefore, this paper is a work-in-progress which objective
is to optimize the demand estimation of the drugs for the
In [13], inventory classification using ABC analysis is used. external patients ([7]), which are the main source of certain
A simple classification scheme is proposed in this paper using drugs demand. To do that, different prediction methods are
weighed linear optimization. applied to the historical data series, and the most appropriate
method is determined for each case, optimizing the demand
Inventory management is an important area that is subject
estimation.
to emergency demand situations. A simulation model of a
hospital inventory system was developed in [14] to determine This paper is organized as follows: Section II describes the
the relative significance of several common inventory system prediction method to applied. Section III presents a method
A. Quantitative model: Temporal series where the value Ŷ1 represents the estimation for the first
historical period, using typically Ŷ1 = Y1 . Furthermore, the
These prediction models are based in historical data of
smoothness constant α ∈ (0, 1) is incorporated, that allows
a variable, the history is analyzed to discover patterns like
to decrease the influence of distant values, diminishing im-
tendency, seasonality or cycles, the obtained patterns are
projected to the future. As these patterns are not valid for long portance to a proper choice of Ŷ1 . To do that, n weights αi
periods of time, these models are essentially useful to predict are defined, obtained from the parameter α, according to the
medium and short-term ([9]). geometric progression with ratio q = 1α, with αi = α.
In the following, the quantitative prediction models are The estimation is done depending on the real value, and the
theoretically described. estimation, obtained in the last period, although the n values
of Y are considered implicitly.
Simple approach
If large values are chosen for α, more weight is given to
The simplest estimation for the period n + 1 consists in the real recent values, while, choosing small values for α, bigger
assumption that the process is changing very slowly and that weights are reserved for substantial changes in the behavior of
the value of the variables does not change from one period to the variable under study, that way, the model responds quicker
another: to changes in the demand.
Ŷn+1 = Yn , n + 1 ≥ 2, (1)
This method is recommended when the temporal horizon of
where Yn is the variable under consideration, in this case the prediction is short, no information about any independent
the demand, in period n and Ŷn+1 is the estimation of that factor that affects the demand is known, there are not too
variable for the period n + 1. much resources and efforts to invert in the prediction and it is
desired that the prediction can follow the tendencies and the
It is straightforward to see that this method does not seasonality ([8]).
consider variations due to seasons or cycles, and overestimates
the random variations. Furthermore, it has the disadvantage of Box-Jenkins: ARIMA
being imprecise due to its large variance. Nevertheless, it is They are more complex statistical models. The more gen-
recommended when the series’ information in times before t eral one is the ARIMA model, an integrated auto-regressive
is meaningless, that is, its use has been invalidated, or simply model with mobile mean, that consists in identify a possible
the information does not exist, or it can be used as a starting prediction model, estimate its parameters and determine its
point to more sophisticated methods, being the technique with goodness ([10], [11]).
the best efficiency-cost rate ([8]).
The main advantage of these models is that they provide
Simple moving mean optimal predictions in short-term, due to Box-Jenkins method-
This prediction method uses just the last n periods, and the ology allows to choose between a wide range of models,
next expression: depending on how they represent the data series behavior.
Nevertheless, determinate the model that fits best the data
t
X series is not trivial, and wide knowledge is required about this
Ŷn+1 = (Yi )/n (2) methodology.
i=t−n+1
The ARIMA models are built from ARMA models. The
This technique does not only use all the relevant data from ARMA model typical expression (p, q) is the following:
the last n periods, but also the actualization between periods is
done easily, eliminating the first observation and aggregating Yt = C + φ1 × Yt−1 + · · · + φp × Yt−p
the last one. | {z }
Auto-regressive comp.
One advantage of this procedure is that the calculations are (4)
+ θ1 × t−1 + · · · + θq × t−q +t ,
very simple and, however, the system is flexible, considering | {z }
that the tendency is not forced to fit a particular math function. Mobile mean comp.
where the variable that defines the temporal series Yt Multiple linear regression
depends on a constant C, on the past values of the same
variables (auto-regressive component AR) and on the error past This method is used to study the relation between a
values (mobile mean component MA). dependent variable and various independent variables, being
the generic form of this model the following:
The number of delays in the temporal series that are
introduced in the model are denominated auto-regressive order
Ŷi = a1 Xi1 + a2 Xi2 + . . . + ak Xik (7)
of the model and it is denoted p. While the number of past
i = 1, 2, . . . , n,
errors introduced in the model is denominated mobile mean
order of the model, and it is denoted by q.
where Ŷ is the dependent variable, Xi1 , Xi2 , ... , Xik , are
Therefore, an ARIMA model (p, d, q) is an ARMA model the independent variables, and the i subscript indicates the n
(p, q) of the d times differentiated series. And its typical sampled observations.
expression is the following:
The same idea of minimal squares used in the case of the
(d) (d) (d) simple linear regression can be used in this case to estimate
Yt = C + φ1 × Yt−1 + · · · + φp × Yt−p the best values of a1 , a2 , ... , ak .
| {z }
Auto-regressive comp. One of the most important characteristics of causal models
(d) (d) (d) (5)
+ θ1 × t−1 + · · · + θq × t−q +t , is that they can be used to predict changing points in the
| {z } demand function. In contrast, the time series models can be
Mobile mean comp. used to predict the pattern of future demand taking as basis
the historical data, but these models can not predict high and
(d) (d) low points in demand levels.
where Yt is the differences series of order d and t is
the error series committed in the last series. Due to its capacity to predict changing points, the causal
The ARIMA model can be defined as a multiple linear models are generally exacter than time series models to for-
regressive model, where the dependent variable is the series mulate medium and long-term predictions.
itself, differentiated or not, and the independent variables are
series values and error values delayed to orders p and q, III. S TOCK ANALYSIS
respectively. In fact, once the model has been identified, the
parameters p + q determination is done in the same way In this section, a method to deal with the different items in
that in the case of multiple regression, that is, by means the the store of the pharmacy is presented. With this method, it will
minimization of the quadratic error. be possible to classified the different drugs depending on its
importance, price,... This will be useful in order to know which
B. Quantitative model: Causal model drugs require more attention and accuracy in their demand
estimation.
In general, causal prediction methods assume that exit a
cause-effect relation between a dependent variable (demand), A. ABC criteria
and other independent variables ([8]). There exist a lot of
methods, now, the most famous is presented. In general, in the storehouse of any company, it is usual to
find a large number of items with different characteristics. It
Simple linear regression is obvious to think that all of these items do not represent the
A linear relation between the variable to predict (depen- same volume of immobilized capital, and they are not equally
dent variable), and other variable (independent variable), is important for the company’s behavior.
assumed. This relation can be represented mathematically as Taking that into account, it is natural to conclude that
follows: the technique procedure and the control to apply in the stock
management of the items’ storehouse of a company do not have
Ŷi = a + bXi i = 1, 2, . . . , n, (6) to be equal for all of them. It will be necessary to pay more
attention and to be more precise in the management of those
where Ŷ is the estimated demand (depend variable) and items that, because of its price, represent a higher percentage
X is the period of time between the visits of the patient of the existences investment.
(independent variable). To do that, the items have been classified taking into
Taking into account that usually, the observations are account just the immobilized percentage that they represent
widely disperse, the best technique to determine the values respect to the total immobilized existences. The items have
a and b is the minimum squares method. been classified in three categories: A, B and C, denominating
this classification procedure as ABC method. In the A group
This method is based in the idea of minimizing the distant are included the items that, although they represent a small
between real observations Y , and corresponding points esti- percentage in physical units respect to the total items, they
mated by means the regression straight line Ŷ . Concretely, the are the highest part of the immobilized capital of the stock.
values a and b are determined in such a way the sum of the In the B group are included those with second order in value.
squares of the errors is minimized, between the real value Y , And in the C group are included those items that, although
and the estimated one Ŷ . they represent a high percentage in physical units respect to
the total, they suppose a small percentage of the immobilized
capital.
The item classification depending on their value has, in
general, a similar distribution to the Pareto’s one: about a 20%
of the number of items in stock represent almost an 80% of
the total value of the stock, as shown in Fig. 1.
ACKNOWLEDGMENT
The authors would like to acknowledge Junta de Andalucı́a
(Pharmacontrol Project, P12-TIC-2400), for funding this work.
79
Capítulo 11
UNA APLICACIÓN DE
CONTROL PREDICTVO CON
RESTRICCIONES DE
PROBABILIDAD A GESTIÓN
DE INVENTARIOS EN
FARMACIA HOSPITALARIA
80
An Application of Chance-Constrained Model Predictive Control to
Inventory Management in Hospitalary Pharmacy
J. M. Maestre, P. Velarde, I. Jurado, C. Ocampo-Martı́nez, I. Fernández, B. Isla Tejera and J. R. del Prado
Abstract— Inventory management is one of the main tasks millionaire. Therefore, inventory management is one of the
that the pharmacy department has to carry out in a hospital. main tasks that a pharmacy department has to carry out
It is a complex problem that requires to establish a tradeoff in a hospital. It is a complex problem because it requires
between different and contradictory optimization criteria. The
complexity of the problem is increased due to the constraints to establish a tradeoff between contradictory optimization
that naturally arise in this type of applications. In this paper, criteria. In addition, other factors that typically complicate
which corresponds to preliminary works performed to imple- inventory management problems have also to be taken into
ment advanced control techniques for pharmacy management account in this context. For example, there are constraints
in two Spanish hospitals, we propose and assess chance- on the placement of stocked drugs. Room is not endless,
constrained model predictive control (CC-MPC) as a mean to
relieve this issue. specially for those drugs that have to be preserved at low
temperature, and thus have to be stored in a fridge. Delays
I. INTRODUCTION on drug deliveries and non deterministic demands are also
Inventory control is a classical problem that arises in many major issues in this context.
fields. Wherever there is an organization that provides a Typically, the pharmacy managers apply very simple in-
certain good or service, there is a need of controlling the ventory control policies. In particular, an (s, S) policy is
items that are bought to this end. Ideally, the organization usually used, which means that when inventory drops below
would know exactly when these items will be needed, and level s an order is placed to raise it back to the inventory
hence they could be ordered to arrive and be used just in higher level S. Alternatively, a fixed size Q can be assigned
time. Unfortunately, this is not realistic due to the existing to the orders and then s is defined as the reorder point.
uncertainties with respect to the demand and material or Note that other periodic review inventory control are possible
information delays. As a consequence, some conservatism as well, see for example [12] or [2]. Nevertheless, these
in the control policy used is necessary in order to avoid policies lack of enough flexibility to take into account all the
stockouts, specially because the consequences of such event factors involved in this optimization problem in a systematic
can be fatal. manner. For this reason, in this work we propose to apply
Failures in the stock management in a hospital pharmacy model predictive control (MPC) to the pharmacy department
may have catastrophic social and economical consequences. inventory management problem. MPC is a popular control
On the one hand, the clinical needs of the hospital have to strategy for the design of high performance model-based
be satisfied; the social cost of the unavailability of medicines process control systems because of its ability to handle multi-
may be enormous as it may lead to the loss of human lives. variable interactions, constraints on control (manipulated)
On the other hand, it is not possible to raise the average stock inputs and system states, and optimization requirements in
levels too much. Hospitals have tight budgets that impose a systematic manner. MPC takes advantage of a system
constraints on the stock management. In [1] it is estimated model to predict its future evolution starting from the current
that about 35% of hospital expenses on services and goods system state along a given prediction horizon. Due to its high
are due to the pharmacy department. In European countries, versatility, MPC has become one of the most popular control
where the health care system is public, these expenses are techniques in industrial applications [3]. In fact, similar prob-
lems such as supply chain management have also benefited
The authors would like to acknowledge Junta de Andalucı́a (Pharmacon- from the application of MPC. For example, [13] and [14]
trol Project, P12-TIC-2400), for funding this work. applied MPC to supply chain management in semiconductor
J. M. Maestre, P. Velarde and I. Jurado are with the
Departamento de Ingenierı́a de Sistemas y Automática manufacturing. In [7] a popular supply chain benchmark, the
Universidad de Sevilla, 41092 Sevilla, Spain. Emails: MIT Beer Game, is used to test a distributed MPC algorithm
{pepemaestre,pabvelrue,ijurado}@us.es. with low communicational burden. Likewise, in [11] robust
C. Ocampo-Martı́nez, Senior Member IEEE, is with Automatic Control
Department, Universidad Politécnica de Catalunya, Institut de Robòtica MPC is applied to production-inventory system. Finally, in
i Informàtica Industrial (CSIC-UPC), Barcelona, Spain e-mail: [9] a variation of MPC is used to reduce the number of tuning
[email protected] parameters when managing inventories and supply chains.
I. Fernández is with the Pharmacy Department, Hos-
pital San Juan de Diós, Córdoba, Spain e-mail: In the design of predictive controllers for dynamical sys-
[email protected] tems subject to disturbances and/or uncertainty, it is well
B. Isla Tejera, J. R. del Prado are with Pharmacy known that even if the controller finds a feasible solution,
Department, Hospital Universitario Reina Sofı́a, Córdoba,
Spain e-mail: [email protected], there is a certain probability that real outputs may violate the
[email protected]. system constraints. Therefore, it would be suitable to replace
and/or reformulate the original constraints involving random is its corresponding transport delay, and di (k) stands for the
variables by probabilistic statements, allowing not only the aggregate demand of drug i. Note that the number of ordered
treatment of the uncertainty but also avoiding possible un- items can be decomposed as oji = δij (t − τij )uji (t − τij ), with
feasibility of the optimization problem behind the predictive δij (t) being a boolean variable whose value is one only if
controller. Probabilistic or chance constraints, which have an order of drug i to provider j is placed during time t –
been treated and developed within the stochastic program- otherwise its value is zero – and uji ∈ R being the actual
ming framework [6], were firstly introduced during the 60s - number of ordered items in case an order is placed. This
70s [8]. Combined with the standard MPC theory, they allow decomposition is introduced to simplify accounting for costs
the designer to arise with a stochastic optimization problem that are related to the placement of orders.
behind the controller by replacing hard constraints (either We consider the following costs associated to the inventory
of states or inputs) with probabilistic constraints and by management problem:
replacing the nominal cost function with its expected value
in the MPC formulation [4]. This stochastic approach, known • pji is the price that the j-th provider offers for drug
as Chance-Constrained MPC (CC-MPC) demonstrates to be i. This price could depend in general on the number
suitable for large-scale complex systems due to its inherent of ordered items. On way to proceed in that case
features such as robustness, flexibility, low computational would be to estimate that dependency (adjusting with an
requirements, and ability to include the level of reliability expression that could be linear, quadratic, ...) to include
(or risk) associated with the constraints (which implies its explicitly in this term the decision variable oji . We will
a priori knowledge) [10], [5]. Thus, CC-MPC avoids the assume for simplicity that this price does not depend
conservative nature of other MPC approaches taking into on the number of ordered items.
j
account the expected performance of the closed loop with • Csh,i is the shipping costs of asking drug i to provider
proper constraint handling instead of directly trying to assure j.
robust stability. • Cop,i represent the costs associated to placing an order
In this work, which has been performed in collaboration of drug i.
with two hospitals in Spain, we assess the use of CC-MPC • Cos,i is the cost of running out of stock of drug i, that
to inventory management in Hospitalary Pharmacy, and it is is, the cost of shortage. In this case it is possible to
a preliminary work of the project Pharmacontrol1 . The goal ask for help to other hospitals. These loans require to
of this collaboration is to update the inventory management contract special deliveries, which may have a high cost.
system of these hospitals so it is possible to reduce the aver- In addition, the risk of not being able to satisfy the
age inventory while maintaining the same clinical guarantees. clinical needs of the hospital is maximum at this point.
In order to illustrate the size of the problem, we will say • Cs,i is the cost of storage of drug i.
that the biggest hospital that participates in this work has a The goals of a pharmacy manager can be summed up in the
total capacity of 1200 beds for the inpatients. Besides these following list. Note that the goals are provided in decreasing
inpatients, the pharmacy department provides monthly more priority:
than five thousand drug dispensations for external patients.
In this hospital the expenses on drugs exceed the amount of 1) Demand satisfaction. In other words, the probability
fifty millions of euros per year. of drug shortage has to be minimized. The demand of
The paper is organized as follows. First, a description of the drugs is non deterministic. The same may happen
the inventory management problem is shown in Section II. with the transport delay associated to the shipments.
Section III, presents the optimization problem and the MPC As a consequence, it is common to set a safety stock
for this problem. Section IV some simulations are shown. in order to cope with the uncertainty introduced by
Finally, in Section V some conclusions are presented. these problems. Two possibilities arise at this point
depending on whether a fixed or variable safety stock is
II. P HARMACY I NVENTORY P ROBLEM set up. In the first case, a minimum bound is introduced
In this paper we assume that the pharmacy inventory is in the optimization problem. In the second one, the
composed of Ni different drugs. The following discrete linear safety stock becomes an optimization parameter. Any-
model will be used to represent the evolution of the stock how, this is translated into the following mathematical
level of drug i: condition:
npi
∑
si (t + 1) = si (t) + oji (t − τij ) − di (t), (1) ∑
N ∑
Ni
600
on the reduction of the average level of stocked drugs while
400
still guaranteeing the satisfaction of the clinical needs of the
200
hospital. Future work will include the extension of the current
0
0 100 200 300 400 500 600 framework to consider some of the issues that have not been
addressed in this paper, like perturbations or time delays,
and the real implementation of this control policy into the
800
CCMPC
hospitals that collaborate in this project. It will be interesting
700
600
Hospital also to compare this results with a worst case approach and
500
others probability levels. Finally, a more detailed model of
the demand can be developed too.
Orders
400
300
200
R EFERENCES
100 [1] T. Bermejo, B Cuña, V. Napal, and E. Valverde. The hospitalary
0 pharmacy specialist handbook (in Spanish). Spanish Society of
0 100 200 300 400 500 600
Hospitalary Pharmacy, 1999.
[2] A. M. Brewer, K. J. Button, and D. A. Hensher. Handbook of logistics
Fig. 2. Real and simulated stock evolution and placed orders. and supply-chain management. Pergamon, 2001.
[3] E. F. Camacho and C. Bordons. Model Predictive Control in the
Process Industry. Second Edition. Springer-Verlag, London, England,
2004.
[4] A. Geletu, M. Klöppel, H. Zhang, and P. Li. Advances and applications
of chance-constrained approaches to systems optimisation under un-
the CC-MPC placed 44. That is, the CC-MPC obtained better certainty. International Journal of Systems Science, 44(7):1209–1232,
results even with less orders. 2013.
[5] J.M. Grosso, C. Ocampo-Martinez, V. Puig, and B. Joseph. Chance-
The optimization has to be made taking into account the constrained model predictive control for drinking water networks.
constraints given by (5)-(8). A problem is solved at every Journal of Process Control, 2014. In press.
sampling time to compute a control sequence u that takes [6] P. Kall and J. Mayer. Stochastic linear programming. Springer, New
York, NY, 2005.
the system to the desired reference. For this drug, the stock [7] J. M. Maestre, David Muñoz de la Peña, and E. F. Camacho.
reference (security stock) has been set to 2. Distributed model predictive control based on a cooperative game.
A word of caution has to be said regarding the results at Optimal Control Applications and Methods, 2010. In press.
[8] A. Prekopa. On probabilistic constrained programming. In In Pro-
this point: there may be some uncertainty associated with ceedings of the Princeton Symposium on Mathematical Programming,
the real data. Sometimes either the drug dispensations or the pages 113–138, Princeton University Press, 1970.
arrivals of new items are recorded later than they occurred. [9] H. Rasku, J. Rantala, and H. Koivisto. Model reference control
in inventory and supply chain management. In First International
Another interesting issue regarding the real evolution is its Conference on Informatics in Control, Automation and Robotics, 2004.
big peaks, which are usually associated to orders placed [10] A.T. Schwarm and M. Nikolaou. Chance-constrained model predictive
before holiday periods (no orders can be placed then). In any control. AIChE Journal, 45(8):1743–1752, 1999.
[11] C. Stoica, M.R. Arahal, D.E. Rivera, and D. Rodrı́guez-Ayerbe,
case, the difference between the reality and the simulation P.and Dumur. Application of robustified model predictive control to
is big enough to believe that the application of this kind of a production-inventory system. In Proceedings of the 48th conferece
policies in this context is promising. on decision and control, 2009.
[12] S. Tayur, R. Ganeshan, and M. Magazine. Quantitative models for
All optimization problems, solved for the exhaustive algo- supply chain management. Kluwer Academic Publisher, 1999.
rithm, were computed using a linear programming (linprog [13] K. G. Kempft W. Wang, D. E. Rivera and K. D. Smith. A model
in Matlab), on a machine with an Intel Core 2 Duo CPU predictive control strategy for supply chain management in semicon-
ductor manufacturing under uncertainty. In Proceeding of the 2004
with 3.33 GHz and 8 GB RAM. American Control Conference, 2004.
[14] Wenlin Wang, Daniel E. Rivera, and Karl G. Kempf. A novel
V. C ONCLUSIONS model predictive control algorithm for supply chain management in
In this paper we have described a control-based method- semiconductor manufacturing. In Proc. of the American Control
Conference, 2005.
ology for decision-making in a pharmacy department to
address prevention and control problems in the inventory
management. As it can be seen, inventory management is
one of the main tasks that a pharmacy department has to
carry out in a hospital. It is a complex problem that requires
to establish a tradeoff between different and contradictory
optimization criteria.
The proposed methodology optimizes the management of
the stock while guaranteeing with a very high probability that
the drugs will be available for the patients. In this sense,
87
Capítulo 12
RESULTADOS Y DISCUSIÓN
88
El trabajo desarrollado enlaza con los objetivos del estudio.
En primer lugar, se han estudiado nuevas técnicas de estimación de la demanda
sin realizar ningún tipo de hipótesis simplificadoras sobre su distribución, sino
directamente en base a datos históricos. Concretamente, en el trabajo desarrollado
para el congreso Emerging Technology and Factory Automation 2014, titulado
“Optimizacion of the demand estimation in hospital pharmacy” se han analizado
y comparado diferentes métodos de estimación de la demanda, además del método
habitual usado por los hospitales.
Se presentan diferentes técnicas:
89
los valores recientes mientras que un valor pequeño de la constante le
da más peso a los cambios sustanciales en el comportamiento de la va-
riable en estudio, de manera que el modelo responde más rápidamente
a cambios en la demanda. Este método es recomendable cuando el ho-
rizonte temporal de predicción es corto, cuando se desconocen factores
independientes que afecten a la demanda y cuando sea deseable que la
predicción siga la tendencia y la estacionalidad (Pérez 2007).
Los modelos causales asumen una relación causa-efecto entre una variable
dependiente (demanda) y otras independientes (Pérez 2007). Pueden aplicar
una regresión lineal simple o múltiple. Lo más importante es que pueden ser
usados para predecir puntos cambiantes en la demanda. En cambio, las series
temporales predicen el patrón de la demanda, pero no predicen picos en los
niveles de la misma. De ahí que los modelos causales sean generalmente más
exactos que las series temporales para formular predicciones a medio y largo
plazo.
90
promedio móvil simple, el alisamiento exponencial y el método ARIMA propor-
cionan la mejor estimación para un fármaco concreto cada uno. El modelo causal,
concretamente la regresión lineal simple, es el más óptimo para otros 2 fármacos.
Los resultados reflejan, por tanto, que la utilización del mismo método para
todos los medicamentos no es adecuada, concluyéndose de aquí que debe estable-
cerse un método de estimación de demanda individualizado para cada medica-
mento. Esta mejora en la estimación de la demanda ha permitido a continuación
estudiar nuevas técnicas de optimización de stock.
A continuación se han evaluado y comparado 3 técnicas de gestión diferentes
basadas en MPC con el objetivo de optimizar el número de pedidos que realiza un
Servicio de Farmacia Hospitalaria en trabajo publicado en el congreso Emerging
Technology and Factory Automation 2014, titulado “Application of robust model
predictive control to inventory management in hospitalary pharmacy”. Estas téc-
nicas evaluadas se fundamentan en la utilización de un modelo matemático para
predecir la evolución de stock a partir de las estimaciones disponibles acerca del
comportamiento esperado de la demanda. Se trata de:
91
Estas técnicas se han evaluado en simulación para la gestión de un medicamen-
to termolábil de alto impacto económico. Una simulación de 230 días ha permitido
comparar la evolución esperada del stock siguiendo la política del hospital con la
que se obtendría utilizando las alternativas consideradas. En concreto, el hospital
ha realizado en dicho periodo 26 pedidos para obtener 394 unidades almacenadas
de media y 186 de desviación típica. Frente a ello, los resultados de las técnicas
evaluadas fueron: GRP (13 pedidos, 291 unidades de media y desviación estándar
de 101), GME (18, 245 y 92) y GAE (13, 183 y 89). La diferencia entre el caso
real y la simulación es lo suficientemente grande tanto en número de pedidos rea-
lizados como en el promedio almacenado como para considerar útil y ventajosa
a todos los niveles la aplicación de este tipo de políticas en este contexto. Con-
cretamente, teniendo en cuenta que el coste del medicamento es de 250 euros, el
ahorro estimado podría ser como mínimo de 25000 euros. Se ha estudiado tam-
bién la minimización del riesgo de rotura de stock mediante diferentes métodos
en “Análisis y minimización del riesgo de rotura de stock aplicado a la gestión
en farmacia hospitalaria” (Farmacia Hospitalaria 2011) y en “Control predictivo
aplicado a la gestión de stocks en farmacia hospitalaria: un enfoque orientado a la
minimización del riesgo” (Revista Iberoamericana de Automática e Informática
industrial 2013).
En “Análisis y minimización del riesgo de rotura de stock aplicado a la gestión
en farmacia hospitalaria” (Farmacia Hospitalaria 2011) se determina el valor que
debería tomarse como stock de seguridad en un medicamento concreto estudiado
y seleccionado por su alto coste y por la inmediatez de su necesidad en la acti-
vidad diaria de un hospital real. Este stock de seguridad se establece en función
del nivel de riesgo y del número de días que se desee resistir sin rotura de stock.
Adicionalmente se calcula también el valor que debería tomar dicho stock con-
forme a diferentes reglas utilizadas por los Servicios de Farmacia y se comparan
con el método propuesto.
En “Control predictivo aplicado a la gestión de stocks en Farmacia Hospitala-
ria: un enfoque orientado a la minimización del riesgo” (Revista Iberoamericana
de Automática e Informática industrial 2013) se aplica el MPC en simulación
con datos reales de un hospital desde una perspectiva de minimización del riesgo.
92
Se añaden acciones de mitigación con el objetivo de reducir el impacto de los
posibles riesgos que pueden ocurrir. Por lo tanto, se añaden al problema inicial
nuevas variables de decisión. En la comunicación para el congreso Conference on
Decision and Control 2014, titulada “An application of chance-constrained model
predictive control to inventory management in hospitalary pharmacy” se aplica
MPC integrado con restricciones probabilísticas a un medicamento termolábil de
alto coste.
Se ha establecido un mínimo de 4 unidades y un máximo de 1000. El precio
es de 250 euros por unidad. Cada pedido tiene un coste adicional de 2 euros y
la entrega se realiza en 2 días. Se ha realizado una simulación de 600 días y se
ha comparado con la evolución del stock siguiendo la técnica utilizada por el
hospital.
El stock medio obtenido con la nueva técnica es de 204 unidades con una
desviación estándar de 113. Con el método del hospital al resultado es de 451
unidades de media y una desviación estándar de 229. El ahorro estimado por la
reducción del stock almacenado es de más de 60000 euros. Además, el hospital
realiza 58 pedidos mientras que con esta técnica el número de pedidos se redu-
ce a 44. Asimismo se ha estudiado la aplicación de restricciones probabilísticas
para los problemas de gestión en este contexto en “Stock management in hospi-
tal pharmacy using chance-constrained model predictive control” (Computers in
Biology and Medicine 2016). Es una extensión de dos trabajos previos (CDC 2014
y ETFA 2014) en los que se asume un comportamiento Gaussiano de la demanda.
En este trabajo el controlador puede ser aplicado incluso si la demanda sólo está
caracterizada estadísticamente basándose en datos históricos.
En el caso particular de problemas de control estocásticos, cuya evolución en
el tiempo es aleatoria como el caso que nos ocupa, donde el sistema que se con-
trola es objeto de incertidumbres, la política de control puede hacer frente al peor
escenario posible y garantizar que las variables cumplan las restricciones a costa
de aplicar una política más conservadora. Con el fin de suavizar esa robustez es
aceptable asumir un nivel de riesgo más bajo formulando las restricciones del pro-
blema de una forma probabilística. Para ello se pueden implementar restricciones
probabilísticas en combinación con el MPC, que ha sido la técnica aplicada en
93
este trabajo. Se define un modelo matemático para el sistema cuyo objetivo es
satisfacer la demanda, reducir el stock y minimizar el número de pedidos para
adecuar la carga de trabajo al personal. Para satisfacer la demanda debe reducirse
la probabilidad de rotura de stock. La demanda es desconocida de antemano y
la entrega también puede ser un factor de incertidumbre. Para ello se establece
un stock de seguridad: con un valor mínimo fijo y un máximo variable. El má-
ximo almacenable también debe considerarse puesto que el espacio es limitado.
Se tendrá en cuenta también el coste global del pedido (debe llegar a un importe
mínimo para que el proveedor lo sirva) y el número de artículos pedidos en cada
solicitud. Asimismo se consideran los días festivos y fines de semana en los que
no se van a realizar pedidos y tampoco se van a efectuar entregas. Y, por último,
el valor de los medicamentos solicitados, ya que el presupuesto supone también
una restricción.
Se aplica esta técnica en simulación a dos medicamentos termolábiles. Se ha
establecido un mínimo de 4 unidades y un máximo de 1000. El precio es de 227
y 298 euros por unidad respectivamente. Cada pedido tiene un coste adicional de
2 euros y la entrega se realiza en 2 días. Los valores de stock iniciales son 500 y
1520 respectivamente. En los 360 días del periodo de estudio el hospital realizó
9 pedidos de uno de los medicamentos y 25 del otro. El resultado, aplicando la
estrategia en estudio, hubiese sido de 5 y 15 pedidos respectivamente. Asimismo,
el stock medio hubiese sido de 39 unidades de uno de los medicamentos y 770
unidades del otro, 4 unidades menos del primero y 91 menos del segundo que
siguiendo la metodología del hospital.
Por otra parte, dado que se realizarían menos pedidos, la desviación estándar y
las fluctuaciones son algo mayores con la simulación. No se ha producido ninguna
rotura de stock. Esta mejora de la gestión con las nuevas técnicas aplicadas se
traducirían en un ahorro económico de 1000 euros de media con el primer medi-
camento y de 27118 euros con el segundo. En conjunto se hubieses realizado un
40
Los resultados finales de la simulación es que se reduce el stock medio y la
carga de trabajo mientras que se satisface la demanda al 100
Por último se ha desarrollado un nuevo sistema de soporte a la decisión del
94
farmacéutico basado en técnicas de control predictivo, que ha sido validado en
un entorno real mediante dos pruebas piloto llevada a cabo con un conjunto de
medicamentos de un mismo laboratorio.
En “An application of economic model predictive control to inventory mana-
gement in hospitals” (Control Engineering Practice 2018) se realiza la primera
validación de la técnica en un hospital durante un periodo de 4 meses. Se han
seleccionado 10 medicamentos de un mismo proveedor para el estudio. Con los
datos de stock diarios de los medicamentos seleccionados para el estudio, el mo-
delo matemático ha estimado cada día si pedir o no y cuánto pedir, teniendo
en cuenta el histórico de datos de los 12 meses anteriores de consumos (salidas
por unidosis, por dispensaciones urgentes y por pedidos de reposición, y entradas
por recepciones de pedidos y devoluciones) y, por tanto, considerando múltiples
escenarios extraídos de los mismos, incluidos casos extremos de consumos. Se han
tenido en cuenta además una serie de restricciones que se han introducido en la
ecuación como son el embalaje, pedido mínimo al proveedor, tiempo de entre-
ga (se ha asumido un tiempo de entrega constante), stock máximo almacenable,
stock mínimo necesario, precio de compra y máximo número de pedidos asumibles
por el personal.
Esta metodología simula la evolución esperada de los niveles de stock durante
un intervalo de tiempo, calculando el pedido óptimo para el conjunto de medica-
mentos considerado y automatizando así la gestión. El sistema trata de reducir
al máximo la cantidad almacenada y el número de pedidos pero garantizando la
satisfacción de la demanda en un cierto periodo de tiempo en el peor escenario
que pudiera darse según los datos de consumos reales de los últimos 12 meses.
En último caso, el farmacéutico puede, si no se siente cómodo con la sugeren-
cia del sistema (vacaciones, cierres de laboratorio, aumento de demanda prevista,
oferta temporal…cualquier factor externo que pueda afectar a la demanda o la
entrega), forzar un pedido. Sin embargo se han seguido fielmente las recomenda-
ciones del sistema en todo el periodo de estudio.
Se han medido los siguientes parámetros:
95
roturas de stock
96
recibido por falta de tiempo.
Por otra parte, en distintos momentos del estudio el personal del Servicio de
Farmacia no se ha sentido cómodo con el nivel de riesgo asumido por el sistema,
excesivo según su percepción por la costumbre de disponer de mayor stock. De
hecho, en una ocasión se forzó un pedido. Es necesario ajustar ese nivel de riesgo
y generar más confianza en el personal.
Sería interesante ampliar este estudio explorando nuevas formas de implemen-
tarlo en el día a día de un Servicio de Farmacia, mejorando su utilidad y las
limitaciones mostradas.
En “A data-based model predictive decisión support system for inventory ma-
nagement in hospitals” (Journal of Biomedical and Health informatics 2020) se
lleva a cabo una segunda validación en el mismo hospital con los mismos medica-
mentos durante un periodo de 4 meses, con más restricciones añadidas al diseño
del sistema y teniendo en cuenta el histórico de datos de los 24 meses anteriores,
éste ha calculado diariamente la cantidad a pedir de cada uno de ellos para cubrir
periodos de 2 a 8 días, el importe total del pedido y la probabilidad de rotura de
stock durante ese mismo periodo de 8 días en caso de no formalizar el pedido. El
motivo de establecer un periodo mínimo de 2 días es que 2 días es el tiempo de
entrega del proveedor.
Este procedimiento ha permitido al personal del Servicio de Farmacia valorar
todas estas propuestas cada día y tomar la decisión última de pedir o no y del
número de días a cubrir en función del riesgo de rotura de stock dispuesto a
asumir. Es decir, que se trata de una herramienta de soporte para la toma de
decisión de pedir o no, sin embargo, se han seguido fielmente las recomendaciones
en cuanto a las cantidades.
Se han medido los mismos parámetros que en el estudio anterior:
roturas de stock
97
tasa de pedidos: número de días en los que se ha realizado pedido frente al
número de días total del estudio. Este parámetro se relaciona directamente
con la actividad generada en el Servicio de Farmacia.
Comparando los resultados con los que se hubiesen obtenido en caso de aplicar
MPC puro como en el trabajo anterior, se deduce que el stock medio se hubiese
reducido más, ahorrando un total de 649.5 euros, reduciéndose también el número
de pedidos a 31, frente a los 34 realizados en el periodo de la prueba. Sin embargo,
la mejora del último método se traduce principalmente en la cobertura de la
demanda: no se ha producido ninguna rotura de stock, mientras que aplicando
MPC puro se hubiesen producido 4, debido fundamentalmente a diferencias entre
la demanda real y la media considerada para las predicciones.
Si comparamos con los 4 meses anteriores al periodo de estudio, se concluye que
con las nuevas técnicas se reduce el stock medio y se reducen los picos alcanzados
o se mantienen más cerca de la media. El número de pedidos también se reduce
un 19 %, de 42 a 34. Sin embargo, la media del valor inmovilizado aumenta en
366.73 euros debido al leve incremento de los niveles de stock de algunos de los
medicamentos más caros. Posiblemente esto se deba a picos en los históricos de
la demanda, de manera que este stock extra ayudaría a minimizar los riesgos
de rotura de stock y, por consiguiente, satisfaría la pasada demanda real. Los
menores valores de stock de estos fármacos más caros se alcanzan con la política
de MPC puro.
En este trabajo se ha utilizado una estrategia estocástica de MPC diferente
denominada MPC basado en múltiples escenarios, que parte de los datos históricos
de acciones del propio Servicio de Farmacia para predecir la evolución del stock
en un hospital real. Ésta es la principal diferencia con respecto a los trabajos
anteriores: se basa en los datos históricos de acciones y aprende de los nuevos
datos aportados al sistema cada día. Otra novedad es que el farmacéutico es
el que decide entre las posibilidades presentadas por el controlador, que aplica
MPC basado en datos para diferentes horizontes y niveles de riesgo. El sistema es
utilizado como referencia puesto que a la hora de ejecutar un pedido hay múltiples
factores a considerar que no pueden ser implementados en el controlador, como
98
periodos vacacionales, festivos, cierres de laboratorios, fluctuaciones concretas de
la demanda, etc. De esta manera a las ventajas que aporta el sistema con técnicas
de MPC basado en múltiples escenarios, se añade la experiencia y criterio del
farmacéutico.
Los resultados obtenidos tras un periodo de prueba de 4 meses se comparan
con el controlador basado en MPC implementado en el Servicio de Farmacia
en el estudio anterior que se basa en pronóstico MPC puro. La comparación se
complementa con los resultados de la política habitual seguida por el hospital, es
decir, la técnica del punto de pedido.
En ambos casos las técnicas propuestas de optimización del stock han demos-
trado mejorar la gestión con respecto a la metodología habitual, garantizando
el abastecimiento de la demanda en todo momento, y proporcionando además
importantes ventajas como la disminución del espacio de almacenamiento ne-
cesario, reducción de la carga de trabajo mediante la reducción del número de
pedidos, además de ahorros económicos en base a la disminución del nivel medio
de stock y mayor control del stock (disminuye la desviación típica del nivel de
stock, manteniéndose éste con menos fluctuaciones en el tiempo) y del nivel de
riesgo asumido. A lo largo de todo el proyecto se han implementado, por tanto
dos tipos de métodos: técnicas de control predictivo directamente y técnicas de
control basado en datos.
99
Capítulo 13
CONCLUSIONES
100
La gestión de stocks es una tarea relevante en un centro hospitalario y su optimi-
zación repercutirá, por tanto, en el funcionamiento global del hospital. Se trata
de un problema complejo que requiere establecer un equilibrio entre criterios que
resultan contradictorios como pueden ser la disponibilidad de medicamentos y el
coste o el espacio de almacenamiento. En este proyecto se han aplicado técnicas
avanzadas de estimación y control orientadas a esta particular problemática de
la gestión de stocks y ha resultado ser prometedora y fácil de implementar.
101
pedidos. Este sistema de soporte al farmacéutico se ha validado en un entorno
real mediante dos pruebas piloto desarrolladas en un hospital con un conjunto de
medicamentos previamente seleccionados pertenecientes al mismo proveedor.
102
13.3.2. Segunda prueba
13.4. Aportaciones
La aplicación de este tipo de técnicas aporta ventajas a todos los niveles: reduc-
ción de stock, liberación de espacio, ahorro económico, optimización de pedidos
y mejor aprovechamiento de los recursos humanos.
103
únicamente se solicitan a veces para alcanzar un determinado importe mínimo de
pedido.
13.4.3. Confianza
13.4.4. Aplicabilidad
13.5. Limitaciones
13.5.1. Diseño
104
13.5.2. Stock actualizado
13.6.1. Ampliación
Sería interesante colaborar con otros centros que compartan el mismo sistema
informático de gestión de manera que se puedan explotar datos de medicamen-
tos comunes. Esto permitiría en un momento dado optimizar aún más la gestión
permitiendo una rotación de artículos entre centros, por ejemplo de aquellos pró-
ximos a caducar en un hospital que puedan tener salida en otro, y facilitando
también préstamos entre ellos que eviten roturas de stock. Se podría dar incluso
un paso más creando una plataforma de compras común que realizara los pedi-
dos a nivel centralizado aprovechando las sinergias entre centros y teniendo en
cuenta la actividad concreta de cada uno, previo acuerdo con cada proveedor de
la distribución de mercancía a cada hospital.
105
En las circunstancias de pandemia actuales, esta posibilidad de colaboración
hubiese permitido analizar las tendencias de tratamiento utilizadas en otros cen-
tros y compartirlas, además de anticipar la adquisición de dichos medicamentos,
escalonando los pedidos y evitando desabastecimientos por parte de los provee-
dores por la excesiva demanda.
En nuestro caso, por ejemplo, antes de que empezaran a llegar los primeros pa-
cientes de Covid19, cuando aún reinaba el escepticismo, únicamente se hizo acopio
de desinfectantes como el alcohol. Fue con la llegada de los primeros pacientes
cuando se comenzaron a adquirir aquellos medicamentos que nos iban solicitando
pero ya empezaban a escasear. Ante la creciente y desbordada demanda y, con
el objetivo de llegar a todos los pacientes posibles, la AEMPS tomó el control
de sus distribuciones, estableciendo criterios de uso, cambiando la disponibilidad
de las distintas presentaciones, reduciendo el número de dosis o bien los días de
tratamiento y, por último, dejando de servir para indicaciones no reflejadas en
ficha técnica. Por otro lado, a medida que la pandemia se iba extendiendo em-
pezaron a escasear también todos aquellos medicamentos habituales propios de
pacientes intubados de UCI (midazolam, cisatracurio, propofol, fentanilo, dex-
medetomidina, etc.). Comenzaron a demorarse los pedidos y a faltar stock en
determinados proveedores, obligando a buscar alternativas, a solicitar préstamos
a otros hospitales y a modificar los pedidos de uno a otro laboratorio en función
de la disponibilidad. Finalmente ante el caos ocasionado por dicha situación desde
el Servicio Andaluz de Salud (SAS) se decide que solamente se gestionen pedidos
desde los hospitales de referencia de cada Provincia, en cantidades establecidas
según el porcentaje de pacientes de UCI en cada una de ellas y, que desde cada
centro de referencia (en nuestro caso Reina Sofía) se suministrase al resto de hos-
pitales comarcales y privados de la Provincia en calidad de préstamo y según las
asignaciones establecidas por los Servicios Centrales del SAS.
De la misma manera en la que se actuó en esta situación de crisis, se podría
establecer una colaboración a nivel de gestión entre distintos centros que faci-
litase la adquisición centralizada y la distribución compartida entre hospitales
facilitando la disponibilidad de medicamentos a todos los pacientes y evitando
excedentes y acúmulos innecesarios.
106
BIBLIOGRAFÍA
107
Bibliografía
[2] Waller Matthew A. and Fawcett Stanley E. Data science, predictive analy-
tics, and big data: A revolution that will transform supply chain design and
management. Journal of Business Logistics, 34(2):77–84, 2013.
[9] Ying Cao and Zuo-Jun Max Shen. Quantile forecasting and data-driven
inventory management under nonstationary demand. Operations Research
Letters, 47(6):465 – 472, 2019.
108
[10] S. Çetinkaya and C.-Y. Lee. Stock replenishment and shipment scheduling
for vendor-managed inventory systems. Management Science, 46(2):217–232,
2000.
[12] June Dong, Ding Zhang, Hong Yan, and Anna Nagurney. Multitiered supply
chain networks: Multicriteria decision—making under uncertainty. Annals of
Operations Research, 135(1):155–178, 2005.
[13] W. B. Dunbar and S. Desa. Distributed MPC for dynamic supply chain
management. In Int. Workshop on Assessment and Future Directions of
NMPC, Freudenstadt-Lauterbad, Germany, 26-30, 2005.
[14] Diana Cordes Feibert, Bjørn Andersen, and Peter Jacobsen. Benchmarking
healthcare logistics processes – a comparative case study of danish and us
hospitals. Total Quality Management & Business Excellence, 30(1-2):108–
134, 2019.
109
[20] J. M. Maestre, D. Muñoz de la Peña, and E. F. Camacho. Distributed MPC:
a supply chain case study. In Proceedings of Conference on Decision and
Control. Accepted for publication, 2009.
[22] Walid W. Nasr and Ibrahim J. Elshar. Continuous inventory control with
stochastic and non-stationary markovian demand. European Journal of Ope-
rational Research, 270(1):198 – 217, 2018.
[25] Edgar Perea-López, B.Erik Ydstie, and Ignacio E. Grossmann. A model pre-
dictive control strategy for supply chain optimization. Computers Chemical
Engineering, 27(8):1201 – 1218, 2003.
110
[30] Ray P.K. Saha E. An overview of impact of healthcare inventory management
systems on entrepreneurship. In Entrepreneurship in Technology for ASEAN.
Managing the Asian Century. Springer, Singapore, 2017.
[33] C. Stoica, M.R. Arahal, D.E. Rivera, and D. Rodríguez-Ayerbe, P.and Du-
mur. Application of robustified model predictive control to a production-
inventory system. In Proceedings of the 48th Conferece on Cecision and
Control (CDC), 2009.
[36] Gang Wang, Angappa Gunasekaran, Eric W.T. Ngai, and Thanos Papado-
poulos. Big data analytics in logistics and supply chain management: Certain
investigations for research and applications. International Journal of Pro-
duction Economics, 176:98 – 110, 2016.
[38] Wenlin Wang, Daniel E. Rivera, and Karl G. Kempf. A novel model pre-
dictive control algorithm for supply chain management in semiconductor
manufacturing. In Proc. of the American Control Conference, 2005.
111
[39] P. Wanke. Tendencias de la gestión de stocks en las organizaciones de salud.
Revista Tecnologística, 109:74 – 80, 2004.
[40] Ray Y. Zhong, Stephen T. Newman, George Q. Huang, and Shulin Lan. Big
data for supply chain management in the service and manufacturing sectors:
Challenges, opportunities, and future perspectives. Computers & Industrial
Engineering, 101:572 – 591, 2016.
112