0% encontró este documento útil (0 votos)
148 vistas119 páginas

Universidad de Sevilla: Programa de Doctorado en Farmacia

Este documento presenta una tesis doctoral sobre la optimización de la gestión de stocks en farmacia hospitalaria. Describe los retos de la gestión de inventarios en este contexto como la impredecibilidad de la demanda y la dependencia de proveedores. También explica los métodos utilizados como técnicas de previsión de demanda y gestión de inventarios, así como las publicaciones relacionadas con la investigación.

Cargado por

Antonio Rojas
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
0% encontró este documento útil (0 votos)
148 vistas119 páginas

Universidad de Sevilla: Programa de Doctorado en Farmacia

Este documento presenta una tesis doctoral sobre la optimización de la gestión de stocks en farmacia hospitalaria. Describe los retos de la gestión de inventarios en este contexto como la impredecibilidad de la demanda y la dependencia de proveedores. También explica los métodos utilizados como técnicas de previsión de demanda y gestión de inventarios, así como las publicaciones relacionadas con la investigación.

Cargado por

Antonio Rojas
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd

UNIVERSIDAD DE SEVILLA

FACULTAD DE FARMACIA

Programa de Doctorado en Farmacia

Línea de Investigación de
Tecnología Farmacéutica y Ciencias del Medicamento

Tesis Doctoral

OPTIMIZACIÓN DE LA GESTIÓN DEL STOCK EN FARMACIA


HOSPITALARIA

STOCK MANAGEMENT OPTIMIZATION IN HOSPITAL PHARMACY

Autor:
María Isabel Fernández García

Directores:
Marta Casas Delgado
José María Maestre Torreblanca

CURSO ACADÉMICO 2020/2021


Agradecimientos

Me gustaría agradecer y recordar a todas aquellas personas que me han ayu-


dado en mi andadura y que han hecho posible este momento.
Comienzo con un especial agradecimiento a mis padres, por su incondicional
apoyo en todo momento y por darme la oportunidad de haber llegado aquí. Agra-
dezco igualmente a mi pareja su paciencia infinita y su más absoluto apoyo en
los momentos más complicados.
Aprovecho para dar las gracias a mis directores, por creer en mí y por su
disponibilidad, tiempo y dedicación plena. Y no me olvido de todos aquellos que
me han acompañado de la mano todo este tiempo, desde amigos a colaboradores.
Sin el apoyo de todos y cada uno de vosotros nada de esto hubiese sido posible,
por lo que os estoy enormemente agradecida.
¡Muchas gracias a todos!

Sevilla, a 15 de diciembre de 2020


María Isabel Fernández García
Índice general

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

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

2. APLICACIÓN DE CONTROL PREDICTIVO ECONÓMICO A


GESTIÓN DE INVENTARIOS EN HOSPITALES 18

3. SISTEMA PREDICTIVO DE SOPORTE A LA DECISIÓN BA-


SADO EN DATOS PARA LA GESTIÓN DE INVENTARIOS
EN HOSPITALES 29

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

5. APLICACIÓN DE TÉCNICAS DE CONTROL PREDICTIVO


A LA GESTIÓN DE STOCKS EN FARMACIA HOSPITALA-
RIA 44

6. INNOVACIÓN PARA OPTIMIZACIÓN DE GESTIÓN 47

7. GESTIÓN y RIESGO DE ROTURA DE STOCK 50

OTRAS PUBLICACIONES DE LA DOCTORANDA RELACIO-


NADAS CON LA TESIS DOCTORAL 52

ARTÍCULOS DE REVISTA 53

8. GESTIÓN DE INVENTARIOS EN HOSPITALES USANDO


CONTROL PREDICTIVO CON RESTRICCIONES DE PRO-
BABILIDAD 54

ARTÍCULOS DE CONGRESO 63

9. APLICACIÓN DE CONTROL PREDICTIVO ROBUSTO EN


GESTIÓN DE INVENTARIOS DE FARMACIA HOSPITALA-
RIA 64

10.OPTIMIZACIÓN DE LA DEMANDA EN FARMACIA HOS-


PITALARIA 72

11.UNA APLICACIÓN DE CONTROL PREDICTVO CON RES-


TRICCIONES DE PROBABILIDAD A GESTIÓN DE INVEN-
TARIOS EN FARMACIA HOSPITALARIA 80

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.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

1
1.1. Gestión de Inventarios en Farmacia Hospitalaria

La Farmacia Hospitalaria se encarga de la adquisición, control, selección, pre-


paración, dispensación e información de medicamentos y productos sanitarios,
entre otras actividades orientadas al uso seguro y efectivo de los mismos, en los
pacientes atendidos en el centro y en su ámbito de influencia. El carácter urgente
de muchos medicamentos y el hecho de facilitar el acto único en las dispensaciones
a pacientes externos que acuden a consulta hacen imprescindible la disponibilidad
de medicamentos en cantidad suficiente para atender la demanda. De hecho, la no
disponibilidad de medicamentos en cantidad adecuada podría tener consecuencias
fatales, pudiendo conducir incluso a la pérdida de vidas humanas.

1.1.1. Retos de la gestión de inventarios

Un Servicio de Farmacia de hospital lleva a cabo una importante labor de ges-


tión de stocks con el fin de satisfacer las necesidades clínicas del hospital, lo que
requiere, por un lado, abastecer a todas las unidades asistenciales como plantas
de hospitalización, quirófanos, consultas, urgencias, hospital de día, etc. y, por
otro, cubrir la dispensación a pacientes externos que retiran medicación de uso
hospitalario y de diagnóstico hospitalario sin cupón precinto, todo ello mante-
niendo los medicamentos en condiciones adecuadas de conservación y caducidad.
Además, existen diversos condicionantes que dificultan esta tarea:

Impredecibilidad de la demanda. Sólo la actividad programada y la


estacionalidad en el consumo de algunos medicamentos permiten predecir
parcialmente la actividad esperada. La programación de intervenciones, de
ingresos para administración de medicación en régimen ambulatorio y de
las dispensaciones de pacientes externos estables, sin cambios y sin revisión
próxima, permiten anticiparse a las necesidades futuras para aprovisionar
medicamentos. De la misma manera existen determinados medicamentos
cuyo comportamiento estacional puede ser aprovechado para mejorar la es-
timación de su demanda. Sin embargo, esta información no es suficiente para
planificar de forma general la adquisición de medicamentos debido a que la
actividad clínica de un centro hospitalario es dinámica y no puede progra-

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.

Dependencia de los proveedores. El mantenimiento del stock depende


siempre del abastecimiento y adecuado servicio de múltiples proveedores.
Ningún centro está exento en cualquier momento de un retraso en la entrega
o de una rotura de stock de un determinado medicamento. De hecho, cada
vez son más los desabastecimientos temporales producidos por la industria
farmacéutica a los que los Servicios de Farmacia deben hacer frente en el
día a día buscando alternativas, ya sea otro proveedor, otra presentación
de mayor o menor dosis o bien otro medicamento similar del mismo grupo
terapéutico siempre que no existan contraindicaciones. Como última opción
en estos casos se contempla también la petición de préstamo a otro hospi-
tal que disponga del medicamento en cuestión. Esta práctica puede ser útil
entre hospitales cercanos y en días laborables siempre que se pueda utilizar
algún transporte propio del centro, pero puede tener un elevado coste cuan-
do se realiza entre hospitales alejados o de distintas ciudades incluso o en
días festivos. Además, no sólo hay que contabilizar el coste de la recogida
del centro que lo cede, sino la devolución posterior al restablecimiento del
suministro.

Aversión a las roturas de stock. Por todos los motivos anteriormente


expuestos se establece un stock de seguridad, que nos permite hacer frente
a la incertidumbre introducida por estos factores y cubrir la demanda del
centro a pesar de las posibles discontinuaciones de suministro, demoras en
las entregas o fluctuaciones de la demanda. Es decir, estas variabilidades
se tratan de compensar de alguna manera con un aumento de stock medio,
y por tanto de los costes. En este punto cabe destacar que el stock de se-
guridad no garantiza completamente el abastecimiento, aunque sí minimiza
sustancialmente el número de eventos de rotura de stock que pueden surgir
ante posibles imprevistos.

Costes. En todos los centros, y sobre todo en las circunstancias actuales,

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].

Caducidades. Los medicamentos caducados suponen una pérdida económi-


ca en sí mismos por la necesidad de una nueva compra para su sustitución.
No obstante, la gestión de estos caducados también consume tiempo del per-
sonal. Esta tarea consiste en revisar el stock, retirar todo aquello caducado
o próximo a caducar y proceder a su destrucción por las vías adecuadas o a
su devolución al laboratorio con el consiguiente acondicionamiento del pa-
quete, además de dar salida informática de esas unidades. Se trata de una
actividad necesaria e imprescindible de realizar en todos los centros y que se
traduce en tiempo del personal, además del coste de envío de medicamentos
a los proveedores en su caso. Este tiempo y coste se incrementan cuando
se trata de estupefacientes, medicamentos que requieren un especial control
en su adquisición, dispensación y devolución, siendo necesario un vale oficial
para efectuar estos movimientos. Es por ello que una gestión que reduzca
las caducidades de los productos resulta más productiva y ventajosa para el
aprovechamiento de los recursos.

Restricciones de almacenamiento. Hay que tener en cuenta que el es-


pacio disponible para el almacenamiento restringe el número máximo de
unidades que pueden ser almacenadas. Aunque cada vez está más extendido
el uso de robots y sistemas automatizados de medicamentos con un apro-
vechamiento máximo del espacio, no deja de ser una limitación y es preciso
adaptar el stock al espacio disponible. Además, estos sistemas de almacena-
miento automatizados requieren una gran inversión y no todos los centros
disponen de ellos, sobre todo los centros pequeños. Por otra parte, esta ne-

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.

Recursos humanos disponibles. Por último, los recursos humanos en un


Servicio de Farmacia también son limitados. El hecho de formalizar pedidos
requiere tiempo para mecanizarlos y para recepcionarlos informáticamente
una vez servidos:

• Pedidos. Las existencias y la actividad hospitaria determinan qué medi-


camentos hay que pedir. Para ello hay que introducir los códigos en el
sistema informático, determinar las unidades a solicitar, comprobar el
proveedor y si exige importe mínimo de pedido y formalizarlo. En caso
de que requiera un importe mínimo hay que completar el pedido con
otros artículos del mismo proveedor, aumentando así el tiempo dedica-
do por cada línea introducida. En este caso, además, puede producirse
un almacenamiento excesivo de determinados medicamentos que ayu-
dan a llegar a ese mínimo imprescindible, pero que realmente no hay
necesidad de pedir. De ahí la importancia de planificar muy bien qué
se pide y cuánto en cada momento. Existen, además, casos particulares
que aumentan de forma significativa la carga de trabajo del personal en
este sentido, a saber:

◦ Especialidades extranjeras. Cada vez con más frecuencia se produ-


cen desabastecimientos de la industria farmacéutica que se prologan
en el tiempo. Los Servicios de Farmacia los resuelven solicitando es-
pecialidades extranjeras importadas cuya adquisición es aprobada
por parte del Ministerio de Sanidad y Consumo. Estas solicitudes
requieren unos trámites especiales que constan de una solicitud for-

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.

En estos casos la gestión de solicitudes y pedidos de medicamentos con-


lleva por parte del farmacéutico más tiempo aún y más trámites de lo
habitual. De ahí la importancia de una buena política de gestión que
tenga un aprovechamiento máximo de recursos.

• Recepciones. Al margen de la ejecución del pedido, la recepción informá-


tica también consume tiempo del personal al comprobarse la coherencia
del pedido recibido con lo solicitado, la coincidencia del precio en aque-
llos albaranes valorados y la mecanización del lote y caducidad en el
sistema. Tampoco puede obviarse el tiempo que implica la recepción y
el correcto almacenamiento teniendo en cuenta fechas de caducidad, por
ejemplo, o adecuando el almacén para mercancía de gran volumen como
los sueros.

• Indicencias. Inevitablemente, derivadas de los pedidos y sus recepciones


se producen incidencias como pueden ser la solicitud de un código na-
cional dado de baja o sustituido por otro, la solicitud de medicamentos
con problemas de suministro o incluso la no recepción del pedido en el
proveedor, además de discordancias de precios, de unidades recibidas

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.

Resumiendo, una buena política de stocks debe basarse en estrategias de com-


pra que, por un lado, satisfagan las necesidades clínicas y aseguren la cobertura
de la demanda con cierto grado de certeza en un determinado periodo de tiempo,
minimizando la cantidad de producto almacenado y respetando así las restric-
ciones impuestas tanto por el espacio de almacenamiento y el stock máximo
almacenable, como por los recursos económicos y humanos [41, 30].

1.1.2. Técnicas de gestión de inventarios

Como puede verse, la gestión de stocks es un problema complejo que requiere


establecer un equilibrio entre objetivos diferentes y contrapuestos como son la
necesidad de garantizar el abastecimiento y la minimización de la utilización de
los recursos económicos y humanos del hospital. Por ejemplo, si se aumenta la
frecuencia de pedidos para satisfacer la demanda y se reduce al mismo tiempo
la cantidad solicitada para no excederse en el presupuesto, se multiplica la carga
de trabajo del personal, lo que acaba siendo contraproducente. La complejidad
de este problema se ve incrementada por factores externos como retrasos en las
entregas o la variabilidad de la demanda que obligan a establecer un stock de
seguridad.
En este contexto es, por tanto, importante establecer además de una política de
stocks eficiente en la utilización de recursos en términos humanos y económicos,
que determine qué pedir, cuánto y con qué frecuencia, que tenga en cuenta todas
estas limitaciones con las que desarrollan su labor los Servicios de Farmacia de
hospital. Con ese objetivo, históricamente, los Servicios de Farmacia han utilizado
diversas técnicas y además se han propuesto en la literatura diferentes métodos de
gestión que persiguen la minimización de los costes de almacenamiento mientras
la demanda se satisface sin retrasos [23, 16, 15, 27]. Algunas de las más destacadas
se citan a continuación:

Análisis ABC. Consiste en clasificar los artículos inmovilizados según su

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.

Técnica del punto de pedido. Consiste en ejecutar un nuevo pedido


cuando el stock baje de un determinado valor x y se hará de la cantidad
restante hasta un stock máximo prefijado X. Este método hace diferentes
asunciones, como por ejemplo plazos de entrega fijos y una distribución de
la demanda tipo Gaussiana [35, 6].

Lote económico de compras. [39, 1] Consiste en repetir pedido de una


determinada cantidad siempre que el stock llegue al mínimo establecido. Se
asume en este caso que la demanda y los plazos de entrega son variables
estocásticas.

Otras políticas relacionadas que tratan de resolver estas cuestiones se en-


cuentran en obras como [5].

No obstante, la mayoría de estas estrategias de gestión tratan de simplificar


ignorando las cuestiones abordadas anteriormente y que suponen importantes li-
mitaciones en el día a día de un Servicio de Farmacia. Se han desarrollado algunas
alternativas por ejemplo en [10, 12, 7, 29]. Sin embargo, en general, estos métodos
asumen una demanda constante, sin roturas de stocks ni retrasos en el reparto, y
no tienen en cuenta todos los factores que rodean a la problemática de la gestión
de stocks. Por ello, estas simplificaciones se han mitigado a costa de aumentar los

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.

1.2. Hipótesis y Objetivos

Dadas la problemática existente y la dificultad de disponer de una buena


política de gestión de stocks por las diversas limitaciones que hemos comentado,
y teniendo en cuenta que la implementación de estrategias eficientes de gestión
puede conllevar importantes ahorros económicos [11, 14], el objetivo final de la
presente tesis doctoral es la optimización y la implantación de nuevos sistemas
que mejoren la eficiencia de la gestión en Farmacia Hospitalaria.
Hoy en día, el uso de las nuevas tecnologías y la creciente información disponi-
ble facilitan el uso de técnicas más sofisticadas para abordar estas cuestiones que
limitan la gestión de stocks [19, 4, 22, 2, 21, 36, 40, 17, 9]. Concretamente, este
proyecto propone el desarrollo y aplicación de técnicas avanzadas de predicción
y control orientadas a la problemática que rodea a la gestión de stocks en un
Servicio de Farmacia.
Partiendo de la hipótesis de que los históricos de datos almacenados contienen
información relevante para caracterizar la demanda de cada uno de los medica-
mentos y la política de pedidos, los objetivos de este trabajo son los siguientes:

1. Obtener métodos fiable de previsión de la demanda de medicamentos que


facilite la planificación y la gestión de stocks.

2. Automatizar en la medida de lo posible la realización de los pedidos mediante


la creación de un sistema de soporte al farmacéutico que aprenda de los datos
históricos y de los nuevos datos generados de la actividad diaria.

