When first examining this subject, I did not believe that there would be away to compare Seamus Heaney's "Mid-Term Break" and Ben Jonson's "On My First Son" to William Shakespeare's Hamlet. Seamus Heaney's "Mid-Term Break" is a poem which speaks to a son returning home from college to attend the funeral of his younger brother. The poem speaks to the different ways his mother and father are reacting to the loss of their son, the actions of those in attendance, and the crying of the baby (which signals that life will still go on as it has in the past). Ben Jonson's "On My First Son" also speaks of death. In this poem, Jonson tells of the death of his son, which comes far too soon (at the age of seven). While "Mid-Term Break" shows the sadness behind death, "On My First Son" shows hope and relief (given that the son will not have to face the rage of the world and the flesh).
As for how one may compare the two poems to Hamlet, the play does speak of death. The play also looks at how one deals with death (in regards to how Hamlet feels about the death of his father). All three texts look at how death is dealt with, how one reacts to death, and how one may or may not look upon death as being a bad thing. There is no speak of revenge, corruption, or disease in either of the poems (revenge and corruption being major themes in the play). Essentially, the only idea which ties the three together is death and the differences in how people react to it.