It varies I have had urgent surgeries within 2 days of meeting the surgeon and others that were planned for 2-3 weeks ahead of time.
I believe I have been tested for hepatitis before a surgery but don't recall which, when or why. May just be standard pre-surgical testing.