When it is said
It is not a prayer from a service. In one of his answers Barsanuphius gives it as the words believers say when they go to the doctors.
It is short enough to say on the way to an appointment, before treatment, or as you go in for an operation.
Where it comes from
Author known
Who was Barsanuphius?
Barsanuphius was a monk of the 6th century who lived in seclusion beside a monastery in Gaza. The abbot Seridos wrote down his answers to the questions people brought and passed them on. With his fellow elder John he left 850 answers to hermits, monks, bishops and lay people.
The Questions and Answers of Barsanuphius and John, Russian translation, Azbyka
His answer to a monk
A monk troubled by weakness asked Barsanuphius whether he should use medical treatment. Barsanuphius said that those who go to doctors and those who do not both hope in God. Those who go say these words. Using treatment is no sin, and not using it is nothing to be proud of. Even with the doctors, only what pleases God’s will comes to pass.
Barsanuphius and John, Answer 505, Russian translation, Azbyka
In Russian
Во имя Господне вверяем себя врачам,
да чрез них Бог подаст нам исцеление.