The correct option is D who lived nearby
A relative clause is one that describes the noun that precedes it in the main part of the sentence. Here the clause "who lived nearby" describes the doctor. Hence Option D is correct. The rest of the options do not adhere to the goal, hence incorrect.