3. Validar las políticas propuestas tanto en simulación como en el propio hos-


pital.

9
1.3. Métodos

Los métodos empleados en esta tesis doctoral pueden diferenciarse también en


función de los objetivos anteriormente indicados.

1.3.1. Métodos para la previsión de la demanda

La demanda juega un papel esencial y es desconocida a priori por el Servicio


de Farmacia. En esta tesis doctoral se estudian nuevos sistemas de estimación
de la demanda de manera que se pueda disminuir su incertidumbre. Partiendo
de la información de históricos reales de un hospital (datos de consumos, roturas
de stock, dispensaciones, pedidos, stocks…), se establecen las correlaciones corres-
pondientes con el consumo esperado de medicamentos. Más aún, algunos de los
métodos de gestión empleados se alimentan directamente de estos datos históricos
y los utilizan como escenarios para la toma de decisiones. Una correcta estimación
de la demanda reduce la incertidumbre en las necesidades de salidas de almacén
que se van a producir en un periodo de tiempo, con lo que permite anticipar el
consumo futuro, pudiendo disminuir el stock de seguridad con la consiguiente re-
ducción de stock medio, redundando en un menor stock inmovilizado, una menor
necesidad de almacenamiento y, en definitiva, en un ahorro económico.

1.3.2. Métodos para la gestión de inventarios

La mejora en la estimación de la demanda se utilizará para hacer previsiones


y se aplicará al estudio de nuevas políticas de gestión en Farmacia Hospitalaria y
su validación real en un hospital. Se pretende diseñar un sistema de optimización
de la gestión mediante la evolución de los niveles de stock basada en los históricos
comentados y así implementar un sistema de soporte a la decisión para la ges-
tión. En este sentido y, a diferencia de los métodos clásicos de gestión, el sistema
desarrollado no realizará ningún tipo de hipótesis simplificadora sobre la distri-
bución de la demanda sino que lleva a cabo los cálculos directamente con datos.
Concretamente se llevarán a cabo simulaciones para evaluar diferentes métodos
de Control Predictivo Basado en Modelo1 aplicados al control de los niveles de
1 Es habitual referirse a esta metodología como MPC, como acrónimo del inglés Model Predictive Control.

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.

1.4. Publicaciones relacionadas con la tesis doctoral

A continuación, se comentan de forma cronológica las diferentes publicacio-


nes obtenidas a lo largo de esto años y que de alguna manera han conducido a
la elaboración de la presente tesis doctoral. Cabe destacar que la doctoranda es
coautora de todos los trabajos que se enumeran y que su rol dentro de los mismos
ha ido ganando protagonismo con los años. En este sentido, las primeras publi-
caciones se corresponden con colaboraciones académicas entre la Universidad de
Sevilla y el hospital Reina Sofía, donde ocupaba una plaza en formación de Es-
pecialista de Farmacia Hospitalaria. Es a partir de la participación junto con la
Escuela Técnica Superior de Ingenieros de la Universidad de Sevilla en el proyecto
Pharmacontrol, financiado por la Junta de Andalucía y en el que la doctoranda
participa como responsable del Servicio de Farmacia del Hospital San Juan de
Dios de Córdoba, cuando se entiende que la aplicación de métodos avanzados de
gestión de inventarios y previsión de la demanda supone una oportunidad de gran
interés científico e industrial, motivo por el cual se inscribe en el Programa de
Doctorado de Farmacia de la Universidad de Sevilla con el objetivo de realizar
una tesis doctoral en esta temática. Por tanto, el peso específico de la docto-
randa y su contribución son mayores en los artículos obtenidos en esta última
etapa. Por todo ello, es posible clasificar las publicaciones en dos grandes grupos,
a saber, aquellas que preceden a esta tesis doctoral y aquellas contribuciones que
conforman la contribución científica propiamente dicha de la tesis.

1.4.1. Publicaciones anteriores a la tesis doctoral

Sin más preámbulos se procede a la enumeración de publicaciones de la doc-


toranda que preceden a la tesis doctoral:

1. El primer trabajo en el que se aplicaron técnicas de MPC a la gestión de


stock en Farmacia Hospitalaria fue desarrollado en una comunicación oral

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.

2. Dados los prometedores resultados obtenidos en la comunicación anterior-


mente comentada, se continuó ampliando la investigación. En primer lugar,
se estudian 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. 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 actividad 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 conforme a diferentes re-
glas utilizadas por los Servicios de Farmacia y se comparan con el método
propuesto.

3. Se estudia también la minimización del riesgo de rotura de stock mediante


diferentes métodos 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
particular, se aplica el MPC en simulación con datos reales de un hospital
desde una perspectiva de minimización del riesgo. 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

13
de decisión.

4. En el artículo para el congreso Emerging Technology and Factory Auto-


mation 2014, titulado “Optimizacion of the demand estimation in hospital
pharmacy” se analizan y comparan diferentes métodos de estimación de la
demanda, incluyendo el método habitual usado en los hospitales.

5. Esta mejora en la estimación de la demanda permite a continuación estu-


diar nuevas técnicas de optimización de stock. Específicamente se evalúan y
comparan 3 técnicas de gestión diferentes basadas en MPC en un trabajo
presentado en el congreso Emerging Technology and Factory Automation
2014, titulado “Application of robust model predictive control to inventory
management in hospitalary pharmacy”.

6. En la comunicación para el congreso Conference on Decision and Control


2014, titulada “An application of chance-constrained model predictive con-
trol to inventory management in hospitalary pharmacy” se aplican restric-
ciones probabilísticas al problema de la gestión de stocks.

1.4.2. Publicaciones que conforman la tesis doctoral

A continuación se enumeran las publicaciones de la doctoranda que sustentan


la tesis doctoral:

1. En “Stock Management in hospital pharmacy using chance-constrained model


predictive control” (Computers in Biology and Medicine 2016), se realiza una
extensión de los artículos de congreso de CDC 2014 y ETFA 2014. Se propone
una estrategia consistente en la aplicación de restricciones probabilísticas
para los problemas de gestión en este contexto. Esta es la primera publicación
de revista de la autora como doctoranda, siendo la quinta autora de un total
de siete.

2. En “An application of economic model predictive control to inventory mana-


gement in hospitals” (Control Engineering Practice 2018), se desarrolla un
controlador predictivo sencillo y se valida en un entorno real mediante una
prueba piloto llevada a cabo con un conjunto de medicamentos de un mismo

14
laboratorio. En esta publicación la doctoranda es segunda autora detrás de
uno de sus directores de tesis.

3. La publicación más reciente es “A data-based model predictive decision sup-


port system for inventory management in hospitals”2 (Journal of Biomedical
and Health informatics 2020), donde se presentan resultados reales de un
sistema de soporte a la toma de decisiones en farmacia hospitalaria basado
en datos. Dicho sistema proporciona al farmacéutico diversas alternativas
para que este pueda elegir la que sea más oportuna. Cabe destacar que en
esta publicación la doctoranda es la primera autora, tratándose además de
la primera revista de una de las áreas del JCR.

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

Contents lists available at ScienceDirect

Control Engineering Practice


journal homepage: www.elsevier.com/locate/conengprac

An application of economic model predictive control to inventory


management in hospitals✩
J.M. Maestre a, *, M.I. Fernández b , I. Jurado c
a
Departamento de Ingeniería de Sistemas y Automática Universidad de Sevilla, 41092 Sevilla, Spain
b
Pharmacy Department, Hospital San Juan de Dios, Córdoba, Spain
c
Departamento de Ingeniería, Universidad Loyola Andalucía. C/ Energía Solar s/n, 41014, Sevilla, Spain

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.

1. Introduction in Bertrand and Fransoo (2002). System dynamics is an appropriate


approach to study operations management. For example, Größler,
The satisfaction of the clinical needs of a hospital requires the Thun, and Milling (2008) shows how system dynamics theory can be
existence of stocked drugs and other materials. Inpatients have a need very useful to deal with operations management problems. In Mingers
for medication; doctors use gloves, masks, and tools whenever surgery and White (2010), the main systems theories and their applications have
is carried out; likewise, hospitals also provide specific medicines for been considered, including the systems approach, system dynamics,
external patients, such as those used to treat diseases like AIDS and operation research, and so on. Within the operation management area,
cancer, which are not supplied in retail pharmacies. These are just a inventory management is a common need in many businesses and
few examples of the hundreds of activities performed in a hospital. To organisations; for example, in supply chains (Cachon, 2001; Çetinkaya
a certain extent, some of these activities are foreseeable. For example, & Lee, 2000; Dong, Zhang, & Nagurney, 2004; Kouvelis, Chambers, &
many surgeries are programmed weeks in advance. Others, however,
Wang, 2006). An optimal management should reduce the average stock
are as unpredictable as accidents and heart attacks. Given the critical
levels as far as possible while minimising stockouts. It is necessary to
nature of the activities performed in a hospital, a certain amount of
establish a policy that determines when new orders have to be placed
stocked drugs and materials is necessary to avoid shortages that may
while taking into account different types of limitations; for example,
have fatal consequences. Hence, inventory management is one of the
uncertainties in demand and delivery times, economic and storage
most important activities carried out in the pharmacy department of a
constraints, and the availability of human resources to place orders,
hospital. However, due to the high prices of some of these medicines,
whose cost can scale up to hundreds or thousands of euros per unit, receive deliveries, and store goods properly, to name a few. It is needless
this activity also has a substantial impact on the hospital’s budget: to say that most stock policies ignore some of these issues for the sake of
approximately one-third of the hospital’s expenses in goods and services simplicity. Many of the tasks related to inventory management are still
are originated at the pharmacy department (Alvarez & Callejon, 1999). performed manually by staff with only a basic knowledge regarding this
In this context, operation management is essential to achieve ef- matter. For example, the reorder point is one classical approach to this
ficiency because it involves planning, organising and supervising the problem, which consists of making an order to have a fixed amount
provision of the pharmacy services. An analysis of different quan- of stocked items whenever the stock is below a certain threshold. This
titative model-based research in operation management is presented policy is closely related to fixing the amount of items to be ordered,

✩ 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

Remark 1. While the time delay in our model is assumed to be constant


for the sake of simplicity, in practice it may vary. For example, two
orders may b e placed at different moments of time and are delivered
on the same day. Some continuous time models do include aggregate
states for unfulfilled orders, although they have to average the update
rate of the stock to compensate the aggregation (Sterman, 2000). Here,
it has been preferred to keep the model as simple as possible and delays
are assumed to be constant.

2.2. Optimisation problem

The primary goals of inventory management in hospital pharmacies


are: (i) the demand has to be satisfied; (ii) stock levels must be lowered;
and (iii) the number of orders placed has to be minimised. Hence, stock
levels determine whether to place an order or not and the performance
index that we implemented has terms involving demand satisfaction,
expenses, and number of orders; that is,

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

with 𝑠𝑖 (𝑡 + 𝑘) ≥ 0, where 𝐶𝑜,𝑖 is the opportunity cost of having


drug 𝑖 in the pharmacy storage, and 𝑁 is the prediction horizon.
(2) 𝐽2 : Expenses. This term of the objective function (2) minimises ∙ Storage constraints. Individual constraints arise because each
the expenses in medicines ordered; that is, drug may have different storage requirements; for example, unit
dose drug boxes (Fig. 1), special shelves with a certain amount
𝑁𝑖

𝑁 ∑
of space available (Fig. 2), medical refrigerators (Fig. 3) and so
min 𝑝𝑖 𝛿𝑖 (𝑡 + 𝑘)𝑜𝑖 (𝑡 + 𝑘), (4)
𝛿𝑖 ,𝑜𝑖 ∀𝑖
𝑘=0 𝑖=1
on. Therefore,
where 𝑝𝑖 is the price for drug 𝑖. It is assumed that this is 𝑠𝑖 (𝑡) ∈ [S𝑖min , S𝑖max ]. (6)
independent on the number of ordered items.
(3) 𝐽3 : Orders. With the inclusion of this term in the objective Note that even though we do not consider here global or group
function, the number of orders placed is minimised. This is useful storage limits, they could be imposed if necessary.
because each request has certain associated costs. This condition
is written as Remark 2. Strictly speaking, the stock has to be positive and
∑ 𝑁𝑖
𝑁 ∑ this is the real hard constraint. In practice, it is common to set
min 𝐶𝑜𝑝,𝑖 𝛿𝑖 (𝑡 + 𝑘), (5) a greater bound S𝑖min (𝑡) for safety reasons. The role of this safety
𝛿
𝑘=0 𝑖=1 stock level is to provide a robustness margin to avoid stockouts
where 𝐶𝑜𝑝,𝑖 is the cost of ordering drug 𝑖. This involves the in the case of unexpected demands or delays in the deliveries.
salary of the pharmacist and the pharmacy assistant during the Nevertheless, violations with respect to this level may occur
minutes spent when placing the order and receiving the delivery. every now and then without consequences. Hence, there is no
Additionally, a shipping cost 𝐶𝑠ℎ,𝑖 can also be considered as part need for imposing a strict fulfillment of this constraint in the
of this parameter. resolution of the problem.

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

∙ Operational constraints. These constraints are related to the


limited capacity of the pharmacy for placing orders. This fact
limits the number of orders placed along the prediction horizon;
that is,

𝑁
𝛿𝑖 (𝑡 + 𝑘) ≤ 𝛥𝑖 , (9)
𝑘=0

where 𝛥𝑖 is the maximum number of orders of drug 𝑖 that can be


placed.

3. Model predictive control

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.

3.1. MPC setup

This section explains the strategy that we implemented. As will


Fig. 3. Medical refrigerator for cold storage. be seen, some modifications were added to make the MPC controller
simpler for the pharmacy staff so they could more easily trust the new
tool.
then an order of drug 𝑖 is placed during time 𝑡. If 𝛿𝑖 (𝑡) = 0, then Consider the system defined by
no order is placed. In case of placing an order (𝛿𝑖 (𝑡) = 1), 𝑜𝑖 (𝑡)
represents the number of items ordered. This variable is bounded 𝑠(𝑡 + 1) = 𝑠(𝑡) + 𝑜(𝑡 − 𝜏) − 𝑑(𝑡), (10)
by both a minimum and a maximum values; that is, where 𝑠(𝑡) = [𝑠1 (𝑡), … , 𝑠𝑁𝑖 (𝑡)], 𝑑(𝑡) = [𝑑1 (𝑡), … , 𝑑𝑁𝑖 (𝑡)] and 𝑜(𝑡 − 𝜏) =
𝑖 𝑖
[𝑜1 (𝑡−𝜏), … , 𝑜𝑁𝑖 (𝑡−𝜏𝑁 )], with 𝑜𝑖 (𝑡−𝜏) = 𝛿𝑖 (𝑡−𝜏)𝑢𝑖 (𝑡−𝜏), which represents
𝑜𝑖 (𝑡) ∈ [𝑂min , 𝑂max ]. (7)
the number of items of drug 𝑖 ordered. Note that system (10) aggregates
as many instances of (1) as drugs are considered.
Remark 3. When the Boolean variable 𝛿𝑖 (𝑡) is used, 𝑂min𝑖 stands The objective is the minimisation of the objective function (2),
for the minimum order size imposed by the corresponding lab. which represents the pharmacy manager goals. The daily routine of
(Distributors do not attend requests if the number of items is too the pharmacy staff involves checking stock levels to guarantee that the
small.) However, without 𝛿𝑖 (𝑡) it is necessary to introduce non- levels are high enough to satisfy the clinical needs in the next days
convex constraints for 𝑜𝑖 (𝑡) as (prediction horizon). Otherwise, an order is placed to guarantee that
𝑖 𝑖 there will be enough medicines. To capture this, we implemented the
𝑜𝑖 (𝑡) ∈ {0} ∪ [𝑂min , 𝑂max ].
next algorithm, which consists of the following steps:
Again, this is a complicating issue for the optimisation itself. In
the next section we show how this problem has been avoided in 1. At the beginning of day 𝑘, measure stock levels 𝑠(𝑘).
this work. 2. If 𝑠(𝑘) is enough to guarantee the supply for the hospital needs
for 𝑁 consecutive days with average consumption, then do not
In addition, pharmaceutical laboratories do not provide drugs order anything and wait for the next day.
unless a minimum amount of money is spent. That is translated 3. Otherwise, place an order by solving (2) subject to (6)–(10) and
into wait for the next day.
𝑁𝑖

𝑁 ∑
Note that the pharmacy staff can force the execution of Step 3 of
𝑝𝑖 𝛿𝑖 (𝑡 + 𝑘)𝑜𝑖 (𝑡 + 𝑘) ≥ 𝑂$ , (8)
𝑘=0 𝑖=1
the algorithm if necessary. Moreover, they can also override the system
and make any decision they want in case they are not comfortable with
where 𝑂$ represents the minimum amount of money to be spent
the suggestion of the controller. Likewise, it must be noticed that the
in the order to the laboratory.
algorithm is executed asynchronously due to the non-working days; for
example, no orders are placed during the weekends.
Remark 4. Another issue to take into account is that both lab-
oratories and pharmacies have non-working days (e.g., Sundays,
3.2. Implementation
holidays), which leads to

