In this work, we develop a mathematical framework to model a quantum system
whose Hamiltonian may depend on the state of changing environment, that evolves
according to a Markovian process. When the environment changes its state, the
quantum system may suffer a shock that produces an instantaneous transition
among its states. The model that we propose can be readily adapted to more
general settings.\\ To avoid collateral analytical issues, we consider the case
of quantum systems with finite dimensional state space, in which case the
observables are described by Hermitian matrices. We show how to average over
the environment to predict the expected values of observables