It's illegal. The only exception to this would be if your HR manager discusses a medical situation that will affect your ability to do your job and the HR manager is explaining to your manager only what she needs to know in order to accommodate your condition.

Otherwise, the HR manager should not discuss anyone's medical condition with anyone other than the employee with that condition.