The Surgeon General had the power to relieve starship medical officers who were judged to be incompetent. An example of this occurred in the 2260s, when the Starfleet Surgeon General, in cooperation with Starfleet Command, relieved Doctor Arthur Coleman for "administrative incompetence" and making "flagrant medical blunders".
It is uncertain if the position of Surgeon General was held by a civilian or a Starfleet admiral since the position was only spoken of but never seen on screen. A "blue shirt" medical admiral has never been seen in any Star Trek production.
Several non-canon reference works, among them Star Trek: The Next Generation Officer's Manual, suggest that McCoy may himself have been the Starfleet Surgeon General in later life (with his final rank of admiral a result of this position).
The office of Starfleet Surgeon General was not mentioned outside of Star Trek: The Original Series and it is unknown if the position exists during the time frame of later Star Trek productions.
The reference manual Star Trek: The Next Generation Officer's Manual lists a special rank called "Branch Admiral" which the Starfleet Surgeon General might hold.