Doctor's quick thinking saves patients