𝛿𝑖 (𝑡) = 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

Fig. 4. Evolution of stocks during the test period.

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 #

6 22.77 6.19 37 9 0 0.07 7.64 14.44 5.57 24.00 2 0 0.16 10.15


7 59.92 16.97 96 27 0 0.08 10.60 40.35 21.98 74.00 2 0 0.02 20.00
8 62.06 20.83 118 22 0 0.08 11.50 38.15 26.36 95.00 0 0 0.07 13.33
9 49.31 18.13 86 6 0 0.07 12.20 23.18 9.90 41.00 2 0 0.11 20.00
10 202.39 92.65 516 14 0 0.09 106.35 192.53 61.89 323 64 0 0.17 110.71
Sep 2nd, 2016–Jan 3rd, 2017 (Sim. MPC 𝑁𝑢 = 3) Sep 2nd, 2016–Jan 3rd, 2017 (Sim. MPC 𝑁𝑢 = 5)
1 410.22 272.29 1365 −7 1 0.41 214.71 414.92 274.48 1365 −8 1 0.41 213.82
2 156.08 53.92 269 44 0 0.35 49.31 157.58 50.31 269 64 0 0.35 48.79
3 55.38 32.76 130 −10 2 0.20 18.12 62.31 33.06 130 −10 2 0.22 16.67
4 58.61 12.83 78 38 0 0.20 10.62 63.26 19.26 98 28 0 0.21 11.18
5 8.89 4.53 18 −5 5 0.22 4.44 8.52 3.63 14 −2 4 0.22 4.44
med #

6 12.15 5.68 21 0 0 0.28 5.74 12.51 5.93 23 −3 2 0.29 5.50


7 47.73 20.18 74 4 0 0.07 10.00 80.88 11.05 104 60 0 0.16 10.00
8 43.29 26.40 95 0 0 0.11 10.00 70.02 11.13 95 49 0 0.16 10.00
9 27.82 12.96 52 −12 3 0.12 20.00 60.51 32.41 125 −12 1 0.17 20.00
10 145.98 78.01 323 9 0 0.29 58.33 139.63 79.58 323 9 0 0.28 60.87
Sep 2nd, 2016–Jan 3rd, 2017 (Sim. MPC 𝑁𝑢 = 7) Sep 2nd, 2016–Jan 3rd, 2017 (Sim. MPC 𝑁𝑢 = 9)
1 411.68 274.78 1365 −8 1 0.40 220.30 409.99 275.40 1365 −8 1 0.41 213.82
2 156.96 50.61 269 64 0 0.34 50.54 156.19 50.36 269 64 0 0.35 48.79
3 62.54 34.13 140 −10 2 0.23 15.26 59.15 34.07 140 −10 2 0.21 17.06
4 59.65 12.31 78 38 0 0.18 10.67 58.11 12.09 78.00 38 0 0.18 10.67
med #

5 8.73 3.68 16.00 −1 1 0.24 4.00 8.61 3.75 16 −1 1 0.24 4.00


6 12.05 6.42 25 −2 2 0.28 5.74 12.54 6.56 25 −2 2 0.27 5.82
7 93.27 13.50 117 67 0 0.16 10.00 86.50 9.99 107 67 0 0.15 10.00
8 82.40 10.16 106 61 0 0.16 10.00 75.63 10.92 96 51 0 0.15 10.00
9 85.28 39.56 137 −12 1 0.17 20.00 71.74 31.63 117 −12 1 0.16 20.00
10 149.82 82.70 323 −29 2 0.28 60.87 145.59 81.15 323 −29 2 0.28 60.87

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 #

5 11.02 7.51 25 0 0 0.11 6.62


6 20.22 4.66 33 9 0 0.06 6.57
7 58.83 18.37 96 27 0 0.08 9.30
the outliers are plotted individually. This allows us to compare at a 8 65.39 13.89 91 42 0 0.08 7.30
glance the results from the policy of the hospital and those of MPC. 9 57.44 14.21 73 24 0 0.07 5.88
10 154.93 67.86 276 14 0 0.08 87.50
Finally, from an economic viewpoint, the hospital was able to free
644.89 euros by lowering its average stock levels in this group of
drugs thanks to the implementation of the controller; that is, part
of the average inventory expenditures could be retrieved. Note that offers placed by the laboratories that have an meaningful effect on the
the savings derived from the stocking costs are not included in this stock; and (iii) the accuracy of the information systems in the hospital is
amount; that is, it represents average savings on items. In addition, not perfect; that is, stock levels and orders were not as controlled as in
it is estimated that the hospital would have placed 25 extra orders the experiment period. For all these reasons, we preferred to use average
to the lab during the four month period. Interestingly, these results results of a longer period for the hospital.
were obtained without stockouts, which proves that the choice of the Nevertheless, the reader may wonder how the results would look like
if the comparison were established using results obtained by the hospital
parameters of the controller (e.g., prediction and control horizon and
policy in the same period during the previous year. These additional
safety levels) was appropriate. Table 3 summarises these results and
results are presented in Table 4. In this period, the hospital placed 40
also extends the comparison to the simulated MPC with longer control
orders and had 16 stockouts, which concentrated in the first three drugs.
horizon. As can be seen, the simulated controllers provide greater
Even when the average levels of the hospital were lower for some drugs,
savings by increasing the number of orders and the number of stockouts.
the MPC policy also outperforms the hospital policy here, saving 158
Nevertheless, these results suggests that there is room for improvement
euros.
in future experiments by choosing longer horizons.

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

A Data-based Model Predictive Decision Support


System for Inventory Management in Hospitals
Isabel Fernández, Paula Chanfreut, Isabel Jurado and José Marı́a Maestre

Abstract—This paper presents experimental results from the


application of a data-based model predictive decision support addition to the classic ones such as insulin, certain cytostatics,
system to drug inventory management in the pharmacy of a and the novel monoclonal antibodies). Likewise, orders may
mid-size hospital in Spain. The underlying objective is to improve
the efficiency of their inventory policy by exploiting pharmacy suffer transport delays and weekends and other holidays of
historical data. To this end, the pharmacy staff was aided by the hospitals, labs, and distributors may impose additional
a decision support system that provided them with quantities constraints regarding order placement and delivery reception.
needed for the satisfaction of clinical needs and the risk of In short, on the one hand, clinical needs must always be
stockout in case no order is placed for different time horizons. satisfied. However, the limitations of financial resources and
With this information in mind, the pharmacy service takes the
final order decisions. The results obtained during a test period of logistical constraints require the use of acquisition strategies
four months are provided and compared with those of a previous that minimize the amount of product to be stored, assuring,
model predictive control approach, which was implemented in with a certain degree of certainty, that they respond to the
the same hospital in the past, and with the usual policy of the clinical demand for a certain period [1], [2]. Hence, the
pharmacy department. relevance of applying a good management policy that meets
Index Terms—Hospital pharmacy, Inventory management, these conflicting objectives. The implementation of efficient
Data-based decision support system stock management strategies can lead to significant economic
savings [3], [4], taking into account that up to 35% of
I. I NTRODUCTION purchases in goods and services in a hospital come from the
Pharmacy Service [5], [6].
T HE acquisition and storage of the medicines necessary to
cover the clinical activities of a hospital are some of the
primary management tasks performed by a Hospital Pharmacy
In general, stock management techniques are widely used
in different businesses and organizations in order to optimize
Service. The societal relevance of the clinical needs and the the use of resources, as the immobilized money due to the
frequent urgent requests coming from the rest of the hospital stock. With that objective, there are several common policies
services (e.g., for inpatients, consultations, operating rooms, that decide when and how to place new orders [7], [8], [9]:
day hospital, outpatients, etc.) make extremely important to (1) A classic and very used approach is that of the reorder
control the stock robustly so that stockouts are avoided, and point (s, S), which consists of placing a new order to
the satisfaction of the demand can be guaranteed. Unfortu- have S stocked items whenever the stock is below s.
nately, the high costs of many drugs –some items may cost This strategy implies that the amount of items to order
several hundred or even thousands euros per unit– generates a is almost fixed. These types of methods make different
substantial impact on the hospital budget, which is usually assumptions, e.g., constant transport delays and Gaussian
very constrained. Also, the staff working in the Pharmacy distributions for the demand [10], [11]. For example, in
Service is limited, thus bounding the number of orders that [12], an (s, S) inventory optimization problem is solved
can be placed and receptioned every day. As a result, a trade- and applied in a case study of a hospital in Turkey.
off between demand satisfaction, inventory-related costs, and (2) The inventory policy (R, S) is applied in [13] for supply
work burden must be attained, which requires to control the chains with four echelons. They consist of a manufac-
size of the orders and their frequency carefully and to avoid, as turing plant, a vendor distribution center, a retailer dis-
much as possible, expiration and unnecessary immobilization tribution center, and a retailer out-let store. This strategy
of resources. In addition, this problem also presents additional assumes that R is the review interval, and S is the order-
constraints and complicating issues. For example, it is impor- up-to-level. Also, demand and lead times are assumed to
tant to take into account the space requirements for storage, be stochastic variables in the model.
especially for those that require refrigeration, given that the A noteworthy point is that stock does not need to be locally
refrigerated storage rooms have much more restricted space controlled. Indeed, in vendor-managed inventory policies ven-
and thermolabile medicines are becoming more numerous (in dors monitor their customers’ stock, place orders and trigger
deliveries. Following this idea, some works study the supply
Isabel Fernández is with the Pharmacy Department, Hospital San Juan de chain parameters and their effect on cost savings assuming a
Dios, Córdoba, Spain, e-mail: [email protected].
Paula Chanfreut and José Marı́a Maestre are with the Departamento de deterministic demand [14].
Ingenierı́a de Sistemas y Automática, Universidad de Sevilla, Sevilla, Spain, In general, simpler management policies are based on sim-
e-mails: {pchanfreut, pepemaestre}@us.es. plifications that result in a loss of performance. For example,
Isabel Jurado is with the Departamento de Ingenierı́a, Universidad Loyola
Andalucia, Sevilla, Spain, e-mail: [email protected] since non-stationary policies increase the complexity of the
Manuscript received April –, 2020. problem, many studies consider time-varying deterministic
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 2

reviewed, and [26], [27], which provide supporting arguments


regarding the impact of data science and predictive analytics
in supply chain management. Also, a data-driven approach
that considers time-correlated and non-stationary demands is
proposed in [19]. Likewise, the abundance of data can be
directly exploited by methods such as model predictive control
(MPC), which optimizes the sequence of future actions and
states of a system along a given horizon while explicitly
considering constraints on system variables and the uncertainty
in exogenous inputs as the demand. An application of data-
based stochastic MPC for this type of application can be found
for example in [28], [29], where historical data were used to
simulate a chance-constrained MPC.
The work presented in this article uses a different stochastic
MPC strategy, namely, scenario-based MPC [30], [31], so
that multiple previous realizations of the pharmacy demand
Fig. 1. Pharmacy Service at San Juan de Dios hospital in Spain. Monodose are used in the computations. In particular, stochastic MPC
area. is the core of a decision support system that presents order
placement suggestions and assesses risks. Hence, a significant
difference with other works in the literature is that the con-
demands, which is not realistic. Indeed, the costs of assuming troller does not implement the actions computed. Instead, it is
a stationary demand are studied in [15]. Some works that the pharmacist who chooses among the possibilities presented
deal with this problem are: [16], where an integer linear by the decision support system, which runs the data-based
programming model for inventory lot-sizing and supplier MPC policy for different horizons and risk levels. Hence, the
selection problem is presented; [17], which models the non- orders finally implemented benefit from both the scenario-
stationary and stochastic demand by means a Markovian based MPC controller and the pharmacist knowledge. In this
representation, also accounting for computation complexity regard, this work aligns with other human-in-the-loop control
and cost effectiveness of the policies; in [18], the demand methods such as [32] and, especially, [33], where operator
is non-stationary over a finite set of periods and the inventory selects actions within a set provided by the control system.
policy follows the FIFO strategy (first in, first out); a data-
The proposed data-based decision support system is actually
driven approach to model stock levels is presented in [19],
applied to the pharmacy of the hospital San Juan de Dios
which works with time-correlated and non-stationary demand;
in Córdoba, Spain. The results obtained along a four month
and [20], which develops a stochastic inventory model which
test period are assessed via simulation with a previous MPC
combines FIFO and LIFO (Last In, First Out) policies under
controller implemented in the pharmacy [34] and a perfect
a non-stationary random demand.
forecast MPC. Likewise, the comparison is complemented
Typically, model misspecifications and information losses
with the results of the actual policy followed by the hospital
derived from simplifying assumptions are mitigated by setting
when these controllers are not operating.
a safety stock to minimize stockouts at the expense of raising
average inventory levels. Likewise, the safety stock also helps Finally, this work is embedded into a project named Phar-
these methods deal with unexpected realizations of the demand macontrol, where different hospitals in Andalusia cooperate
and also with the different sampling times used for stock with the Higher Technical School of Engineering of the
management in order to achieve a feasible work burden for University of Seville to assess and implement new strategies
the staff. In particular, Pareto principle is often applied in this that improve the efficiency of Hospital Pharmacy Services.
context. As can be seen in Figure 1, the pharmacy department Before this project, the management policy used was based
deals with hundreds of different products. For this reason, mainly on the previously mentioned technique of the reorder
items are partitioned in several groups depending on their point. Nevertheless, the pharmacy staff used that only as
economic impact. In this way, the most expensive items are a reference because other factors are also considered when
more frequently ordered than the inexpensive ones, leading to placing a new order, e.g., fluctuations of the demand, the
lower and higher average inventory levels, respectively. number of patients under treatment with highly controlled
Nowadays, with the new technologies and the growing medicines, the proximity of the end of week and holidays in
amount of information available due to the pervasive presence which orders are not served, and the need of other drugs from
of computation is easier to use more sophisticated tech- the same provider to reach the minimum amount established
niques for supply chain and inventory management prob- to place an order.
lems. For example, in [21], [22], [23], [17], the inventory The remainder of the article is structured as follows: Section
management problem is formulated in a Markovian decision II presents the problem formulation. Section III explains the
process framework assuming stochastic demands. Recently, proposed methodology to improve the hospital drug inventory
data-driven approaches are also gaining relevance, as shown management policy. Section IV shows the experimental results
in [24], [25], where different techniques and algorithms are obtained. Finally, conclusions are drawn in Section V.
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 3

Fig. 2. Hospital pharmacy storage area.

II. P ROBLEM S TATEMENT


The objective is to use historical pharmacy inventory records
to support decisions regarding the size and timing of new
orders. To this end, we consider a rolling horizon approach
in which suggestions for inventory decisions are generated Fig. 3. Hospital pharmacy storage refrigerator.
considering previous realizations of the demand to predict the
stock evolution in the following days. The elements leading to
the corresponding optimization problem are introduced in the B. Pharmacy Constraints
next subsections, namely, the model describing the pharmacy In order to obtain valid results, it is necessary to take into
inventory system, its constraints, and the main goals of the account the following constraints:
pharmacy service. (i) Storage constraints. The storage space in the pharmacy
is limited as can be seen in Figure 2, very particularly R2.4.
A. Pharmacy Inventory System for cold storage drugs, which are shown in Figure 3.
The hospital pharmacy manages a set M = {1, 2, . . . , M } Thus, the stock levels should remain below admissible
of medicines (hereinafter also referred to as meds) with time- values, especially for those drugs that must be stored in
varying inventory levels due to the deliveries coming from refrigerators. Likewise, stocks are required to be either
a set P = {1, 2, . . . , P } of pharmacy distributors and the 0 or positive. These constraints are translated into a
uncertainty of the demand from the different hospital services. minimum 0 and maximum number smax i of units for each
Let si (t) ∈ Z≥0 and di (t) ∈ Z respectively be the stock drug i ∈ M, i.e.,
and demand of drug i ∈ M at day t, and oji (t − τij ) ∈ Z≥0
represent the units of drug i ordered to provider j ∈ P τij si (t) ∈ [0, smax
i ]. (4)
days ago, with τij representing the transport delay.1 Thus,
X j Note that the minimum could also be imposed by the
ri (t) = oi (t − τij ). (1) safety stock, in case it is used.
j∈P (ii) Order placement constraints. The number of units
units of drug i are received at day t, whereas ordered for each med i ∈ M can either be zero or be
X j bounded by a minimum and a maximum value, i.e.,
oi (t) = oi (t) (2)
j∈P oi (t) ∈ {0} ∪ [omin
i , omax
i ]. (5)
represents the units of drug i ordered at day t. Given the
Since this constraint set is not convex, a binary variable
demand, and the corresponding drug deliveries, the follow-
δi (t) modeling the action of order placement can be
ing discrete-time linear model can be used to represent the
introduced to deal with this issue. In this way, δi (t)oi (t)
evolution of stock of drug i
represents the number of ordered units, so that oi (t) ∈
si (t + 1) = si (t) + ri (t) − di (t), (3) [omin
i , omax
i ] iff δi (t) = 1.
Also, pharmaceutical laboratories do not provide drugs
from where it is clear that any constraint on the stock becomes
unless a minimum amount of money is spent. This
stochastic due to the uncertainty of the demand.
constraint can be posed as
1 While the stock and the orders are integers greater or equal than 0, the X j j
demand can occasionally be negative due to items returned to the pharmacy. ci oi (t) ≥ oj$ , (6)
i∈M
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 4

where oj$ represents the minimum amount of money to


be spent when placing an order to supplier j ∈ P and cji
is the unitary cost of drug i.
(iii) Non-working days. Another issue to take into account is
that labs, distributors, and pharmacies have non-working
days (e.g., Sundays, holidays), which leads to
oi (t) = 0, ∀t ∈
/ {working days} (7)
(iv) Work burden. Due to the limited staff at the pharmacy,
a constraint has to be imposed on the orders that can
be daily handled, which also limits the corresponding
deliveries, leading to
X
δi (t) ≤ δmax . (8) Fig. 4. Steps and components of the proposed DB-MPDSS: 1) at the
i∈M beginning of day t, the pharmacist observes the stock levels of each med;
2) this information is introduced into the MPDSS, together with the desired
value(s) for n (from 2 to 8 in the performed test); 3) the DB-MPDSS processes
the data and provides the pharmacist with Table I and the orders for each
C. Goals of the Hospital Pharmacy Service case considered; 4) the pharmacist evaluates this information and places the
corresponding orders; 5) meds arrive to the pharmacy after the corresponding
Given the critical nature of the application we deal with, transport delay.
the primary concern is to ensure that the required meds
are available at all times to the patients. Nevertheless, a
further objective is to increase inventory efficiency by reducing
ordering and holding inventory expenses, i.e., lowering the used to simplify the management problem. For example, one
number of orders placed and stock levels. From an MPC could separate the problem in item’s sub-problems, solve them
viewpoint, at day t, the pharmacy managers deal with the in a decentralized fashion, and check afterwards if binding
following optimization problem constraints are violated. In any case, the role of the pharmacist
is essential to check and guarantee the feasibility of the
Pp −1 P
t+N
implemented solution.
min i∈M αCo,i si (l + 1)
[Oi ,∆i ]i∈M l=t (9)

