Not knowing how you set up your Pharmacy Diapensary module, it’s difficult to tell how to answer your question. But let me say that the module is very complex and not at all intuitive to configure. And if even one step is omitted the module will not work as expected.
Be sure that you have performed every step in the config as described in the wiki doc:
and be sure to refer to the page with instructions about ‘templates’ that is linked to in the section, ‘Add Medications to Dispensary’:
It has been a while since I’ve set up the Pharm Disp module but an error about a missing drug ID sounds like it could be a problem in the template for a particular dosage, or in the inventory’s tracking mechanism where they monitor stock levels of a medication on hand.
Good luck and feel free to come back with more detailed questions.