Drug table vs the Prescription Table

It seems that the prescription table is for the patient’s current prescriptions and the drug table is for the drug database. there is a column in the prescription table, drug_id which matches a column in the prescription table but there is no foreign or primary key.

I would think that the workflow would be when adding a prescription to the patient One could

  1. search for a drug
  2. select that drug
  3. the drug would then be added to the prescription table

The problems I am having

  1. I have added drugs to the drug table but the search feature does not find them
  2. When the prescription is created there is no reference to the drug table

Which table is the drug search feature searching in the add prescription modal window?
If I select the searched drug then will the drug in the drug table be tied to that prescription table when I save the prescription?

The search button posts to this URL = /controller.php?prescription&lookup&drug=. I can find the controller but it is a bit tough to determine the select statement that is triggered so I cant find out which table it searching.

Any help would be greatly appreciated.
Thank you.

@pikeshawn,
Can you please try by searching the drug in the text box instead of clicking the option “click here to search”
To make you more clear the below thread will help.
https://sourceforge.net/p/openemr/discussion/202506/thread/a7befbdb/#85e5

Thanks,
ViSolve

Thank you sir. I will do that.