Hi, You had availed leave in 2018 due to medical reasons. But when did you submit your resignation? Was it after resuming back to work or while on long leave itself without going to the office again?
Payment of Gratuity Act 1984 Amendment
As per the 1984 Amendment to the Payment of Gratuity Act, interrupted service due to sickness, accident, leave, or any other kind of cessation of work, not due to a fault of the employee, would still count as a part of the employee's 'continuous service'.
As long as you availed the leave with the consent of the employer and resumed back to work after the period of leave, such absence from work should also be considered for the purpose of calculating Gratuity.
The duration of your employment with the company after the sickness leave will determine your Gratuity eligibility.