Münchausen syndrome
The goal of this behavior is to get treatment, attention, sympathy, and comfort from medical professionals. For a person with Münchausen, being a patient feels familiar and comfortable. This meets a deep psychological need that the person has.