Medicare Part A provides coverage for qualifying inpatient mental health services when medically necessary, as determined by a doctor. A qualifying person needs treatment at an inpatient facility.