I am about to have necessary surgery and it will require me to take off my hijab, is it permissible for me to do so?
If you can request a female doctor to perform your surgery, then you need to do so. Otherwise, if only a male doctor is available, or the male doctors is more capable of ensuring a successful surgery, then there is no problem in removing your hijab for that purpose if it is necessary.