If I am understanding you correctly you‘d like to know how the pharmacist and/or the software used in the pharmacy recognizes if a prescription drug requires the physicians identity to be transmitted during order.
As far as I know the drug regulation laws in EU countries vary significantly between the individual countries so I can speak only for the country I am residing in (Germany).
There are only very few specific cases of drugs which require the information of the prescribing physician to be submitted during order of the drug. Some of those include lenalidomide and/or thalidomide or specific programs for heroin rehab programs. But as I said before, the specific drugs this would apply to vary between countries.
So there is no general need to have a specific detection in place, as that process differs wildly from the usual process of ordering - for a ’general’ pharmacy this would be the pharmaceutical wholesale, where generally no identity of any physician is transmitted.