Simultaneous perturbation stochastic approximation to optimize drug management in hospital systems