All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Undoubtedly, all the limbs of a pig are impure, and the jurists agreed that it is generally forbidden to seek treatment with an impurity for the general evidence proving the prohibition of being treated by it.
However, some jurists permitted being treated with an impurity with the following three conditions:
1- There should be a necessity for consuming this medicine for the lack of another pure medicine that could be consumed instead.
2- A just and trustworthy Muslim doctor should confirm that this impurity is a medicine or that the patient has solid medical knowledge and knows that this medicine is indeed a cure.
3- If the medicine is an intoxicant, it must be an ingredient with other medicine [it should not constitute the entire medicine, it should be an ingredient added to it].
If all the above conditions are met, then it becomes permissible for you to be treated with the medicine that you mentioned above, but if one of the above conditions is not met, it is not permissible to be treated with it for the general prohibition of using an impure product.
you should know that Allaah is All-Knower and All-Seer and He Knows everything about you. Just thinking that there is no other medicine is not sufficient; rather, you should seek and endeavour to find a permissible medicine and ask the doctors about this.
Allaah Knows best.