Please check my answer :)

Martha the medical assistant is legally compelled to give her testimony in a under oath in a malpractice lawsuit Why must she do this ?

I think it might be she got some type of subpoena or
She is a key witness in the case

Yes. Apparently she received a subpoena and was ordered to testify.