A federal or state court can, in proper cases, order people to take specific actions, In civil suits this is known as "Specific performance". in the Wikipedia article it is said that:
Specific performance is almost never available for contracts of personal service, although performance may also be ensured through the threat of proceedings for contempt of court. ...
...
Such order[s] are granted when damages are not an adequate remedy and in some specific cases such as land (which is regarded as unique).
...
... Moreover, performance based on the personal judgment or abilities of the party on which the demand is made is rarely ordered by the court. The reason behind it is that the forced party will often perform below the party's regular standard, when it is in the party's ability to do so.
In the case of contracts calling for specific personal service, such as that of an entertainer, an athlete, or a uniquely qualified professional, courts have been reluctant to order the individual to perform, but have been willing to order the person not to perform similar services for anyone else until the disputed contract is fulfilled or settled. This would not seem to apply to the situation on the House show.
Therefore such an order would quite possibly be within a court's power, but would be highly unusual, particularly if other doctors could equally well perform the service and were willing to do so.
Beyond that, the equitable remedy of "specific performance": is used when a party has in fact agreed to do something and then does not carry out the promised act. But in the situation described in the question Dr House had no such previous agreement, as I understand it (I haven't watched the episode). Under those circumstances, an order for such specific action to a particular person becomes very unlikely indeed. There would even be a question whether House would be subject to the court's jurisdiction since he has done nothing to involve himself in the case previously.
Also if the treatment were not in the best interests of the patient, but only in the interest of the court system, such an order would be still more unlikely. I do not know of any similar order in real life.