+βci δi (l)oi (l) + γδi (l) , III. DATA - BASED D ECISION S UPPORT S YSTEM
where α, β and γ weight respectively the stage inventory costs, In this section, we describe a data-based model predictive
the acquisition of new drugs to replenish the stock levels and decision support system (hereafter, DB-MPDSS) that we have
the effort of the pharmacy service derived from the order implemented in a real hospital. In particular, this DB-MPDSS
placement and deliveries. Here, Np represents the prediction exploits historical records of the drugs and provides useful
horizon for the planning, Co,i can be interpreted as a cost of results to set the size and timing of the orders according
opportunity or inventory cost, ci represents the average cost to the quantities of units in stock. Also, it learns daily
of drug i, Oi = [oi (t), oi (t + 1), . . . , oi (t + Np − 1)] is the as new data become available in the database. In a broad
sequence of orders for drug i for the current and the next sense, it can be considered from the viewpoint of human-
Np − 1 days, and ∆i = [δi (t), δi (t + 1), . . . , δi (t + Np − 1)] is in-the-loop applications (HIL) within the context of cyber-
defined analogously for the order placement binary variable. physical systems, because humans make the final decisions,
The optimization problem (9) has to be solved every day t interact with a real-world process, and provide information
subject to the model equations (1) to (3), and the constraints to the MPDSS. Figure 4 illustrates the structure of the HIL-
(4) to (8). The first component of the optimal sequence Oi MPDSS tested in this paper. Four main interacting components
represent the units of drug i to be ordered on day t, while constitute it: the pharmacist, i.e., the person responsible for the
the rest of the sequence is discarded. This planning has to be pharmacy storage; the meds suppliers; the hospital pharmacy;
repeated every day t in a receding horizon fashion. and the MPDSS, which exploits recorded data to help the
As can be seen, the optimization problem merges dif- human decision-making process.
ferent objectives into a single performance index so as to Hereon, we adopt the following notation: D is the database
obtain a trade-off between the goals considered. The problem containing the historical of demanded and ordered quantities
presents several challenging issues, e.g., the bilinear term for all i ∈ M, and T = {1, 2, . . . , t − 1} is the set of days
δi (t)oi (t), the binary nature of δi (t), the uncertainty derived for which there exist data in D, i.e.,
from the stochasticity of the demand, binding constraints D = {di (t̂), oi (t̂)}∀i∈M,t̂∈T . (10)
(equations (2), (6), and (8)), and also the size of the problem,
for hospitals may work with more than one thousand different Although not explicitly specified, through this paper all prob-
drugs. A general strategy to solve this type of problem might abilities calculations will be based on the data provided by D.
be based in the use of branch-and-bound methods, but it is not Each day t, the pharmacist provides the DSS with the
surprising that simplifications are performed and heuristics are currently on-hand quantities of each of the meds under study,
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 5

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

TABLE II TABLE III


A DDITIONAL UNITS OF EACH DRUG NEEDED TO AVOID STOCKOUT FOR 2 I NDIVIDUAL AND JOINT PROBABILITY OF STOCKOUT IN 2 TO 8 DAYS
TO 8 DAYS , AND TOTAL COST WITH ci = 1, FOR ALL i = 1, ..., 11. WITHOUT ORDERS .

Numbers of days (n) Numbers of days (n)


2 3 4 5 6 7 8 2 3 4 5 6 7 8
1 0 50 50 50 100 100 150 1 0 0.09 0.28 1.31 2.34 4.40 9.75
2 0 4 8 8 12 16 16 2 0 0.09 0.65 1.59 4.12 7.77 12.93
3 0 0 0 0 0 0 4 3 0 0 0 0 0 0 0.09
4 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0

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

and the simulation results with the model predictive control


(MPC) technique described in [34].
In the simulations shown here, the MPC controller, based
on the daily stock data and taking into account the mean
demands. Accordingly, the joint probability of preventing any demand of the same database, optimizes the number of items
stockout decreases with the number of days. In particular, to be ordered by minimizing the objective function (9) with
the values given in Tables II and III correspond to a day α = β = 1 and γ = 0 subject to the constraint set (4)-
of the test period in which the stock levels of the drugs (8). In particular, we have used Np = 20 for the horizon.
where respectively 80, 10, 24, 12, 33, 495, 119, 114, 80, 59 and Also, we have considered a control horizon Nc = 2, i.e.,
52 units. The reason for setting the minimum period to 2 days the MPC controller decides whether drugs should be ordered
is the laboratory transport delay, i.e., all drugs ordered on the the current or the following day. The rest of alternatives are
day t arrive on the day t + 2 in the worst case. not considered for simplicity. Note that this decision does not
Such tabular data were calculated by the DB-MPDSS and affect the performance of the controller when new items are
provided to the pharmacy staff, who made the final deci- to be ordered in the current day.
sions taking into account all the constraints of the problem For the sake of comparison, we assume that the pharmacy
(maximum storable stock, minimum order at provider, etc.). service would follow faithfully the size and timing of the
During the experiment, the pharmacy service decided when to orders recommended by the controller. For a more detailed
order depending on the stockout probability they were willing comparison between the MPC simulation results and the
to assume, but the recommendations of the DSS about the performance of the DB-MPDSS proposed in this paper, Table
quantities were followed faithfully. That is, if the pharmacy IV shows the following key performance indicators (KPI) for
placed an order of drug i, then the ordered quantity was that each of the meds i:
recommended by the DSS to avoid stockout during the number
• Mean value (µi ) and standard deviation (σi ) of the items
of days considered by the pharmacy manager. Following these
in stock.
recommendations, it has been seen that it is possible to reduce
• Maximum (Mi ) and minimum (mi ) registered number of
both the number of drugs stored and the number of orders
items in stock.
without jeopardizing the satisfaction of the demand.
• Number of stockouts (SOi ) registered in the period of
study.
A. Performance Assessment • Order rate (ORi ), i.e., the number of days an order for
To assess the performance of the proposed method during drug i was placed divided by the total number of days in
the entire test period, we compare the results with the model the test period.
predictive control approach proposed in [34], which was • Average size of the orders (AOi ).
previously implemented and tested in this hospital for the same Our results show that the MPC controller would have
drugs. In particular, figures 5 and 6 show the evolution of the outperformed the DB-MPDSS results in some KPI. As shown
stock levels and the orders placed for the test period during in Table V, the average stock of the drugs was reduced with the
which the data-based decision support system was applied, MPC, saving 649.5 euros, and the number of orders was also
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 7

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]

Fig. 5. Evolution of stocks and orders during the test period.

reduced, being 31 days with this technique, compared to 34


with the DB-DSS2 . However, the improvement comes at a cost the risks of stockouts, and indeed, the quantities stored are
in the satisfaction of clinical demands: the MPC method ended determined to satisfy past real demands. Accordingly, the
up with four stockouts, caused by the differences between lowest values of the most expensive drugs were observed when
the real patients’ demands and the average considered for the using the MPC policy as might be expected from (9). Hence,
predictions, hence compromising the patients’ safety. the implementation of the DB-DSS improved the management
Additionally, in the period before this experiment, the in most of the KPI with respect to the usual methodology,
pharmacy was controlling these drugs without the aid of the guaranteeing the satisfaction of the demand, and also providing
MPC controller. In Table VI, we show the KPIs obtained important advantages such as the reduction of the storage
during the four months previous to the experiment for the sake space required and the workload by reducing the number of
of comparison. It can be seen that the overall average of stored orders.
items was reduced during the test period of the DB-DSS,
Finally, in order to assess the upper bound on performance
and yet the number of stockouts was 0. Also, the maximums
of MPC-based strategies, it is considered the ideal case of a
reached by the stock levels of each med were reduced or
MPC controller with perfect demand forecast and prediction
maintained around a similar value. Regarding the number of
horizon Np = 5, which leads to the same number of orders
orders, it decreased from 42 to 34 when implementing the DB-
as in the experiment, i.e., 34. In this way, it is possible to
DSS, i.e., a reduction of 19%. However, the average money
focus on the comparison of the management of stock levels.
immobilized in the pharmacy increased in 366.73 e due to
The simulation of this strategy leads to no stockouts with
a slight increase of the mean stock levels of some of the
pharmacy savings of 1346.5e. Hence, the performed test with
most expensive drugs, possibly derived from some peaks in the
the DB-MPDSS obtained savings that are slightly below the
historical demand and the imposed risk stockout events, which
half of those of the theoretical optimum. While this optimal
was 0%. In this regard, the extra expenditures aim to minimize
result is not achievable due to the unrealistic assumption of
2 The economic savings given were calculated considering the mean stocks perfect forecast, it suggests that there may be room for further
and the original unitary prices of the drugs performance enhancements with the proposed method.
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 8
med #1

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]

Fig. 6. Evolution of stocks and orders in the MPC simulation [34].

V. C ONCLUSIONS that maintains the quality of service level results in significant


savings. Moreover, our assessment with respect to a perfect
In this work, a data-based model predictive decision support
forecast MPC also indicates that there may be room for
system was developed and applied to improve the stock
improving performance, e.g., by filtering extreme past demand
management policy in the pharmacy of the hospital San Juan
peaks from the data.
de Dios, located in Córdoba, Spain.
From the viewpoint of the pharmacy staff, the new tool
developed increases their security and confidence when plac-
ing orders, making them more aware of the risks assumed.In
this regard, the risk and orders tables provided by the DB- Therefore, it can be considered that the application of
MPDSS are much richer than information given by the current data-based policies in this context is easy to implement
information system used at the hospital, allowing pharmacists and promising due to its positive impact in the pharmacy
to take better decisions. Likewise, the proposed method rein- department, reducing both stock levels and staff workload.
forces the role of the pharmacist in the inventory management This method was considered as a high-value support system
loop and its implementation is simple, i.e., it does not alter by the pharmacy service. This aid is essential in a context
the workflows in the pharmacy department, which are relevant where stock management is surrounded by a high degree
aspects to facilitate its adoption. of uncertainty. For this reason, it is expected to expand the
Also, this contribution has shown improvement with respect number of drugs controlled in this way by incorporating other
to other methods applied, namely, a simple MPC controller providers into the software. In addition, for safety, the software
and the usual policy of the pharmacy service. In particular, developed was independent of the hospital information system,
the stock levels have been lowered, and the number of orders thus requiring the pharmacy staff to enter the stock data each
has also been reduced. It must be noticed that our test was day manually. This task is tedious and, therefore, another
performed with a small subset of economically inexpensive expected improvement is to establish a direct connection with
drugs. Considering that the hospital manages more than 1300 the hospital database. In this way, it will be easier to use the
different drugs and that the unit cost of some of them is DB-MPDSS in a generalized manner with the rest of the drugs
beyond one thousand euros, any performance improvement and suppliers.
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 9

TABLE IV
KPI COMPARISON BETWEEN THE DB-DSS IMPLEMENTED IN THE EXPERIMENT AND THE OBTAINED SIMULATION RESULTS WITH THE MPC
CONTROLLER IN [34].

µi σi Mi mi SOi ORi AOi


DB MPC DB MPC DB MPC DB MPC DB MPC DB MPC DB MPC
1 174.29 320.13 91.37 117.87 453 598 26 137 0 0 0.250 0.154 59.48 125.00
2 16.07 16.68 5.56 3.61 28 28 4 8 0 0 0.162 0.154 4.68 5.33
3 22.78 16.00 2.88 0 24 16 16 16 0 0 0.009 0 8.00 0
4 11.00 5.00 2.30 0 12 5 5 5 0 0 0.009 0 6.00 0
Meds (i)

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)

no. 1, ch. Provisions and Stock Management, pp. 43–46.


5 79.81 31.10 138 3 0 0.137 22.19 [7] S. Çetinkaya and C. Lee, “Stock replenishment and shipment scheduling
6 828.31 220.95 1355 212 0 0.248 236.45 for vendor-managed inventory systems,” Management Science, vol. 46,
no. 2, pp. 217–232, 2000.
7 77.09 23.61 109 9 0 0.068 44.13 [8] J. Dong, D. Zhang, and A. Nagurney, “A supply chain network equilib-
rium model with random demands,” European Journal of Operational
8 292.08 94.35 504 124 0 0.077 144.67
Research, vol. 156, no. 1, pp. 194–212, 2004.
9 107.03 26.15 173 33 0 0.034 45.50 [9] G. Cachon, “Stock wars: Inventory competition in a two-echelon supply
chain with multiple retailers,” Operations Research, vol. 49, no. 5, pp.
10 71.53 17.27 102 40 0 0.171 13.50 658–674, 2001.
11 75.76 20.07 111 34 0 0.171 13.35 [10] S. Tayur, R. Ganeshan, and M. Magazine, Quantitative models for supply
chain management. Kluwer Academic Publisher, 1999.
[11] A. M. Brewer, K. J. Button, and D. A. Hensher, Handbook of logistics
and supply-chain management. Pergamon, 2001.
[12] G. S. B. Y. E. Sağol, Gizem and M. G. Ataman, “An (s, s) inventory
ACKNOWLEDGMENT optimization problem: A case study for a hospital,” in Analytics, Oper-
The authors would like to acknowledge Junta de Andalucı́a ations, and Strategic Decision Making in the Public Sector. IGI Global,
2019, pp. 187–206.
(Pharmacontrol Project, ref: P12-TIC-2400) and the Spanish [13] A. Andres, N. Heather, and W. M. A., “Supply chain information
Ministry of Economy and Competitiveness (C3PO Project, sharing in a vendor managed inventory partnership,” Journal of Business
ref: DPI2017-86918-R) for funding this work. Also, financial Logistics, vol. 25, no. 1, pp. 101–120, 2011.
[14] Y. Yao, P. T. Evers, and M. E. Dresner, “Supply chain integration in
support from the Spanish Training program for Academic Staff vendor-managed inventory,” Decision Support Systems, vol. 43, no. 2,
(FPU17/02653) is gratefully acknowledged. pp. 663 – 674, 2007.
JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, VOL. XX, NO. YY, APRIL 2020 10

