There are various ways of doing this. In the United States which spends twice as much on health care as the next they still have around 20% of the population without insurance, and even those with it have to fight an industry determined to not pay unless they really have to to make profit for shareholders. In countries with government schemes it is rationed by the need to wait for care. They allocate certain resource and that is it, with wastage on beaurocratic rivet counting to ensure there is no wastage, with an army of bean counters wasting resources which would better be used getting people better or teaching people to lead a healthy lifestyle.
In all countries if it is an accident or emergency you get it fast, but it is elective surgery that gets pushed back.
I think the problem is largely the selfishness of people who are not prepared to pay through their taxes to provide the money needed to run a full and speedy service. They would rather get all hung up about terrorists and weapons of mass destruction and go off on wars, recently, Iraq and Afghanistan instead of looking after their own people. Or within the nation want more road and other non-important things built and paid for.
Then when rationing occurs we have conflicts between peoples objection to dying before their time and doctors desire not to 'loose' a patient, beaurocrats conflict over 'wasting' money of the terminally ill to keep them alive a few more days or weeks. A question of quality or quantity. Really if people where more pragmatic and accept that their number had come up. But to do that they need to have had a satisfying life. Personally I have had a very good life, it could have been better in some respects, but generally I'm not complaining. If I had to take drugs to cope with unbearable pain I would wish I had the option of quietly and painlessly going to sleep for good.