A year ago I had a stable job working as a trainee GP in Greater Manchester and was due to qualify in February this year. I was in a relationship, had my own car and everything was great.

But for the last eight months my life has been a living hell.

My troubles began towards the end of last year when I applied for indefinite leave to remain in the UK. I am from Singapore. I was five months away from qualifying as a GP and had studied medicine at Manchester University, starting as a doctor in the NHS in 2012.

I booked an appointment and paid for it before my visa ran out. I thought that was fine. In reality, the application is made when you attend the appointment, by which time my visa had been invalid for 18 days. I was refused residency for that reason, and since then it’s been a battle to reverse the decision. An immigration judge ruled that it “would not be proportionate” to remove me; the Home Office lodged an appeal. My lawyer told me on Friday morning it is reconsidering my original application.

Everything flies in the face of common sense. NHS England is paying £100m to recruitment agencies to get GPs to work in England and here I am, five months away from becoming a GP, and I’m being kicked out. Meanwhile, demand in the NHS is rising and GP numbers are falling.

I haven’t been allowed to work since the initial appointment. When I was told, my first thought was: “What am I going to do about all the patients I’ve booked next week? Who is going to see them?”

I’m not entitled to benefits so I’ve been living off my savings and help from my parents.

My mental health has deteriorated. There have been days when I’ve woken at 5am, my heart racing, and thought: “What should I do? Are they going to deport me? Am I going to be detained?” It was constantly on my mind. It placed a lot of strain on my relationship, which has now ended, partly because of the stress.

I chose general practice because I like having the time to sit with patients and build up a relationship

Everything has ground to a halt. It takes a lot to be resilient and say I’m going to carry on regardless of what happens. If I can’t finish my training, everything will have been for nothing. I would have to go to another country – Singapore or Australia – and start over again as a trainee.

I’ve loved the UK since I visited as a child. When it came to university, my mind was set on the UK. I chose general practice because I like having the time to sit with patients and build up a relationship. It’s always nice to see what happens to them.

I remember learning about the NHS at school in Singapore. It’s this massive institution that takes care of you from when you’re born to your very last days. You always have to pay something for healthcare in Singapore. The NHS is amazing – it is unimaginable in other countries to have a system that gives you what you need, when you need it. I’m so proud to have worked for it.

I feel I have a personal debt to the NHS. It has invested in me – it costs hundreds of thousands of pounds to train a GP (pdf) from medical school through to qualification. Some of that I’ve paid for but I’m immensely grateful. I really want to be able to contribute and give back to the NHS.

Dr Ong has started a petition asking the Home Office to reconsider

Join the Healthcare Professionals Network to read more pieces like this. And follow us on Twitter (@GdnHealthcare) to keep up with the latest healthcare news and views

If you’re looking for a healthcare job or need to recruit staff, visit Guardian Jobs