
Just what the doctor ordered
Situational Use
Used when something is perfectly suited to one's immediate needs or problems. 
Expressing Relief
Commonly used to express relief after receiving something beneficial or soothing. 
Not Literal
The phrase is not medical advice but a figure of speech implying something beneficial. 