[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:

1. Gestión con restricciones probabilísticas (GRP), donde se consideran la me-


dia y la desviación estándar de los datos históricos de la demanda para
garantizar la satisfacción de las restricciones impuestas por el Servicio de
Farmacia (por ejemplo, existencias superiores al stock de seguridad) con
una cierta probabilidad.

2. Gestión basada en múltiples escenarios (GME), en la que las decisiones de


adquisición de medicamentos se toman de forma que se garantice la satisfac-
ción de las restricciones del Servicio de Farmacia en escenarios de evolución
de la demanda basados en datos históricos. Es decir, si la demanda sigue

45
patrones de comportamiento similares a los ya registrados, las restricciones
son satisfechas.

3. Gestión basada en árboles de evolución (GAE), que es una variación del


método anterior que agrupa los escenarios más probables en un árbol de
posibilidades que se va ramificando a la vez que el comportamiento de los
escenarios de evolución de la demanda diverge significativamente.

Estas tres técnicas han sido evaluadas en simulación para la gestión de un


medicamento termolábil de alto impacto económico.
RESULTADOS
Las metodologías propuestas optimizan la gestión, garantizando el abasteci-
miento de la demanda, y proporcionando además importantes ventajas como la
disminución del espacio de almacenamiento 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 diferencia entre el caso
real y la simulación es lo suficientemente grande, tanto en el número de pedidos
realizados como en el promedio almacenado, para considerar que la aplicación de
este tipo de políticas en este contexto es prometedora.

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

Contents lists available at ScienceDirect

Computers in Biology and Medicine


journal homepage: www.elsevier.com/locate/cbm

Stock management in hospital pharmacy using chance-constrained


model predictive control$
I. Jurado a, J.M. Maestre b,n, P. Velarde b, C. Ocampo-Martinez c, I. Fernández d,
B. Isla Tejera d, J.R. del Prado e
a
Departamento de Matemáticas e Ingenieria, Universidad Loyola Andalucía, Campus Palmas Altas, C/ Energia Solar 1, Edificio G, 41014 Sevilla, Spain
b
Departamento de Ingenieria de Sistemas y Automática Universidad de Sevilla, 41092 Sevilla, Spain
c
Automatic Control Department, Universitat Politècnica de Catalunya, Institut de Robòtica i Informàtica Industrial (CSIC-UPC), Llorens i Artigas,
4-6, 08028 Barcelona, Spain
d
Pharmacy Department, Hospital San Juan de Dios, Córdoba, Spain
e
Pharmacy Department, Hospital Universitario Reina Sofía, Córdoba, Spain

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

1. Introduction the goods budget of a public hospital is spent by the pharmacy


department. In a wider sense, the limitations imposed by the
Stock management is a common problem that is present in budget are also translated into the human resources in the phar-
almost all the companies and organizations. The solution for this macy and the room available for storing drugs, which introduce
problem is given by a policy that determines how and when the additional constraints for the management. Hence, it may not be
orders should be placed. However, there are different difficulties possible to place and receive orders too often due to the lack of
associated to the problem. In the first place, there are uncertainties pharmacists. Likewise, space constraints are important for exam-
in the demand and delays in the deliveries, which make the pro- ple in drugs that must be stored in a fridge. Therefore, there is a
blem not deterministic and require a degree of conservatism to need to develop advanced cost-efficient safe policies for stock
avoid stockouts. It is needless to say that the lack of certain drugs management in hospitals capable of dealing with many different
in a hospital may endanger the life of the inpatients and, in the types of constraints.
worst case, may have catastrophic consequences in the form of In general, simple methods are used to solve inventory control
human losses. In order to avoid this situation, it is preferred to problems. A usual policy is that of reorder point ðs; SÞ, that is,
increase stock levels, but this is not always possible due to eco- whenever the stock is below the level s, an order is placed to
nomical constraints. Actually, the pharmacy is a major source of increase the stock up to the value S. Another option is to fix a size
expenses in hospitals. In [1], it is estimated that about 20–35% of for the orders, Q, and submit an order once the stock is at level s.
Other related policies about how to solve this problem are given in
☆ [2,3]. The major drawback with these techniques is that they are not
The authors would like to acknowledge Junta de Andalucía (Pharmacontrol
Project, P12-TIC-2400), for funding this work. able to take into account all the factors involved in the decision
n
Corresponding author. problem. In the literature, other alternatives are also proposed. For
E-mail addresses: [email protected] (I. Jurado), example, Bermejo et al. [4] presents an analytical model for the
[email protected] (J.M. Maestre), [email protected] (P. Velarde),
coordination of inventory and transportation in supply-chain sys-
[email protected] (C. Ocampo-Martinez),
[email protected] (I. Fernández), [email protected] (B.I. Tejera), tems. In [5], a supply chain network model consisting of manu-
[email protected] (J.R.d. Prado). facturers and retailers, where the demand is random, is developed.

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

turbances. A different but related approach is tree-based MPC [24],


where the disturbances are grouped into a rooted tree that bran-
ches as the uncertainty grows. A tree of control actions is calcu- 2.2. Single hospital optimization problem
lated to match the disturbance tree by the MPC controller. A
simpler method is multiple MPC, which is given in [25], where The system can be represented according to Fig. 1. In this figure,
control actions are calculated weighting the probability of occur- the inputs represent the elements considered by the pharmacy
rence of three possible scenarios. While all these approaches could managers to make the decisions about the order placement: the
be valid in for the problem considered in this article, they present estimated demand, information about potential risks, and the
some disadvantages with respect to CC-MPC. In the first place, constraints. The outputs are the optimal stock levels, minimum
scenario-based MPC requires a great amount of historical data to costs, and data about when and how many orders should be
provide a low risk level. Tree-based MPC also requires a amount of placed.
historical data and solves a problem with a larger number of Every time an order is placed, the following costs are involved:
250 I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255

N is the length of the time horizon in which the condition has to


be satisfied, and Ni is the number of different drugs.
2. J2: Expenses. This term deals with the minimization of the
expenses in the orders of drugs and the inventory levels, i.e.

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

Fig. 1. Pharmacy inventory as a system.

3. J3: Orders. This term seeks the minimization of the number of


 pij, which is price offered by the j-th provider for drug i. It is placed. It is necessary because placing an order involves a cer-
supposed in this paper that it does not depend on the number tain cost. Likewise, the work burden for the staff in the phar-
of items ordered. macy department is related to this term. For example, in a
 C jsh;i , which is the drug i shipping cost when requested from hospital such as Reina Sofía (Córdoba, Spain) more than twelve
provider j. thousand orders are placed during a year. Mathematically, it is
 C op;i , which is the cost of ordering drug i. formulated as
 C os;i is a cost that penalizes when the stock of drug i is below the
minimum safety level allowed. This situation is particularly X
N X
Ni X
npi
C op;i δi ðt þ kÞ:
j
min ð6Þ
dangerous since there is a high risk for the hospital of running δ
k¼0i¼1j¼1
out of drug i. In case of need, it is possible to ask another hos-
pital for a loan.
 C s;i is the cost of storage of drug i.
 C o;i is the opportunity cost of having drug i in the pharmacy Furthermore, the following constraints are considered:
storage.
 Storage constraints. As explained before, the level of the stock of
Note that both stock levels and costs are a direct consequence drug i has to be greater than a safety stock Simin to minimize the
of the orders placed. Finally, the goals of the managers are the risk of stockout. In addition, the space restrictions in the storage
following: (i) the demand has to be satisfied; (ii) the fixed assets room must also be considered, which limits the maximum
must be reduced; and (iii) the number of orders placed has to be number of drugs that can be stored in the pharmacy. Therefore,
minimized. These goals are considered in the optimization pro-
si A ½Simin ; Simax : ð7Þ
blem. In particular, the performance index considered in this work
involves a multicriteria weighted function where demand satis-
faction, expenses and number of orders are included, i.e.,  Order constraints.In order to formulate these constraints, two
type of variables are going to be used. The first one is a Boolean
min J≔β1 J 1 ðo; tÞ þ β2 J 2 ðo; tÞ þ β3 J 3 ðo; tÞ; ð2Þ
variable δi ðtÞ A ½0; 1, where the value 1 means that an order of
j
o
drug i has been placed to provider j during time t, and the value
where J1, J2 and J3 are the terms associated to demand satisfaction,
0 means that no order has been placed. In case of placing an
costs, and orders, respectively. The weights β1, β2, and β3 prioritize
order ðδi ðtÞ ¼ 1Þ, another variable that represents the ordered
j
the different terms and have a strong influence in the solution of
number of items is used. This variable should be bounded by
the problem.
both a minimum and a maximum values, i.e.
The terms in the objective function 2 are described next in
decreasing priority: oji A ½minoj ; maxoj : ð8Þ
i i

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

different nature because δi ðtÞ is a Boolean variable. The way to


j
horizon N is also limited, being max$ the maximum amount.
The constraint is expressed as proceed will be the use of an exhaustive search algorithm, which
will solve the problem as many times as possible scenarios
X
N X
Ni X
npi
depending on the value of fδi ðtÞ; …; δi ðt þ NÞg, i.e., 2npi Ni ðN þ 1Þ
j j
δji ðt þ kÞðpji oji ðt þ kÞ þ C jsh;i þ C op;i Þ r max$ Þ: ð11Þ
k¼0i¼1j¼1 times. In that way, the optimization problem can be solved with
respect to the variable oji ðtÞ.
It is straightforward to see that if δi ðt þ kÞ ¼ 0, for k A f0; 1; …; Ng;
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

Prðshi ðt þ kÞ o 0Þ can be greater. the following change of variable


The constraints are also the same, (7)–(11), and
oji ðtÞ ¼ M o~ i ðtÞ;
j
X
npi

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

whole matrix of constraints to the reduced vector o~ i ðtÞ, so it is


j
constraint is
necessary to apply the change matrix M to the matrix of con- 1
 Smin þ sðt þ 0Þ þ oðt þ 0Þ Z ϕ0 ð1  δs Þ;
straints to impose them only to the considered control
1
components.  oðt þ0Þ r  Smin þ sðt þ 0Þ  ϕ0 ð1  δs Þ:
For the next time instant along N (i.e., k ¼2), it yields
3.2. CC-MPC
Pðsðt þ 2Þ Z Smin Þ Z 1  δs
The CC-MPC method is used to deal with the stock manage- Pðsðt þ 1Þ þ oðt þ1Þ dðt þ 1Þ Z Smin Þ Z 1  δs
ment problem because the constraints under consideration must Pððsðt þ 0Þ þ oðt þ 0Þ  dðt þ 0ÞÞ þ oðt þ 1Þ dðt þ 1Þ Z Smin Þ Z1  δs
be treated in stochastic manner. The optimization problem can be Pð  dðt þ 0Þ  dðt þ 1ÞÞ Z Smin  sðt þ 0Þ  oðt þ 0Þ  oðt þ1ÞÞ Z 1  δs ;
written as in (12), but subject to Pðdðt þ 0Þ þ dðt þ 1Þ r  Smin þ sðt þ 0Þ þ oðt þ0Þ þoðt þ 1ÞÞ Z1  δs :

G i ðo; dÞ r g i ; i ¼ 1; 2; …; m; Defining ϕ1 ðÞ as the cumulative distribution function of the


o A D; variable dðt þ 0Þ þ dðt þ1Þ yields

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.

Approach Orders Stock-out Mean Desviation


References
CC-MPC 15 0 770 316
Hospital historical data 25 0 861 313
[1] T. Bermejo, B. Cuña, V. Napal, E. Valverde, The hospitalary pharmacy specialist
handbook, Span. Soc. of Hosp. Pharm. (1999) (in Spanish).
[2] S. Tayur, R. Ganeshan, M. Magazine, Quantitative Models for Supply Chain
that the orders are recomputed once a day, it is possible to cal- Management, Kluwer Academic Publisher, 1999.
culate optimal control actions for 8640 drugs a day with the cur- [3] A.M. Brewer, K.J. Button, D.A. Hensher, Handbook of Logistics and Supply-
rent configuration, many more than those used in the hospitals. Chain Management, Pergamon, 2001.
[4] S. Çetinkaya, C. Lee, Stock replenishment and shipment scheduling for vendor-
The 360-days simulation scenario considered here is shown in managed inventory systems, Manag. Sci. 46 (2) (2000) 217–232.
Figs. 2 and 3 for each drug. In blue, the evolution of the stocks [5] J. Dong, D. Zhang, A. Nagurney, A supply chain network equilibrium model
using CC-MPC is shown. In red, the real evolution of the stock with random demands, Eur. J. of Op. Res. 156 (1) (2004) 194–212.
[6] G. Cachon, Stock wars: inventory competition in a two-echelon supply chain
according to the hospital data is shown. Table 4 shows a com- with multiple retailers, Op. Res. 49 (5) (2001) 658–674.
parison of the behavior of these two drugs applying CC-MPC with [7] S. Rezapour, R. Farahani, Strategic design of competing centralized supply
the results registered by the hospitals in this period, considering chain networks for markets with deterministic demands, Adv. in Eng. Softw.
41 (5) (2010) 810–822.
the average level, standard deviation, and the number of orders. In [8] E.F. Camacho, C. Bordons, Model Predictive Control in the Process Industry,
this period the hospitals placed 9 orders for the drug 1 and 25 for Second Edition, Springer-Verlag, London, England, 2004.
the second one while the CC-MPC policy resulted in 5 and 15 [9] W. Wang, D.E. Rivera, K.G. Kempft, K.D. Smith, A model predictive control
strategy for supply chain management in semiconductor manufacturing under
orders respectively. The better timing of the CC-MPC orders and uncertainty, in: Proceedings of the 2004 American Control Conference, vol. 5,
the optimally calculated order size are the key to explain the lower Boston, MA, 2004, pp. 4577–4582.
performance of the hospital. On average, the CC-MPC strategy [10] W. Wang, D.E. Rivera, K.G. Kempf, A novel model predictive control algorithm
for supply chain management in semiconductor manufacturing, in: Proceed-
would have resulted in 39 units of drug 1 and 770 of drug 2, i.e., ings of the 2005 American Control Conference, vol. 1, Portland, Oregon, 2005,
4 stocked units less of drug 1 and 91 of drug 2 with respect to the pp. 208–213.
results registered by the hospital. Notice also that the CC-MPC [11] J.M. Maestre, D. Muñoz de la Peña, E.F. Camacho, Distributed model predictive
control based on a cooperative game, Optim. Control App. Methods 32 (2)
strategy results in a slightly greater standard deviation of the stock (2011) 153–176.
levels, i.e., the fluctuations in the number of stocked items are a bit [12] J.M. Maestre, D. Muñoz de la Peña, E.F. Camacho, T. Alamo, Distributed model
bigger with this policy. This is natural since less orders are placed predictive control based on agent negotiation, Process Control 21 (5) (2011)
685–697.
with the CC-MPC strategy. Finally, notice that no stockouts hap- [13] C. Stoica, M. Arahal, D. Rivera, D. Rodríguez-Ayerbe, P.and Dumur, Application
pened during the simulation period (Table 1) of robustified model predictive control to a production-inventory system, in:
These results clearly show that the CC-MPC policy provides Proceedings of the 48th Conferece on Decision and Control (CDC), Shangai,
2009, pp. 3993–3998.
better results than the policy that is currently implemented in the [14] H. Rasku, J. Rantala, H. Koivisto, Model Reference Control in Inventory and
hospital pharmacies. For the first drug, more than 1000 euros on Supply Chain Management, The Implementation of a More Suitable Cost
average could be used for purposes other than having stock at the Function, Springer, Netherlands (2006), p. 111–116.
[15] D. Muñoz de la Peña, A. Bemporad, T. Alamo, Stochastic programming applied
pharmacy with the same clinical results. In the case of drug 2 this to model predictive control, in: Proceedings of the 44th IEEE Conference on
amount is 27118 euros. Another noteworthy point is that the staff Decision and Control (CDC) and European Control Conference (CDC-ECC),
at the pharmacy department is freed partially from the duties Seville, Spain, 2005, pp. 1361–1366.
[16] A. Prekopa, On probabilistic constrained programming, in: Proceedings of the
related to the placement and reception of orders. In both cases the Princeton Symposium on Mathematical Programming, Princeton University
CC-MPC placed 40% less orders than the policy followed by the Press, NJ, 1970, pp. 113–138.
hospital. Finally, note that a more aggressive tuning of the con- [17] P. Kall, J. Mayer, Stochastic Linear ProgrammingSpringer, New York, NY, 2005.
[18] A. Geletu, M. Klöppel, H. Zhang, P. Li, Advances and applications of chance –
troller could be used to reduce these values at the cost of higher constrained approaches to systems optimisation under uncertainty, Int. J. Syst.
stockout risks (Table 2) Sci. 44 (7) (2013) 1209–1232.
[19] A. Schwarm, M. Nikolaou, Chance-constrained model predictive control, AIChE
J. 45 (8) (1999) 1743–1752.
[20] J. Grosso, C. Ocampo-Martinez, V. Puig, B. Joseph, Chance-constrained model
5. Conclusions predictive control for drinking water networks, J. Process Control 24 (5) (2014)
504–516.
[21] W. Langson, I. Chryssochoos, S.V. Raković, D.Q. Mayne, Robust model pre-
Stock management is one of the main tasks of the pharmacy dictive control using tubes, Automatica 40 (1) (2004) 125–133.
department of a hospital. It is a complex problem due to the [22] P.O.M. Scokaert, D.Q. Mayne, Min-max feedback model predictive control for
uncertainty in the drug demand and the variety of constraints to constrained linear systems, IEEE Trans. Autom. Control 43 (8) (1998)
1136–1142.
be considered. In this work, a control technique to deal with this [23] G. Schildbach, L. Fagiano, C. Freic, M. Morari, The scenario approach for sto-
problem has been described and assessed using real data from two chastic model predictive control with bounds on closed-loop constraint vio-
Spanish hospitals. The proposed strategy is based on MPC, which lations, Automatica 50 (12) (2014) 3009–3018.
[24] J. Maestre, L. Raso, P. van Overloop, B. De Schutter, Distributed tree-based
allows the fulfillment of the management objectives while taking model predictive control on a drainage water system, J. Hydroinform. 15 (2)
into account the different operational constraints. The use of (2013) 335–347.
chance constraints in combination with MPC makes possible to [25] P.-J. van Overloop, S. Weijs, S. Dijkstra, Multiple model predictive control on a
drainage canal syste, Control Eng. Pract. 16 (5) (2008) 531–540.
guarantee the availability of drugs for the patients with a certain [26] J.M. Grosso, J.M. Maestre, C. Ocampo-Martinez, V. Puig, On the assessment of
level of risk that is explicitly set. tree-based and chance-constrained predictive control approaches applied to
I. Jurado et al. / Computers in Biology and Medicine 72 (2016) 248–255 255

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

2014 IEEE Emerging Technology and Factory Automation (ETFA)


c 2014 IEEE
978-1-4799-4845-1/14/$31.00
illustrate the size of the problem, it is enough to consider As a consequence, it is common to set a safety stock
that the biggest hospital that participates in this work has a in order to cope with the uncertainty introduced by
total capacity of one thousand and two hundred beds for the these problems. Two possibilities arise at this point
inpatients. Besides these inpatients, the pharmacy department depending on whether a fixed or variable safety stock is
provides monthly more than five thousand drug dispensations set up. In the first case, a minimum bound is introduced
for external patients. In this hospital the expenses on drugs in the optimization problem. In the second one, the
exceed the amount of fifty millions of euros per year. safety stock becomes an optimization parameter. Any-
The paper is organized as follows. First, a description of how, this is translated into the following mathematical
the inventory management problem is shown in Section II. condition:
Section III, presents the optimization problem and the robust Ni
N X
X
techniques MPC for this problem. Section IV some simula- min Cos,i P r(si (t + k) < 0), (2)
j j
tions are shown. Finally, in Section V some conclusions are δi ,ui ∀i,j
k=0 i=1
presented. where P r(si (t + k) < 0) stands for the probability of
II. P HARMACY I NVENTORY P ROBLEM si (t+k) being negative and N is the length of the time
horizon in which the condition has to be satisfied.
In this paper we assume that the pharmacy inventory is
2) Minimize the expenses on the acquisition of drugs and
composed of Ni different drugs. The following discrete linear
the inventory levels, that is,
model will be used to represent the evolution of the stock
level of drug i: N X
X npi
Ni X

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

