Does the use of medical advances in healing contradict trusting in Allah?

Imam Badruddin al-Aini al-Hanafi (d. 855 AH) writes: “ IT DOES NOT SAY:“ Treatment is contrary to hope, but we are commanded to be trusting (in Allah) , ”because we say: the command to trust should be understood as (hope together) with appropriate action. The Almighty and Most Pure Allah said [transmitting the words of Isa or Jibril addressed to Maryam]: “ Shake the trunk of a palm tree on yourself ” [Maryam, 25], while the Most High and Most Pure Allah is able to endow it (with the fruits of a palm tree) without it.

And this understanding was expressed in verse by the ruler of the faithful, Ali ibn Abi Talib, may Allah be pleased with him. He said:

“Trust and act on the Merciful, try for the good.
I have seen people (of faith) take pride in inaction.
But can’t you see that the Lord said to Maryam:
“Shake the trunk of the palm trees, the dates will fall as a consequence.”

And if He wanted, then that tree would bend by itself.
No shaking on her part. Yes, everything (in this world) is the reason.
There is the Most Merciful, trust in Him in every deed.
And do not give up work, efforts to do it, regardless of their size. “

See al-Binaa 12/271.