This would happen in the hospital when I worked as a nurse. If you touched a bed rail you got zapped. If you touched the patient first, you both got zapped.
I found that if I grounded myself first, by either putting my hip or my tummy against the bedrail, it diffused the static and - no more zaps.
It's either that or wear a lightening rod on your head! LOL