Answer
(Fatwa: 1050/823/L=1431)
Ulema have allowed getting treatment with haram things with two conditions. (1) The ailment is impossible to be cured by any lawful medicines except that haram one. (2) It is the prescription of any expert and honest doctor. So if the treatment of any illness is not possible without eating pork and any pious and expert Muslim doctor confirms it, in this case consuming pork will be allowed only as much needed.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband