There is a parameter in Base registers/MED/Parameters, tab Plans & Orders: Reference number per insertion, that activates the function.