cih1355,
The book of Proverbs is a part of the wisdom literature, and as such, it presents an entire vocabulary of literature unto its own. Consider this proverb, which I believe is strongly related to this text:
Proverbs 15:13 A joyful heart makes a cheerful face, But when the heart is sad, the spirit is broken.
The Hebrew text is very similar in each proverb:
לב שמח ייטב פנים ובעצבת־לב רוח נכאה
לב שמח ייטב גהה ורוח נכאה תיבש־גרם
The similarities between the two are readily noticible.
I agree with Skyler, but what I think I would add is that a joyful heart is a cure for both the physical and the mental. Proverbs 15:13 addresses the mental, while Proverbs 17:22 addresses the physical. This is consistent with what we find in the prologue as well. You have:
Proverbs 3:8 It will be healing to your body And refreshment to your bones.
However, only a few verses later you have:
Proverbs 3:17 Her ways are pleasant ways And all her paths are peace.
Thus, I would say that the book of Proverbs is saying that wisdom is a cure for both the physical and the mental. The reason is that joy is generally something that comes from knowing lady wisdom. Hence, I would say that this is going back to the fact that wisdom brings healing to both your body and your soul.
God Bless,
Adam