The invention relates to a rehabilitation mechanism (30) which is designed to be suitable for rehabilitating at least the joints, muscles, and tendons of the legs (92) of a patient (90) confined to bed in an automated manner according to a plan, at least comprising the following: - a knee module (50) which can be operatively connected to the knee joint (93) of the patient (90) confined to bed, and - a control module (60) for controlling rehabilitation movements at least of the joints, muscles, and tendons of the legs (92) of the patient (90) confined to bed according to a plan by means of the knee module (50); wherein - the knee module (50) is designed as a module which can be arranged above the patient (90) and the mattress (20), which is supported directly or indirectly on a bed (11) or the mattress frame (21), and which comprises at least the following: - a knee prosthesis (51) which receives a knee joint (93) of the patient (90) confined to bed; - a connection element (52) which is connected to the knee prosthesis (51); - an extension arm (53) to which the connection element (52) is secured; and - a mechanism (61) which can be actuated by the control module (60) and which introduces a defined force into the knee prosthesis (51) via the extension arm (53) and the connection element (52) such that the joints, muscles, and tendons of the leg (92) carry out rehabilitation movements according to a plan via the patient's (90) knee joint (93) which is received in the prosthesis.