The Shulchan Arukh (Yoreh De'ah 336:2) rules based on a Ramban in Toras Ha-Adam that a doctor may not receive payment for his expertise but only for his time (Sekhar batalah), i.e. what he is otherwise capable of being paid for that time (cf. Shulchan Arukh, Choshen Mishpat 9:5). How much can a doctor actually receive for his time spent not healing someone in any direct or indirect way? Maybe a lot, maybe not. But does this rule apply nowadays?
R. Shaul Yisraeli, Chavos Binyamin vol. 3 no. 110 (link, loose translation):
The gemara (Kiddushin 58b) brings an apparent contradiction regarding the question whether the workers involved in the para adumah purification process may receive a salary. The gemara, in answering the question, distinguishes that they can receive money for the filling and bringing of spring water but not for the actual purification process. The Ramban (Torat Ha'adam, end of section on "Sakana") applies this distinction to the medical profession. He states that the doctor "may not receive pay for knowledge and teaching, which is analogous to the purification process itself, but he may take pay for the toil involved, which is analogous to bringing the water." The Machane Ephraim (S'chirut,17) explains the distinction that the mitzva is the actual purification and not the preparatory bringing of water. Likewise, the demanding nature and the very substantial expense of the training which precede one's certification as a doctor [which were much less extensive in ancient times] are analogous to bringing the water and justify payment.
The preparation for a medical career is not a mitzva which is incumbent upon a given individual, but is embarked upon by free choice. It follows that one enters medical school with the intention to be repaid for his time, toil, and money by demanding appropriate compensation when he reaches the requisite expertise. Every patient who requires the doctor's help, throughout his medical career, is considered a part of the group of people on behalf of whom the preparations with their toil were carried out. Therefore just as one could be paid for bringing water for the para adumah, any given patient can be charged for part of the doctor's education. (Although the Ramban says that the doctor cannot demand pay for limud (education), this refers to the doctor's instructions to the patient, not the doctor's own training [see Shach 336:8]).