For example, if N = 4: In addition, considering the constraints (7) and (8).


Developing the expression (13) along the prediction hori-
uji (t)
 
zon, and assuming that the disturbances behave as a function
 uj (t + 1)  of a certain probability distribution, it is possible to calculate
uji (t) =  i
 uj (t + 2)  ,

i
or estimate the mean and standard deviation of the state
uji (t + 3) variable.
D. Multi-Scenario Approach MPC
and we are assuming these values: δij (t) = 1, δij (t + 1) =
1, δij (t + 2) = 0 and δij (t + 3) = 1. That means that the To implement the Multi-Scenario technique are not neces-
dimension of uji (t) has to be reduced in one order, so N 0 = 3 sary the probabilistic behavior of the demand, it is enough to
and know several scenarios of possible developments in demand.
The calculation of the controller will result in a robust control
 
1 0 0
 0 1 0  action to satisfy all the potential disturbances of the extended
M =  0 0 0 ,

system, as shown in (15).
0 0 1
       
s1 (t + 1) s1 (t) I d1 (t)
this matrix provides the reduced vector:  s2 (t + 1)   s2 (t)  I   d2 (t) 
       
 s3 (t + 1)   s3 (t)  I 
uji (t)  +   o(t − τ ) −  d3 (t) 
 
=
 

..   ..   ..   .. 
u’ji (t) =  uji (t + 1)  .

 .   .  .  . 
uji (t + 3) sK (t + 1) sK (t) I dK (t)
(15)
 Where K is the number of scenarios considered.
Therefore, u’ji (t) contains only the ordered items that are In this way, the objective function to be considered is given
non-zero. by (9), subject to (10) and the constraints (5)-(8), replicated
This optimization problem will be solved as many times for all states of the extended system.
as possible combinations with the values of {δij (t), ..., δij (t+
N )}. The optimal combination of {δij (t), ..., δij (t + N )} E. Tree-Based MPC
corresponds with that one that provides the minimal value This technique consists of modeling the disturbance as a
of the objective function. tree, with a number of branches obtained from an initial set
It is necessary to pay special attention to the constraints of scenarios that represent the dynamics of the disturbances.
while solving this problem. It is not possible to impose the The reduction of scenarios to a form of trees was performed
whole matrix of constraints to the reduced vector u’ji (t), so it using the GAMS software. Once reduced the scenes one
is necessary to also apply the change matrix M to the matrix proceeds to the optimization of the cost function, holds to
of constraints to impose them only to the control components the own restrictions of the problem, adding restrictions of
that we are considering. equality of her actions of control in the points of bifurcation
Orders Stock-out Mean Desviation
Chance- Constraints 13 0 291 101
Multi-scenario 16 0 148 74
Tree-Based 13 0 183 89
Hospital 26 0 394 126
of the disturbances. The system presents it in an extended TABLE I
form for the reduced number of scenarios that are considered, C OMPARISON OF THE DIFFERENT MPC TECHNIQUES APPLIED
as shown in (16).
     
s1 (t + 1) s1 (t) I 0 0 ··· 0
 s2 (t + 1)   s2 (t)  0 I 0
     ··· 0 
 s3 (t + 1)   s3 (t)  0 0 I
 = + ··· 0  o(t − τ )
 ..   ..   .. .. .. 
 .   .  . . .
sR (t + 1) sR (t)  0  0 0 ··· I
d1 (t)
 d2 (t) 
 
−  d3 (t) 
 
 .. 
 . 
dR (t)
(16)
Where R is the number of reduced scenarios from the
initial K scenarios considered. The objective function is given
by (9), subject to (10) and the constraints (5)-(8), for each
of the possible scenarios based tree.
IV. C ASE S TUDY AND R ESULTS Fig. 2. Real and simulated stock evolution and placed orders applying
Chance-Constraints MPC.
In this section, we apply the proposed robust methods
MPC described to one of the most expensives drugs that
is used in these hospitals. In addition, this drug deserves
special attention since it must be stored in a fridge, which
makes even more important to reduce its average stock level.
The real name and price of the drug will not be presented
in this paper due to confidenciality reasons.
Regarding the controller, a horizon of 8 days has been
considered. The evolution of the stock is modeled using the
discrete linear model (10). The orders of this drug have a
minimum amount of 4 units and the maximum has been set
to 1000. The price of the drug is 250 euros per unit and
each order placed implies an additional cost of 2 euros. The
deliveries of this drug usually have a delay of 2 days with
respect to the moment in which the order was placed. Finally,
the demand term of (10) is non deterministic. A probabilistic
characterization of its behavior has been calculated for this
drug based on historical data from the last seven moths. Fig. 3. Real and simulated stock evolution and placed orders applying
A 230 days simulation of the proposed approach is shown Multi-scenarios MPC.
in Figures 2, 3 and 4 . In blue, the evolution of the stock using
the techniques described above are shown. In red, the real
evolution of the stock according to the hospital data is shown. sampling time to compute a control sequence u that takes
In all cases, the stock was always positive. The characteristics the system to the desired reference. For this drug, the stock
of the results is presented in the table I. Note that, for the reference (security stock) has been set to 2.
price considered, this difference corresponds to an amount of A word of caution has to be said regarding the results at
more than 30000 euros that is invested frozen unnecesarily. this point: there may be some uncertainty associated with
Finally, it is also interesting to notice that during the studied the real data. Sometimes either the drug dispensations or the
period the hospital placed 26 orders. That is, the applied arrivals of new items are recorded later than they occurred.
methods obtained better results even with less orders. Another interesting issue regarding the real evolution is its
The optimization has to be made taking into account the big peaks, which are usually associated to orders placed
constraints given by (5-8). A problem is solved at every before holiday periods (no orders can be placed then). In any
[3] E. F. Camacho and C. Bordons. Model Predictive Control in the Process
Industry. Second Edition. Springer-Verlag, London, England, 2004.
[4] J. M. Maestre, David Muñoz de la Peña, and E. F. Camacho. Distributed
model predictive control based on a cooperative game. Optimal Control
Applications and Methods, 2010. In press.
[5] H. Rasku, J. Rantala, and H. Koivisto. Model reference control
in inventory and supply chain management. In First International
Conference on Informatics in Control, Automation and Robotics, 2004.
[6] C. Stoica, M.R. Arahal, D.E. Rivera, and D. Rodrı́guez-Ayerbe,
P.and Dumur. Application of robustified model predictive control to
a production-inventory system. In Proceedings of the 48th conferece
on decision and control, 2009.
[7] S. Tayur, R. Ganeshan, and M. Magazine. Quantitative models for
supply chain management. Kluwer Academic Publisher, 1999.
[8] K. G. Kempft W. Wang, D. E. Rivera and K. D. Smith. A model pre-
dictive control strategy for supply chain management in semiconductor
manufacturing under uncertainty. In Proceeding of the 2004 American
Control Conference, 2004.
[9] Wenlin Wang, Daniel E. Rivera, and Karl G. Kempf. A novel model
predictive control algorithm for supply chain management in semicon-
ductor manufacturing. In Proc. of the American Control Conference,
Fig. 4. Real and simulated stock evolution and placed orders applying 2005.
Tree-Based MPC.

case, the difference between the reality and the simulation


is big enough to believe that the application of this kind of
policies in this context is promising.
All optimization problems, solved for the exhaustive algo-
rithm, were computed using a linear programming (linprog
in Matlab), on a machine with an Intel Core 2 Duo CPU
with 3.33 GHz and 8 GB RAM.

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

2014 IEEE Emerging Technology and Factory Automation (ETFA)


c 2014 IEEE
978-1-4799-4845-1/14/$31.00
used for stock analysis. In Section IV some results are shown. The moving mean behavior depends on n, if the value of n
Finally, in Section V some conclusions and future work are is large, the moving mean responds slowly to effective changes;
presented. on the other hand, if the value of n is small, the response is
quicker ([8]).
II. M ETHODS FOR DEMAND ESTIMATION Exponential smoothing
In this section, different quantitative techniques are pre-
The basic idea is that it is possible to calculate a prediction
sented ([8]). They can be classified in two types:
from a previous mean, the most recent demand and a smooth-
• Temporal series. ness constant α.
• Causal models. The expression for the estimation for the period n + 1 is:

These quantitative techniques are described in the subsequent


sections. Ŷn+1 = αYn + (1 − α)Ŷn , n ≥ 1, (3)

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.

Fig. 2. Hospital procedure

Fig. 1. ABC classification of the stock objects.

This way, in the pharmacy service of the Hospital Univer-


sitario Reina Sofı́a (Córdoba), the ABC criteria is applied to
the stock, and they select 10 drugs with high financial value
percentage and maximum utility, where it is necessary to focus
attention, surveillance and preciseness in the computations.

IV. P RACTICAL APPLICATION OF PREDICTION METHODS


In this section, the presented prediction method are going to
be applied using the historical data from the pharmacy service
of the Hospital Universitario Reina Sofı́a (Córdoba). After
that, the applied prediction methods are going to be compared
y the most appropriate for each case is going to be determined.
All these prediction methods are going to be compared also Fig. 3. Simple approach
with the procedure that the hospital is using nowadays, that is,
basing the estimation on the mean consumption in the last 12
months, independently of the drug under consideration.
To do that, all these techniques are going to be applied on
10 different drugs. The tuning parameters for each strategy are
chosen by applying an iterative method and the data historical
is equal to 28 weeks.
In order to show the behavior of the different techniques,
the results for drug 1 are presented in Fig. 2, 3, 4, 5, 6, 7 and
8.
Fig. 2 shows how the hospital procedure provides a pre-
dicted demand that adapts reasonably well the mean of the real
demand. This method in particular uses a data historical of 52
weeks.
In Fig. 3, it can be seen how the method just delay the real
demand to obtain the predicted one.
Fig. 4. Simple moving mean
Fig. 4 and 5 also adapt reasonably well the predicted
demand to the mean of the real demand.
In Fig. 6, it can be seen how the demand is not as well Fig. 7 and 8 show how that methods try to follow the real
estimated to the mean of the real demand as in the previous evolution of the demand although the mean is not estimated
figures. as well as before.
Fig. 5. Exponential smoothing Fig. 8. Multiple linear regression

TABLE I. T IMES OF OPTIMALITY FOR EACH METHOD

Prediction method Times of opt.


Hospital 5
Simple approach 0
Simple moving mean 1
Exponential smoothing 1
ARIMA 1
Simple linear regression 2
Multiple linear regression 0

In this paper, three error measurement are available: the


mean error, the mean absolute error and the typical deviation.
Taking that values into account, a methodology for comparison
is described.
Fig. 6. ARIMA This methodology represents, for each drug, a dispersion
of points. These points represent the prediction methods. For
a specific case, the mean absolute error is represented in the
x axis while the typical deviation is represented in the y axis.
This is repeated for each method.
The optimal method is the one with the closest represen-
tation to the point (0, 0).
This representation is shown in Fig. 9 for drug 1. This
figure shows that the optimal procedure for the drug 1 is the
one used by the hospital.
Table I shows how many times is optimal each prediction
method (for the 10 drugs).
As can be seen from the results, no method is optimal for
all the cases.
For the 10 drugs under study, the simple moving mean,
the exponential smoothing and the ARIMA method provide
the best estimation for 1 drug each one. The simple linear
Fig. 7. Simple linear regression regression causal model is optimal for 2 drugs. And finally,
the method used by the hospital provides the best estimation
for 5 drugs.
All of these graphics were obtained also for the remaining The reason for this result could be that the data historical
9 drugs. for the method used by the hospital is greater than the one
R EFERENCES
[1] F. Parra Guerrero, Gestión de stocks. 3rd ed. Editorial ESIC, Madrid,
2005.
[2] H. Guerrero Salas, Inventarios. Manejo y control. Editorial Starbook,
Madrid, 2010.
[3] N. Toledano Garrido, Planificación, gestión y control de la producción
II: La gestión clásica de inventarios. Universidad de Huelva, Huelva,
2006.
[4] A. Ramos, Optimización de gestión de inventarios (stocks). Universidad
Pontificia Comillas, Madrid, 2008.
[5] J.M. Maestre Torreblanca, B. Isla Tejera, M.I. Fernández Garcı́a, J.R. del
Prado Llergo, T. Álamo Cantarero, E. Fernández Camacho, Análisis y
minimización del riesgo de rotura de stock aplicado a la gestión en
farmacia hospitalaria. Farm Hosp. 2012; 36(3):130-134, 2011.
[6] E.V. Frı́as Miranda, Aplicación de las series de tiempo al pronóstico de
la demanda en la empresa de manufactura moderna. Instituto Politécnico
Nacional, México, 2006.
[7] C. Garcı́a Collado, A. Madrid Paredes, A. Jiménez Morales, M.Á. Calleja
Hernández, Mejoras en las consultas de pacientes externos tras la
implantación de un robot automático de dispensación. Farm Hosp. 2012;
36(6):525-530, 2012.
[8] A.J. Pérez Navarro, A. Medina León, P. Alonso Elizondo, N. Ramı́rez
Pérez, Métodos y técnicas para la previsión de la demanda. Universidad
de Matanzas, Cuba, 2007.
[9] I. Jiménez Cabello, Métodos de predicción de series temporales. Univer-
sidad de Sevilla, Sevilla, 2005.
[10] M.P. González Casimiro, Análisis de series temporales: modelos
ARIMA. Universidad del Paı́s Vasco, Paı́s Vasco, 2009.
[11] C. Maté, Modelos ARIMA. Universidad Pontificia Comillas, Madrid,
2010.
[12] L. Nicholson, A.J. Vakharia, S.S. Erenguc, Outsourcing inventory
management decisions in healthcare: Models and application. European
Journal of Operational Research, 154(1):271-290, 2004.
[13] R. Ramanathan, ABC inventory classification with multiple-criteria
using weighted linear optimization. Computers & Operations Research,
Fig. 9. 33(3):695-700, 2006.
[14] L.K. Duclos, Hospital Inventory Management for Emergency De-
mand. International Journal of Purchasing and Materials Management,
for all the other methods. That fact could act in favor of the 29(3):29-38, 1993.
winning method. [15] K. Danas, P. Ketikidis, A Virtual Hospital Pharmacy Inventory: An Ap-
proach to Support Unexpected Demand. Journal of Medical Marketing:
Device, Diagnostic and Pharmaceutical Marketing, 2(2):125-129, 2002.
V. C ONCLUSIONS AND FUTURE WORK
This paper has presented some techniques to predict the
demand of drugs in the pharmacy service of a hospital.
From the results, it can be concluded that there is no a
unique method that provide optimal results for the estimation
for any drug. The best thing that the hospital could do in this
situation would be a dynamical analysis of the data and to
choose the best procedure for each case.
As this paper has been a work-in-progress, there are many
lines to follow as future work. The first one would be to add
a stage of pre-processing data. Also, the data historical could
be augmented, in order to evaluate all the method in equal
conditions.
It would be very useful as well, to investigate new predic-
tion method, as neuronal networks.
Finally, the study could be extended to a larger number of
drugs.

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

