The Gratuity Act 1971 is applicable only for Establishments in Indian. If you are employed in UAE as your profile says , please check with the respective labor laws Authority of the respective country.
However if you are employed in India.
As per the law in your case and If You had a HR professional & Human(You should be entitled to be paid till 2014 ) but ,what even i have observed in many companies ,How are the Laws manipulated and thus I always raise my voice for a change to revise these Laws.Brutally speaking I say these are "Unfair Practices of HR". Anyways my friend coming to your case.
As per law the eligibility for continuous year of service for qualifying for Gratuity is 5 years ,
Describing it more for you. There are few requirements on the part of employee for claiming of gratuity:
Most important -------- He should have worked for not less than five years for the employer.
The Gratuity is Calculated as follows : ( Basic + DA ) /26 X 15 X No of Continuous Years Worked.
A Continuous Year is number of days of your service for a year of work and as per law
1 continuous year is 190 days of work if working below ground (like Mines etc) and 240 days if working above ground and it includes strikes , lock outs, any short temporary closure due glitches etc.
So what your HR did is He took 2004 to 2009 as a period of gratuity and as you meet all criteria for that period , your gratuity is clear.
Now,
Due to your 1 year break though medical , they (your HRs & company) took your 2nd term as 2010-2014 ineligible for 5 year and this is as per law but I say strategically and legally it can be challenged on any fair platform for justice.
1.)You need to prove what kind of medical leave was that you took , it was continuous or intermittent ,or were you on LOP etc.(Your association with the organization was not cut).
2.)You didn't resigned and rejoined as a new employee
3.) You worked for {2004 to 09} and {2011 to 201}4----January/March 2009 to November 2009 (For year 2009-10) and January 2011 to March 2011(for year 2010-11)/ Continuous till 2014.
Request the HR & company to at least re-consider their decision if not.
Take some professional help , to get a solution.
Try Hard.