"fill a prescription" - what does it really mean?
Hopefully this simplifies it for you, but the Pharmacist is the one who fills your prescription. It might help you to think about a Pharmacist filling a bottle with pills.
A doctor "writes" a prescription. Often a doctor writes a prescription on a piece of paper. However, it can also be written electronically, or faxed.
A pharmacist "fills" a prescription. Your prescription bottle will literally be "filled" with drugs, when you present a valid prescription to a pharmacist.
A doctor prescribes medicine and writes a prescription, meaning he writes down what drugs and how much of the drug the pharmacist should give the patient. When a doctor sends a pharmacist a prescription note, he is basically assigning them a TODO task of filling up a bottle with medicine.
The pharmacist then uses the doctors instructions to know how to fill the prescription. The action of measuring the medicine and putting the right dosage into a bottle is what is considered "filling the prescription".
Even if you didn't yet pick up the pills, if the pharmacist already put the pills in the box, it is considered that he already completed the doctor's task and filled the prescription.
Think of it like having a TODO note to buy milk. When you write "buy milk" on your grocery list, or when you have a note in your hand that says to buy milk, the action is not yet done. As soon as you pay for the milk, you complete the task of purchasing milk. At this point, the action is considered "done" even if you did not yet get home and did not yet drink the milk.