In a short story I'm reading, I found this sentece:
ちゃんとした手術をするのかと思ったら、獣医さんはその場で切開を始めた
I guess 「の」 nominalizes the preceding sentence, but I'm not sure about the meaning if 「かと思ったら」. I found it can have rhetorical or softening usage, and it can mean "just when", but neither seems to apply in this case.
I think that means the veterinary is going to do a proper surgery and he begins an incision, but I'm not sure about that construction's meaning.