In this paper, we use a fixed template of slots for the online scheduling of appointments. The template is a link between planning the service capacity at a tactical level and online scheduling at an operational level. We develop a detailed heuristic for the case of drug administration appointments in outpatient chemotherapy. However, the approach can be applied to online scheduling in other application areas as well. The desired scheduling principles are incorporated into the cost coefficients of the objective function of a binary integer program for booking appointments in the template, as requests arrive. The day and time of appointments are decided simultaneously, rather than sequentially, where optimal solutions may be eliminated from ...