I understand that if a person has a debt to the NHS over a certain amount that their entry clearance application can be refused.
Is it a mandatory refusal or a discretionary one? And what is the trigger amount?
General Grounds for Refusal Section 2 of 5: Considering entry clearance
General grounds for refusal
Entry clearance: discretionary refusals
This page  lists the discretionary general grounds for refusal under paragraph 320 of the Immigration Rules (or, for visitors, part V3 of Appendix V). It also sets out when you must refer an application before you refuse entry clearance.
Refusal paragraph: 320 (22)
Refusal paragraph under part V3 for visitors: V 3.14
When you should normally refuse entry clearance
Refusing the applicant or applicant’s entry clearance to the UK where one or more relevant National Health Service (NHS) body has notified the Secretary of State that the person seeking entry or leave to enter has an outstanding healthcare debt or cumulative debt of £1000 or more incurred between 1 November 2011 and 5 April 2016, or debts of £500 or more incurred on or after 6 April 2016
Refer before you refuse? No
As @ouflak has offered:
It should be noted that if the applicant has made arrangements to pay off the debt and has honored those arrangements (and can demonstrate that with NHS confirmation), they will not be refused on these grounds. Life happens and sometimes you have medical bills to pay. That alone is not a reason to refuse anybody as long as they are making a reasonable effort to handle the matter.
And with the ever-invaluable guidance of @GayotFow, UK Visas and Immigration, and Immigration Enforcement Policy paper Statement of changes to the Immigration Rules: HC667, 3 November 2016.
The debt threshold was lowered to £500 (previously £1000) when:
One or more relevant NHS bodies has notified the Secretary of State that the applicant has failed to pay charges in accordance with the relevant NHS regulations on charges to overseas visitors and the outstanding charges have a total value of at least £500.