This was true early in the war, but Gaza's health ministry has long since shifted to collecting reports of deaths from "reliable media sources". One source of data is a Google form which they set up in March. There are also reports claiming that GHM has counted natural deaths in their figures, which I don't think GHM has really denied (their releases don't say much about methodology). And of course they include militant deaths.