Pain medication management is an ongoing multidimensional process , each step of which has to be mastered by patients and their family caregivers when cancer treatment and supportive care are provided on an outpatient basis .