Yes.
I can't tell you how many doctors' offices I go into that have signs posted about payment due at time of service.
I assume you made an appointment in advance of the visit and presumably also knew in advance what your insurance copay and deductible was, giving you enough time to arrange...