The answer to your question would be that the statement that clears up best the ambiguity in the sentence without changing its meaning is the following one: The doctor said to his patient, "I need to step out of the room if the phone rings".
By chosing the direct quotation, you clear up the ambiguity. When reading the other sentences, it is possible to understand that the one who needs to step out of the room is the patient not the doctor.