j=1 min Cos,i P r(si (t + k) < 0), (2)


δij ,uji ∀i,j
k=0 i=1
where si ∈ R is the stock of drug i, oji ∈ R is the number of
ordered items to the j-th of the npi providers of the drug i, τij where P r(si (t + k) < 0) stands for the probability of
1 The
si (t+k) being negative and N is the length of the time
project Pharmacontrol has as main objective the improvement of
the stock control in hospital pharmacies, trying to reduce the stock mean horizon in which the condition has to be satisfied.
level and, therefore, achieving considerable savings for the hospitals. 2) Minimize the expenses on the acquisition of drugs and
the inventory levels, that is,
npi

N ∑
Ni ∑
min δij (t + k)(pji uij (t + k) + Csh,i
j
) ∑
N ∑ ∑
Ni n pi
j j
δi ,ui ∀i,j δij (t + k)(pji uji (t + k) + Csh,i
j
+ Cop,i )
k=0 i=1 j=1
k=0 i=1 j=1
N ∑
∑ Ni
≤ $max
+ Cs,i si (t + k).
k=0 i=1 (8)
(3)
3) Minimize the number of orders placed. The human III. O PTIMIZATION PROBLEM AND M ODEL P REDICTIVE
resources of the pharmacy department are limited. C ONTROL IN P HARMACY I NVENTORY
Thus, it is convenient to minimize the fixed costs As it was stated in Section II, the objective of the opti-
introduced every time an order is placed. This goal mization problem is threefold; the demand has to be satisfied,
is better understood when it is taken into account the fixed assets reduced and the number of orders minimized.
that, for example, in a hospital such as Reina Sofı́a The system can be represented according to Figure 1.
more than twelve thousand orders are placed during
a year. Mathematically, this condition is equivalent to
the following minimization problem:
npi

N ∑
Ni ∑
min Cop,i δij (t + k). (4)
δ
k=0 i=1 j=1

In addition, different constraints have to be taken into


account:
• Storage constraints. On one hand, the stock of drug
i has to be greater than a safety stock si,min , whose
mission is to provide an extra guarantee so that the
Fig. 1. Block System
probability of lack of inventory is reduced. On the other,
there may be room constraints that limit the maximum
number of drug samples that can be stored. Therefore, System inputs are the estimated drug demands, disturbance
and constraints. The outputs are the optimal stock levels,
minimum costs and data about when and how many orders
si ∈ [si,min , si,max ]. (5)
should be delivered. The performance index considered in
• Order constraints. The constraints on the orders re- this work involves a multicriteria weighted function where
quire the use of two different variables. The first one demand satisfaction, expenses and number of orders are
is a boolean variable that represents whether an order included. Note that these terms are defined in Section II as
of drug i has been placed to provider j during time t. goals of a pharmacy manager, i.e.,
Thus, δij (t) ∈ [0, 1]. In case of placing an order it has
to be taken into account that there is both a minimum min J, (9)
u
and a maximum number of items that can be ordered,
that is,
with J = β1 ∆(u, t) + β2 E(u, t) + β3 Θ(u, t),
uji ∈ [uji,min , uji,max ]. (6)
where ∆, E and Θ are respectively the terms associated to
• Operational constraints. The pharmacy has a limited demand satisfaction, costs and orders. Note that the outputs
capacity for placing orders and receiving shipments. For of the problem depend strongly on the weights β, prioritizing
this reason a limit has to be imposed on the number of the different terms. These parameters are chosen following
orders placed during an horizon of length N , that is, the recommendations of the hospital.
npi
At the end, the problem to solve is a deterministic one,

N ∑
with the particularity that the constraints are obtained from
δij (t + k) ≤ ∆i , (7)
probabilistic assumptions.
k=0 j=1

where ∆i is the maximum number of orders of drug i A. Model Predictive Control


that can be placed during the horizon. MPC is a control strategy based on the explicit use of
• Economical constraints. We will consider a constraint a dynamic model to predict the process output at future
on the amount of money that can be spent during time instants over a prediction horizon (N ) [3]. The set of
the horizon N , being $max the maximum amount. future control signals is calculated by optimizing a criterion
For simplicity, we will ignore the expenses due to the or objective function. The predicted outputs depend on
stocked goods. Thus, this goal can be mathematically the known past inputs and outputs values up to instant k
translated as: and on the future control signals. Only the control signal

calculated for instant k is sent to the process whilst the next where uji (t) ∈ RN +1 and u’ji (t) ∈ RN +1
, being
control signals are neglected. Some advantages that MPC

N
( )
presents over other optimization control methods include the N′ = N − 1 − δij (t + k)
relative ease of implementation, the ready extension to the k=0
multivariable case, and the natural addition of constraints in
the optimization. Note that this operation, i.e. to reduce the vector uji (t)
In this work, MPC technique has been used to solve the to u’ji (t), can be achieved by means of a simple change of
problem. Next, we examine the terms involved in expres- variable:
sion (9). The first one is related to the satisfaction of the
demand. As it has been said, the demand has a random uji (t) = M u’ji (t),

behavior. Therefore, all we can do is to minimize the prob- where M ∈ RN +1 × RN +1 .
ability of drug shortage, as it was shown in expression (2). For example, if N = 3:
 
B. MPC programming uji (t)
 j
ui (t + 1) 
In the following, we will present some considerations uji (t) = 

,

about the inventory control problem in order to ease its uji (t + 2)
implementation. Hence, the objective function will minimize uji (t + 3)
the number of orders placed and the expenses made. Con-
sider the system defined by: and we are assuming these values: δij (t) = 1, δij (t + 1) =
1, δij (t + 2) = 0 and δij (t + 3) = 1. That means that the
s(t + 1) = s(t) + o(t − τ ) − d(t), (10) dimension of uji (t) has to be reduced in one order, so N ′ = 2
and  
where s(t) = [s1 (t), ..., sNi (t)], d(t) = [d1 (t), ..., dNi (t)] 1 0 0
∑ j
npi  0 1 0 
and o(t − τ ) = δi (t − τij )uji (t − τij ) represents the total M =  0 0 0 ,

j=1
number of items ordered. As it can be seen, system (10) is 0 0 1
equivalent to (1). this matrix provides the reduced vector:
The problem to solve is the following:  
uji (t)
min J u’i (t) =  ui (t + 1)  .
j j
o
uji (t + 3)
subject to (10) and (5)-(8). In this particular problem, we

have to deal with two variables of control: a boolean variable
Therefore, u’ji (t) contains only the ordered items that are
δij (t) and uji (t), which are components of the control variable
non-zero.
o(t). Since finding these two variables together solving the
This optimization problem will be solved as many times
optimization problem is a difficult task, due to the different
as possible combinations with the values of {δij (t), ..., δij (t+
nature of them, this problem will be solved by means of
N )}, to avoid this variable in the optimization, so we will
an exhaustive search algorithm, solving the problem one
obtain the same number of values of the objective function.
time for each possible scenario depending on the value of
The optimal combination of the values of {δij (t), ..., δij (t +
{δij (t), ..., δij (t + N )}. With this algorithm, the optimization
N )} corresponds with the one that provides the minimal
problem is solved with respect to the variable uji (t).
value of the objective function.
It is straightforward to see that if δij (t + k) = 0, k ∈ It is necessary to pay special attention to the constraints
{0, 1, ..., N }, the number of ordered items oji (t + k) = 0. while solving this problem. It is not possible to impose the
Therefore, to simplify the problem, the vector of control whole matrix of constraints to the reduced vector u’ji (t), so it
variables {uji (t), ..., uji (t + N )} is reduced eliminating the is necessary to also apply the change matrix M to the matrix
null component uji (t + k), that is: of constraints to impose them only to the control components
that we are considering.
∀δij (t + k) = 0, k ∈ {0, 1, ..., N },
  C. CC-MPC
  uji (t)
uji (t)  ..  In this subsection, the way to treat the constraints stochas-
 ..    ticastically is presented. In (10), the aggregate demand d(t)
   . 
 j .   j  has associated a stochastic disturbance, due to the uncer-
 u (t + k)   ui (t + k − 1) 
 i  →  j , tain nature of d(t). As the state is influenced by additive
   ui (t + k + 1) 
 ..    uncertainties d(t), the constraints can not be represented
.  .. 
 .  in a deterministic way. Therefore they are rewritten in a
uji (t + N )
| {z } uji (t + N ) probabilistic manner, e.g.:
uji (t)
| {z }
u’ji (t) P (s(t + k) ≥ smin ) ≥ 1 − δs , ∀k ∈ {1, .., N },
where δs is the probability of failure, so it is the risk bound of
    
stockout. Developing the last expression along the prediction 1 0 0 ··· 0 o(t + 0) 1
horizon, and assuming that the disturbances behave as a 1 1 0 ··· 0  o(t + 1)  1
    
function of a certain probability distribution, it is possible  ··· 
0   1
− 1 1 1  o(t + 2)  ≤   s(t + 0)
to calculate or estimate the mean and standard deviation  .. ..   ..   .. 
. .  .  .
of the state variable. For example, for the first instant of
the prediction horizon and assuming that the perturbations 1 1 ··· 1 o(t + N − 1) 1
 
behave as a normal distribution with mean µ and standard 1 1 √1
1 2  
deviation σ, i.e., d(t) = N (µ, σ), we get:  √2  −smin
 3
+ 1 3  µ .
P (s(t + 0) + o(t + 0) − d(t + 0) ≥ smin ) ≥ 1 − δs ,  .. .. ..  φ−1 (δ )σ
. .  s
√.
which can be normalized as follows: 1 N N
IV. C ASE S TUDY AND R ESULTS
[ ]
P s(t+1)−s(t+0)−o(t+0)−µ ≥ smin −s(t+0)−o(t+0)−µ In this section, we apply the proposed CC-MPC2 to one
σ σ
of the most expensive drugs that is used in these hospitals.
≥ 1 − δs In addition, this drug deserves special attention since it must
be stored in a fridge, which makes even more important to
[ ] reduce its average stock level. The real name and price of the
smin −s(t+0)−o(t+0)−µ
P s(t+1)−s(t+0)−o(t+0)−µ
σ ≤ σ drug will not be presented in this paper due to confidentiality
≤ δs reasons.
Regarding the controller, a horizon of 8 days has been
( smin − s(t + 0) − o(t + 0) − µ ) considered. The evolution of the stock is modeled using the
φ ≤ δs
σ discrete linear model (10). The orders of this drug have a
minimum amount of 4 units and the maximum has been set
smin − s(t + 0) − o(t + 0) − µ to 1000. The price of the drug is 250 euros per unit and
≤ φ−1 (δs ), each order placed implies an additional cost of 2 euros. The
σ
deliveries of this drug usually have a delay of 2 days with
where φ(·) is the probability distribution function. This respect to the moment in which the order was placed. Finally,
allows us to write a constraint of the form: the demand term of (10) is non deterministic. A probabilistic
characterization of its behavior has been calculated for this
−o(t + 0) ≤ s(t + 0) − smin + φ−1 (δs )σ + µ. drug based on historical data. As a result, we have modeled
the daily demand as a normal random variable with µ = 20
Next, for the second time instant in the prediction horizon:
and standard deviation σ = 15.
P (s(t + 2) ≥ smin ) ≥ 1 − δs For simplicity, neither storage cost nor storage limits
P (s(t + 1) + o(t + 1) − d(t + 1) ≥ smin ) ≥ 1 − δs have been considered at this stage of our work. The only
P ((s(t + 0) + o(t + 0) − d(t + 0)) + o(t + 1) implemented constraint with respect to the stock is that the
−d(t + 1) ≥ smin ) ≥ 1 − δs probability of stockout event has to be lower than 0.001, i.e.,
P (s(t + 0) + o(t + 0) − d(t + 0)) + o(t + 1) we request a reliability level of 99.999 %. This choice for the
−d(t + 1) ≥ smin ) ≥ 1 − δs . reliability level is to prioritize the satisfaction of the clinic
needs.
Following the same reasoning of the previous case, we have: A 600 days simulation of the proposed approach is shown
in Figure 2. In blue, the evolution of the stock using CC-MPC
( smin − s(t + 0) − o(t + 0) − o(t + 1) − 2µ )
φ √ ≤ δs is shown. In red, the real evolution of the stock according
σ 2 to the hospital data is shown. In both cases, the stock was
always positive, but in the case of CC-MPC the average
smin − s(t + 0) − o(t + 0) − o(t + 1) − 2µ
√ ≤ φ−1 δs , level was 204 units with a standard deviation of 113, which
σ 2 outperforms the results registered by the hospital (a mean
which allows us to write the following constraint: of 451 units and a standard deviation of 229). Note that,
for the price considered, this difference corresponds to an
−o(t + 0) − o(t + 1) ≤ √
amount of more than 60000 euros that is invested frozen
s(t + 0) − smin + φ−1 δs · σ 2 + 2µ. unnecessarily. Finally, it is also interesting to notice that
during the studied period the hospital placed 58 orders while
In general, for a prediction horizon N , we have the fol-
2 The problem could be solved also using Mixed Integer Techniques but
lowing constraint that has to be included in the optimization
it would imply a much higher computational cost. One of the advantages
problem behind the design of the MPC to implement the of CC-MPC is that the computational cost is the same than the one for a
chance constraints: classic MPC.
1400
CCMPC
the MPC framework is particularly useful because of its
1200 Hospital favorable properties, such as ease of constraint-handling.
1000
Finally, it is worthwhile to mention that the proposed
800
technique may provide important economical savings based
Stock

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:

Las series temporales son modelos de predicción basados en datos históricos


de una variable que son analizados para descubrir patrones como tendencias,
ciclos o estacionalidad, que son proyectados hacia el futuro. Estas técnicas
son útiles para predecir a medio y corto plazo [18].

• Enfoque simple (simple approach): se asume que el valor de la variable


no cambia de un periodo a otro y que el proceso cambia muy lentamente.
Además es un método impreciso, no considera variaciones por estaciones
o ciclos y sobreestima las variaciones aleatorias. Sin embargo es la técnica
con la mejor tasa coste-eficiencia [26]. Es recomendable como punto de
partida hacia otros métodos más sofisticados.

• Promedio móvil simple: es la media del periodo de tiempo más corto.


Este método utiliza los datos más relevantes de los últimos n periodos
y la actualización entre periodos, eliminando la primera observación y
agregando la última. Otra ventaja es que los cálculos son muy simples y
el sistema es flexible, considerando que la tendencia no se ajusta a una
función matemática particular. La media móvil depende de n, si el valor
de n es grande la media móvil responderá lentamente a cambios y si es
pequeño la respuesta es más rápida (Pérez 2007).

• Suavizado o alisado exponencial: la idea básica de esta técnica es pre-


decir partiendo de la media, la demanda más reciente y una constante
de suavizado o alisado que permite disminuir la influencia de valores
muy distantes. Si la constante tiene un valor grande tienen más peso

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).

