Hello Everyone,
I would like to get the concept_ids for my records in drug_exposure table.
Unfortunately, currently we have “ATHENA code” values (under drug_source_concept_id) of the drug_items like shown below
However the drug_concept_ids are marked as 0. So, I would like to get the corresponding concept_ids for all the drug_items now.
-
Is it possible to extract the concept_ids for all the corresponding code values in an automated way/query approach? Or I only have to do it manually by referring ATHENA?
-
Why is there a dependency between
drug_source_concept_id
andconcept_id
from concept table?
ALTER TABLE drug_exposure ADD CONSTRAINT fpk_drug_concept_s FOREIGN KEY (drug_source_concept_id) REFERENCES concept (concept_id);
Meaning when I try to create FK on drug_exposure table, it throws an error like shown below
Key (drug_source_concept_id)=(226264) is not present in table "concept".
But aren’t source_concept_ids non-standard source codes that will anyway not be present in concept table? Why do we expect them to be present (imposing FK constraint) in concept table as well? Am I missing something here. Can you correct me here ?