Gar, a Dralian trader, enters an overcrowded, airborne hospital ship and looks for Chellick, the facility's administrator. Gar shows Chellick the Doctor's mobile emitter that he obtained from the U.S.S. Voyager. Gar fiddles with the controls on the device and the Doctor appears, but he immediately demands to be returned to his ship. The Allocator, the computer that prioritizes all patients on board the ship, announces that a generator has exploded and many patients are arriving. The Doctor witnesses the chaos surrounding him and decides his only option is to help. Chellick, Gar and Voje, another doctor, observe how the Doctor handles patients and are pleased with his work.
Back aboard Voyager, Kim is injured from a holodeck hockey match and visits the Doctor. When Paris and Kim talk to the Doctor, they notice something isn't quite right. Paris and Kim gather the others to examine the Doctor's mobile emitter; Torres announces it is a replicated fake. Neelix points out that Gar did spend a night in Sickbay and had ample access to the Doctor. Janeway then gives the order to search for Gar by scanning his ion trail.
Meanwhile, the Doctor is on Level Red of the hospital ship, scanning a young patient named Tebbis. The Doctor finds out that Tebbis has a deadly infection and has not received the proper treatment — cytoglobin — for it. Voje tells the Doctor that the patient's "T.C." level is not high enough to receive the necessary cytoglobin. Just as the Doctor asks what T.C. stands for, Chellick interrupts and says that he has acquired the Doctor's program from Gar. Chellick also says everyone on the ship must obey the Allocator's rules and that the Doctor must now provide his services on Level Blue. Then Voje explains that the patients on Level Blue receive the best treatment because their T.C. level is high. T.C., as the Doctor finds out, stands for "Treatment Coefficient," in which the Allocator assesses which patient has access to the best care depending on the importance of his or her profession, skills and accomplishments.
In the meantime, the Voyager crew is lead astray by Gar's trail. Then Tuvok recalls that Gar traded iridium with them and suggests they go to the location where Gar acquired the substance. They locate a mining operation on an asteroid and contact a resident. The man tells them that Gar sold them induction units, which came from a planetoid called Velos.
At the hospital ship, the Doctor finds the Allocator approving cytoglobin injections to all Level Blue patients. Another doctor named Dysek tells the Doctor that the injections increase the patients' life expectancy. The Doctor is concerned because he knows that Tebbis needs this medication to be cured. The Doctor sneaks to Level Red and tries to manipulate Tebbis' T.C. level by raising it higher, but the Allocator still denies medication. Then, the Doctor returns to Level Blue and takes a cytoglobin device from a nurse, whom he then dismisses. The Doctor returns to Tebbis with the smuggled cytoglobin injector and administers it to him. Later, the Doctor steals even more medication from Level Blue to treat the patients on Level Red.
Meanwhile, the Voyager crew enters the orbit of the planetoid Velos. They speak with an alien and find out that Gar is on Selek IV. The Voyager crew then locates Gar's ship and engages it in a tractor beam. They ask Gar where the Doctor is, but Gar refuses to tell them. After Gar is beamed aboard Voyager and questioned in the Brig, Neelix offers Gar a meal, which the prisoner quickly consumes. Suddenly, Gar experiences severe stomach pains. Neelix reveals that he poisoned Gar's meal and the Doctor is the only one authorized to administer the proper medication. Gar is then forced to tell them where the Doctor is.
Back on the hospital ship, the Doctor finds out that Tebbis was transferred to Level White — the morgue. The Doctor is angry and confronts Chellick, but Chellick reveals his knowledge of the Doctor's unauthorized injections and restricts the Doctor to Level Blue. Chellick also says that he interfaced the Doctor's holomatrix with the Allocator. Now, the Allocator will automatically monitor and delegate the Doctor's every move. Later, Chellick catches the Doctor on Level Red, but the Doctor injects Chellick with the same virus that inflicted Tebbis. The Allocator identifies Chellick as Tebbis and denies Chellick medication. The Doctor says that he will only help Chellick if Level Red is equipped with an adequate supply of medication. Chellick begs Dysek for help, but Dysek refuses his request, following the Allocator's rules — rules which Chellick established. The Doctor then proposes that Level Red patients, including Chellick, should be transferred to Level Blue to receive care. Chellick finally agrees.
The Voyager crew locates the hospital ship and retrieves the Doctor. Later, the Doctor asks Seven of Nine to check his ethical subroutines for any failures or changes, admitting that he had deliberately poisoned a man. Seven informs him that, unfortunately, he has "a clean bill of health."