• Box-Jenkins (ARIMA): este modelo integra un modelo autorregresivo


integrado con la media móvil. Es más sofisticado que los anteriores.

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.

Estos métodos de predicción de la demanda se han aplicado en un conjunto de


10 medicamentos, todos ellos de dispensación a pacientes externos, seleccionados
por su alto valor económico. Todas las técnicas se han aplicado en los 10 medica-
mentos diferentes. Para el análisis se han utilizado los datos históricos recogidos
de salidas y entradas en un hospital durante un periodo de 20 meses (de enero
de 2012 a agosto de 2013) y la estimación se ha realizado a 28 semanas. Los
resultados se comparan también con el método habitual utilizado por el hospital,
que basa la estimación en la media del consumo de los últimos 12 meses.
Ninguno de los métodos estudiados resultó ser el más óptimo en todos los ca-
sos. El método tradicional basado en los consumos de los 12 meses proporciona
la mejor estimación en 5 de los 10 medicamentos estudiados tras un análisis de la
media y la desviación típica del error de estimación. El hecho de que este método
haya obtenido los mejores resultados puede deberse también a que el histórico de
datos usado es mayor que el utilizado para los otros métodos (52 semanas). El

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:

Gestión con restricciones probabilísticas (GRP), donde se consideran la me-


dia y la desviación estándar de los datos históricos de la demanda para
garantizar la satisfacción de las restricciones impuestas por el Servicio de
Farmacia (por ejemplo, existencias superiores al stock de seguridad) con
una cierta probabilidad.

Gestión basada en múltiples escenarios (GME), en la que las decisiones de


adquisición de medicamentos se toman de forma que garantice la satisfac-
ción de las restricciones del Servicio de Farmacia en escenarios de evolución
de la demanda basados en datos históricos. Es decir, si la demanda sigue
patrones de comportamiento similares a los ya registrados, las restricciones
son satisfechas.

Gestión basada en árboles de evolución (GAE), que es una variación del


método anterior que agrupa los escenarios más probables en un árbol de
posibilidades que se va ramificando a la vez que el comportamiento de los
escenarios de evolución de la demanda diverge significativamente.

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:

el stock medio que es indicativo del dinero inmovilizado

el stock máximo y el stock mínimo alcanzados en el periodo en estudio

95
roturas de stock

la desviación estándar que informa de las fluctuaciones del stock

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.

Número medio de artículos pedidos cuando éstos se han formalizado

Comparando con el mismo periodo del año anterior al estudio se ha reducido


considerablemente tanto el stock máximo almacenado, como el stock promedio.
Se ha liberado un total de 579 unidades, que se traduce en un ahorro económico
estimado de 644.89 euros. Esta metodología agrupa los medicamentos para efec-
tuar los pedidos, de ahí que se haya producido también una amplia reducción en
su número. Se han realizado pedidos un 12.5 % de los días frente al 31 % en el
mismo periodo del año anterior. En consecuencia la carga de trabajo del Servicio
de Farmacia también se ve disminuida.
No se ha producido ninguna rotura de stock, aunque para 2 medicamentos el
stock ha sido de cero en ciertos momentos.
En contraste con los trabajos publicados anteriormente, donde se han llevado a
cabo simulaciones para evaluar distintos métodos estocásticos de MPC al control
de los niveles de stock de medicamentos individuales como un problema simple
(por ejemplo, no se han considerado ni límites ni costes de almacenamiento), este
trabajo se ha desarrollado con un grupo de medicamentos que pertenecen todos
al mismo proveedor, lo cual es más práctico en un escenario real.
Al mismo tiempo, con idea de que el personal del Servicio de Farmacia adopte
fácilmente el método y lo introduzca en su dinámica, la estrategia se ha diseñado
como un sistema de apoyo a la decisión del farmacéutico.
Pese a estas aportaciones y a los buenos resultados obtenidos, esta metodología
también presenta sus inconvenientes. En primer lugar, es necesario disponer de
un stock actualizado siempre para que los datos introducidos en el sistema sean
reales y pueda estimar y predecir con exactitud de acuerdo al stock real. Esto a
veces no ocurre por motivos de acúmulo de trabajo, o bien no se ha cursado la
salida del medicamento o no se ha recepcionado informáticamente un pedido ya

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:

el stock medio que es indicativo del dinero inmovilizado

el stock máximo y el stock mínimo alcanzados en el periodo en estudio

roturas de stock

la desviación estándar que informa de las fluctuaciones del 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.

Número medio de artículos pedidos cuando éstos se han formalizado

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.

13.1. Estimación de la demanda

En primer lugar, se han estudiado diferentes métodos de estimación de la


demanda con objeto de disminuir su incertidumbre y con ello el stock almacenado
y el dinero inmovilizado. Ninguno de los métodos evaluados ha resultado ser el
más óptimo en todos los casos, por lo que se puede concluir que no es adecuado
utilizar un único método para todos los medicamentos y que debe establecerse de
forma individualizada para cada uno.

13.2. Aplicación de técnicas de MPC en simulación

Esta mejora en la estimación de la demanda ha permitido a continuación apli-


carla en simulación al estudio de diferentes técnicas de gestión basadas en MPC.
Estas técnicas parten de datos históricos de consumos, pedidos, roturas de stock,
etc. para predecir la evolución esperada de los niveles de stock y con ello optimi-
zar la política de gestión. Los resultados de las distintas simulaciones realizadas
con diferentes medicamentos y técnicas demuestran la optimización de la gestión
a todos los niveles garantizando el abastecimiento y proporcionando importan-
tes beneficios como la disminución del volumen inventariado, con la consiguiente
liberación de espacio y reducción del dinero inmovilizado.

13.3. Validación en entorno real

Por último se ha diseñado un sistema que ayuda a la toma de decisión de qué,


cuánto y cuándo pedir y, por tanto, automatiza en gran medida la ejecución de

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.

13.3.1. Primera prueba

En la primera prueba el sistema diseñado calcula el pedido óptimo para ese


conjunto de medicamentos de manera que garantice la cobertura de la demanda
con cierto grado de certeza (nivel de riesgo controlado) y cumpla el condicionante
del importe mínimo establecido por el laboratorio. Este método, a diferencia de
los trabajos anteriores, es más práctico y se acerca más a la actividad real de un
Servicio de Farmacia al trabajar por proveedor y no por medicamento.
Siguiendo con total fidelidad las recomendaciones del sistema, el resultado ob-
tenido fue satisfactorio en términos de roturas de stock (ninguna), reducción de
los niveles medios y máximos de stock y disminución del número de pedidos en
comparación con el mismo periodo del año anterior al estudio. Ésto puede tradu-
cirse además en ventajas a nivel económico (ahorro significativo por la reducción
de stock) y de carga de trabajo por la minimización de pedidos.
A pesar de los beneficios obtenidos, esta metodología presenta también algunas
limitaciones:

Es importante ajustar el nivel de riesgo asumido por el sistema a la como-


didad y confianza del farmacéutico. Un nivel de riesgo de rotura de stock
elevado implica minimizar excesivamente los pedidos y genera cierta tensión
y desconfianza en el personal.

Hay factores que no se pueden introducir en una ecuación y que el siste-


ma, por tanto, no puede controlar, como son vacaciones, festivos, cierres de
laboratorios por inventario o actualización en sus sistemas, necesidades es-
peciales previstas, descuentos por volumen de compra, etc. y que obligan a
considerar solicitar mayores cantidades y a no respetar las recomendaciones
del sistema.

102
13.3.2. Segunda prueba

En la segunda validación llevada a cabo en el mismo hospital y con los mismos


medicamentos se introducen ciertas mejoras en el diseño del sistema, paliando las
limitaciones comentadas.
El nuevo método permite al farmacéutico decidir si pedir o no y cuánto pedir en
función del riesgo que esté dispuesto a asumir. El sistema ofrece una información
detallada del riesgo de rotura de stock en los 8 siguientes días y recomienda la
cantidad a pedir de cada medicamento en cada caso, siendo finalmente el personal
el que, valorando esta información, toma la decisión última.
Esta metodología confiere autonomía al personal y se convierte así en una
importante herramienta de soporte y ayuda para la toma de decisión que rodea a
los pedidos, aportando mayor confianza al permitir controlar la casuística que es
imposible codificar en una ecuación y que hace imprescindible el factor humano
en este sentido.
Los resultados en este caso fueron igualmente satisfactorios en cuanto a número
de pedidos, niveles de stock y desabastecimientos, aplicándose una estrategia
mejorada con respecto a la anterior (MPC basado en múltiples escenarios).

13.4. Aportaciones

13.4.1. Mejoras en aspectos generales

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.

13.4.2. Optimización del pedido

Estos métodos permiten trabajar a nivel de proveedor y no sólo de medica-


mento, de manera que son capaces de optimizar el pedido teniendo en cuenta la
totalidad de medicamentos que pueden solicitarse al mismo laboratorio, siendo
éste uno de los elementos clave en la reducción de la tasa de pedido y como resul-
tado, de la carga de trabajo. Además de evitar excedentes de medicamentos que

103
únicamente se solicitan a veces para alcanzar un determinado importe mínimo de
pedido.

13.4.3. Confianza

A diferencia de la política clásica de gestión, la gran ventaja que aporta con-


cretamente el último método evaluado, además de la optimización de la gestión
comentada, es la confianza y seguridad que proporciona al personal. Esta meto-
dología ha demostrado ser una herramienta muy útil y fácilmente aplicable de
ayuda a la toma de decisiones de cuánto y cuándo pedir, conociendo de antemano
y explícitamente el nivel de riesgo asumido. El hecho de contar con los datos de
probabilidad de rotura de stock y con la autonomía de decisión de si pedir o
no y de cuántos días pedir, y no estar limitado a una cantidad ya establecida,
confiere mayor confianza. Proporciona mucha información útil que permite al
farmacéutico tomar mejores decisiones y no modifica la dinámica del Servicio de
Farmacia.

13.4.4. Aplicabilidad

Es un sistema de fácil adopción e integración en el día a día. Podría conside-


rarse un soporte de gran valor y una herramienta perfectamente aplicable a un
Servicio de Farmacia en el que la gestión suele estar rodeada en el día a día de un
alto grado de incertidumbre. Tratándose de un entorno hospitalario es de vital
importancia que se cubra la demanda satisfactoriamente y cualquier soporte en
este sentido que lo garantice es de gran ayuda y utilidad.

13.5. Limitaciones

13.5.1. Diseño

Por seguridad, el desarrollo del sistema fue independiente del programa de


gestión del centro. Por lo tanto, obliga a introducir manualmente los datos de
stock cada día de cada medicamento.

104
13.5.2. Stock actualizado

Otra limitación de esta metodología es que precisa disponer de un stock ac-


tualizado para que las estimaciones sean válidas y acordes a las existencias reales.
Esta condición no siempre se cumple, sobre todo en determinados momentos de
sobrecarga de trabajo.

13.6. Investigaciones futuras

13.6.1. Ampliación

Como posibles líneas futuras de investigación, se podría ampliar a otros medi-


camentos e incorporar otros proveedores al sistema. Sin embargo, el diseño actual
supone una limitación para ampliar a mayor número de artículos por el hecho de
tener que introducir manualmente los datos de stock cada de cada uno. Es fac-
tible de abordar con 10 artículos como en las pruebas realizadas, pero resultaría
demasiado tedioso con un número mayor.
Como mejora, por tanto, podría considerarse la conexión directa del sistema
con la base de datos del hospital, de forma que tomase directamente estos datos.
De esta manera sí sería realmente útil y práctico implementar este procedimiento
y utilizarlo de forma generalizada con todos los medicamentos y proveedores.

13.6.2. Cooperación con otros centros

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

[1] Guía de gestión de los servicios farmacia hospitalaria. Ministerio de Sanidad


y Consumo, 1997.

[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.

[3] T. Bermejo, B. Cuña, V. Napal, and E. Valverde. Manual del residente de


farmacia hospitalaria. Sociedad Española de Farmacia Hospitalaria, 1999.

[4] Santoni F. Vicario E. Biagi M., Carnevali L. Hospital inventory management


through markov decision processes @runtime. In Quantitative Evaluation of
Systems. QEST 2018. Lecture Notes in Computer Science. Springer, Cham,
volume 11024, 2018.

[5] A. Brewer, K. J. Button, D. A. Hensher, et al. Handbook of logistics and


supply-chain management. Pergamon Amsterdam, 2001.

[6] A. M. Brewer, K. J. Button, and D. A. Hensher. Handbook of logistics and


supply-chain management. Pergamon, 2001.

[7] G.P. Cachon. Stock wars: Inventory competition in a two-echelon supply


chain with multiple retailers. Operations Research, 49(5):658–674, 2001.

[8] E. F. Camacho and C. Bordons. Model Predictive Control in the Process


Industry. Second Edition. Springer-Verlag, London, England, 2004.

[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.

[11] S. Díaz–Maroto. Gestión de stock del material sanitario en el servicio de


farmacia del hospital general penitenciario (ii): Informatización y aplicación
de la clasificación abc al análisis de consumo. Farm Hosp., 19:165 – 168,
1995.

[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.

[15] Nuria Toledano Garrido. Planificación, gestión y control de la producción ii:


La gestión clásica de inventarios. Universidad de Huelva, Huelva, 2006.

[16] Humberto Guerrero Salas. Inventarios manejo y control. Bogotá Editorial


ECOE, 2009.

[17] Angappa Gunasekaran, Thanos Papadopoulos, Rameshwar Dubey, Sa-


muel Fosso Wamba, Stephen J. Childe, Benjamin Hazen, and Shahriar Akter.
Big data and predictive analytics for supply chain and organizational perfor-
mance. Journal of Business Research, 70:308 – 317, 2017.

[18] I. Jiménez. Métodos de predicción de series temporales. Universidad de


Sevilla, Sevilla, 2005.

[19] Anton J. Kleywegt, Vijay S. Nori, and Martin W. P. Savelsbergh. The


stochastic inventory routing problem with direct deliveries. Transportation
Science, 36(1):94–118, 2002.

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.

[21] Kizito Mubiru. Joint replenishment problem in drug inventory management


of pharmacies under stochastic demand. Brazilian Journal of Operations
Production Management, 15(2):302–310, Jun. 2018.

[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.

[23] F. Parra. Gestión de stocks. ESIC Editorial, 2005.

[24] E. Perea-Lopez, B. E. Ydstie, and I. E. Grossmann. A model predictive


control strategy for supply chain optimization. Computers & Chemical En-
gineering, 27(8-9):1201–1218, 2003.

[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.

[26] A. J. Pérez Navarro, A. Medina León, P. Alonso Elizondo, and N. Ramí-


rez Pérez. Métodos y técnicas para la previsión de la demanda. Universidad
de Matanzas, Cuba, 2007.

[27] Andrés Ramos. Optimización de gestión de inventarios (stocks). Universidad


Pontificia Comillas, Madrid, 2008.

[28] H. Rasku, J. Rantala, and H. Koivisto. Model reference control in inven-


tory and supply chain management. In First International Conference on
Informatics in Control, Automation and Robotics, 2004.

[29] S. Rezapour and R.Z. Farahani. Strategic design of competing centralized


supply chain networks for markets with deterministic demands. Advances in
Engineering Software, 41(5):810–822, 2010.

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.

[31] J. D. Schwartz and D. E. Rivera. A process control approach to tactical in-


ventory management in production-inventory systems. International Journal
of Production Economics, 125(1):111–124, 2010.

[32] J. D. Schwartz, W. Wang, and D. E. Rivera. Simulation-based optimiza-


tion of process control policies for inventory management in supply chains.
Automatica, 42(8):1311–1320, 2006.

[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.

[34] K. Subramanian, J. B. Rawlings, C. T. Maravelias, J. Flores-Cerrillo, and


L. Megan. Integration of control theory and scheduling methods for supply
chain management. Computers & Chemical Engineering, 51:4–20, 2013.

[35] S. Tayur, R. Ganeshan, and M. Magazine. Quantitative models for supply


chain management. Kluwer Academic Publisher, 1999.

[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.

[37] W. Wang, D. E. Rivera, K. G. Kempft, and K. D. Smith. A model predictive


control strategy for supply chain management in semiconductor manufactu-
ring under uncertainty. In Proceeding of the American Control Conference,
2004.

[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.

[41] T. A. Zwaida, Y. Beauregard, and K. Elarroudi. Comprehensive literatu-


re review about drug shortages in the canadian hospital’s pharmacy supply
chain. In 2019 International Conference on Engineering, Science, and In-
dustrial Applications (ICESI), pages 1–5, 2019.

[42] L. Álvarez and G. Callejón. Manual del residente de farmacia hospitalaria.


Sociedad Española de Farmacia Hospitalaria, 1:43 – 46, 1999.

112

También podría gustarte