Earlier quoted context omitted.
Literally no: https://ihl-databases.icrc.org/en/customary-ihl/v1/rule28 The laws of war (outside jus ad bello) aren’t that complicated. Don’t shoot the medic is one every combatant benefits from.
1. Medics aren't hospitals. Nor are they any other building for that matter. 2. There's literally an exception right there in the singular sentence you linked to.
2. Fair enough. It’s still morally wrong to do so if it’s not solely being used as a military facility.