At the end of the events of The Girl Who Waited, we see Rory and (younger) Amy coming back into the TARDIS after
they have been out walking in a Chen7-ridden world.
Towards the beginning of the episode a Handbot identifies that Amy is indeed carrying the bacteria even if she is immune, and even if this was not the case it's still most likely that they'd have some on their skin or clothes.
In this case, how did the Doctor not contract the disease from Amy and Rory?