Public healthcare is sadly no silver bullet. In
ideal private insurance scenario you pay some amount and get increasing credit for healthcare expenses, so the user is incentivised to chose best cost performing treatment (cheapest option providing adequate treatment) and providers are incentivised to obey free market rules and keep fees under control (sans cartels/antitrust, market segmentation). In publicly funded scenario without coupling between payments and usage, user is incentivised to seek the most "premium" treatment and providers are not incentivised to reduce operational costs.
If the public system covers anything more than emergency care (patch a patient up and let them go) it automatically creeps into all service levels (have a basic cough? maybe that's bacterial pneumonia, better issue referrals for microbiological analysis and a CT scan. /s) if an answer to the question "if family doctor/general practitioner cannot appoint diagnosis and/or treatment and refers patient to a specialist and/or analyses, scans, etc. are those covered too?" is yes.
The payer (government, taxpayers) probably has 3 mechanisms to keep [total] costs from skyrocketing all with their disadvantages:
1. Reduce usage count (doctor visits) - free visit quotas (possibly dependant on service level), fixed or percentage mandatory user fee, etc;
2. Fix service costs - e.g. 100$ for a GP visit from public pool;
3. Auction paid service quotas.
While option 3 provides most incentives to optimise costs, it greatly punishes small players.