It's a little awkward and the "were having" seems like an odd tense to use here.
"Based on endoscopic findings of 4,335 patients in X and Y hospitals between 1990 and 1996, there were 66 cases of pneumonia."
I'm not sure why you have both cases and patients in the same sentence. Is it possible that the same patient could have multiple cases/ If so, this construction makes sense. Otherwise, I would stick to "cases" or "patients" and not mix the two.
You're welcome. Thinking about it a little more, it might be shortened and simplified to the following:
"Endoscopic examinations of 4,335 patients in X and Y hospitals between 1990 and 1996 identified 66 cases of pneumonia."
I think this has the advantage of relating the number of cases directly to the findings, without any implication that these were the only cases of pneumonia in those hospitals or even in that city/region/country.