Hmm... There is still a way although I doubt it is efficient. You can store the location of the building in a variable once you build it (for further trigger usage). And then when its built make a trigger that checks units in range of that location (can do this in jass, not sure about gui) and if medivh is in range, cast spell on variable medivh.
*Edit* You can also make dummy spell and give it to the building which would automatically cast it on every unit in range. Then do a trigger check on if the unit is the same as the variable medivh. This would work in the case of multiple buildings on map, I believe.