Assuming that beatings are supposed to be corporal punishment (and not maimings), they are much much more severe than they really should be. At most, corporal punishment should cause transient pain and transient marks such as welts and redness (and at most light bruising for the most severe punishments), all of which should not required any medical care to recuperate from (though, depending on the severity of the punishment, the affected dwarf may need to rest for up to a few days before they can do anything). Corporal punishment should never result in the dwarf being punished being placed at risk of life, nor risk of losing the functions of one or more limbs, senses, faculties, or ability to procreate, nor anything else that should require medical attention.
The other (possible) problem is with how dwarves react to being punished. It would be nice if being punished would lead to lead to the punished dwarf being less likely to commit further crimes in the future (it’d also be nice if witnessing another dwarf being punished would have a similar effect).
As for hammering, dwarves should never be given a set number of hammer strikes. Instead, the sentence should be for the dwarf to be “hammered until dead” and the hammerer (after chaining the condemned dwarf and removing any headgear) should simply apply as many hammer strikes as it takes until the condemned dwarf is, in fact, dead.
Just my 2˘.