The scholars (within the Hanafi School) have differed as to the permissibility of using unlawful (haram) medication. It is related from Imam Abu Hanifa (Allah have mercy on him) - the founder of the school- that it will not be permissible to use anything that is unlawful even for medical purposes. However, according to Imam Abu Yusuf (Allah have mercy on him) it will be permitted.
Hence, Imam al-Sarakhsi (Allah have mercy on him) states:
"According to Imam Abu Hanifa (Allah have mercy on him), it will not be permitted to drink the urine of animals whose meat is Halal (m: for it is impure and unlawful) for medication or any other purpose, due to the statement of the Messenger of Allah (Allah bless him & give him peace): "Indeed Allah Most High has not placed cure in that which He has made unlawful for you". However, according to Imam Muhammad (Allah have mercy on him), it is permitted to drink the urine of animals whose meat is Halal for medication and other purposes, because it is considered pure according to him. Imam Abu Yusuf (Allah have mercy on him) on the other hand, is of the opinion that it will be permitted to drink it but only for medication purposes, due to the Hadith of al-Urayniyyin (m: where the Messenger of Allah (Allah bless him & give him peace) gave permission for some members of the tribe of Urayna to drink the urine of camels as medication)." (al-Mabsut of Imam al-Sarakhsi, 1/60-61, bab al-wudu wa al-ghusl)
The fact is that the scholars of the Hanafi School (and also other schools) have differed in this issue due to the apparently conflicting Hadiths found in this regard. Some narrations indicate that it is unlawful to use unlawful medication, whilst others seem to indicate that it will be permitted to use unlawful substances for medical purposes.
1) Sayyiduna Abu al-Darda (Allah be pleased with him) narrates that the Messenger of Allah (Allah bless him & give him peace) said: "Indeed Allah has sent down both illness and it's cure, and He has appointed a cure for every illness, so treat yourselves medically, but use nothing unlawful." (Sunan Abu Dawud, no: 3870)
2) Sayyiduna Abu Hurayra (Allah be pleased with him) narrates that the Messenger of Allah (Allah bless him & give him peace) forbade from (using) impure medicine." (Sunan Abu Dawud, no: 3866)
3) Tariq ibn Suwayd or Suwayd ibn Tariq asked the Messenger of Allah (Allah bless him & give him peace) regarding wine, but he forbade it. He again asked him, but he forbade him. He said to him: "O Messenger of Allah! It is a medicine". The Messenger of Allah (Allah bless him & give him peace) said: "No it is a illness." (Sunan Abu Dawud, no: 3869)
4) Sayyida Umm Salamah (Allah be pleased with her) narrates.......So the Messenger of Allah (Allah bless him & give him peace) said: "Indeed Allah Most High has not put cure for you in the unlawful." (Sahih Ibn Hibban)
1) Allah Most High says:
"He (Allah) has only forbidden you dead meat, and blood, and the flesh of swine, and that on which any other name has been invoked besides that of Allah. But if one is forced by necessity, without wilful disobedience, nor transgressing due limits, then he is guiltless. For Allah is Most Forgiving and Most Merciful." (Surah al-Baqarah, V: 173)
2) Sayyiduna Anas (Allah be pleased with him) narrates that some people came from (the tribe of) 'Ukl or 'Urayna and became ill in Madinah. The Messenger of Allah (Allah bless him and grant him peace) commanded them to go to the milk-camels and to drink their urine and milk (for their treatment)..... (Sahih al-Bukhari, no: 231)
3) Sayyiduna Anas ibn Malik (Allah be pleased with him) narrates that the Messenger of Allah (Allah bless him & give him peace) permitted Zubayr and Abd al-Rahman (Allah be pleased with them both) to wear silk because of the itching they suffered from." (Sahih al-Bukhari, no: 5501)
Wearing of silk has been categorically forbidden for men by the Messenger of Allah (Allah bless him & give him peace), yet it was allowed for medical purposes.
4) Imam Abu Dawud, Imam Nasa'i and Imam Tirmidhi (Allah have mercy on them) relate in their respective Sunan collections, that a Companion (sahabi) by the name of Arfaja ibn Aswad (Allah be pleased with him) had his nose damaged in the battle of kulab. He replaced it first with silver, and then with a nose made of gold, with the order and consent of the Messenger of Allah (Allah bless him & give him peace), despite gold being unlawful for men.
As far as the narrations indicating the impermissibility of using unlawful medication are concerned, they (according to the scholars who permit using unlawful medication) refer to the situation where an alternative is available. Hence, in such a case, it would indeed be unlawful to avail of Haram medicine.
Similarly, it will be Haram to use unlawful medication when there is uncertainty in the medication being a cure for one's illness; hence, the narrations refer to the situation where there is uncertainty.
The great Muhaddith and Hanafi jurist, Allama Badr al-Din al-Ayni (Allah have mercy on him) states in his renowned commentary of Sahih al-Bukhari:
"Seeking treatment with unlawful medication is permissible when one is certain of being cured, similar to consuming dead-meat when dying of hunger and drinking alcohol when dying of thirst." (Umdat al-Qari, 2/649) The same has been mentioned by other scholars also.
In light of the above, the majority of the Hanafi jurists (fuqaha) are of the view that it will be permitted to use unlawful substances as medication subject to certain conditions. This viewpoint is based on the position of Imam Abu Yusuf (Allah have mercy on him).
Thus, Imam Ibn Nujaym (Allah have mercy on him) states in his renowned al-Bahr al-Ra'iq:
"There is a difference of opinion amongst our scholars with regards to using unlawful medication. In al-Nihaya quoting from al-Zakhirah, it is stated that it is permissible to use unlawful medication if it is known that the cure lies in the medication and that no alternative is available." (al-Bahr al-Ra'iq, 1/116)
Imam al-Haskafi (Allah have Mercy on him) states:
"The Scholars differed regarding the usage of unlawful medication. The apparent opinion in the (Hanafi) school is that it is haram. However it is said that, it will be permissible when the medicine is known to be effective and that there is no other alternative, similar to the dispensation of drinking alcohol for a person dying of thirst, and the fatwa is given on this opinion." (See: Radd al-Muhtar ala al-Durr, 1/210)
However, many of the Hanafi Fuqaha have subjected this dispensation to the following conditions:
1) It is reasonably known that the medicine will be effective, and is needed;
2) There is no permissible alternative reasonably available;
3) This has been established by an expert Muslim doctor who is at least outwardly upright and god-fearing. (ibid)
The above explanation should have answered your question, in that if the medicine is known to be effective and no other alternative is available, it will be permitted to avail of it. This, however, needs to be established by an expert Muslim doctor. Thus, explain the Shariah perspective to an expert Muslim Doctor and seek his advice.
And Allah knows best
[Mufti] Muhammad ibn Adam
Leicester , UK