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 and concept_id from concept table?
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 ?
You can lookup the corresponding concept_id from the concept_relationship table, where relationship_id=‘Maps to’
I think concept table is a master table of all concepts as part of the OMOP vocabulary, so both standard and non-standard concepts are included in this table
Not too sure about point 1. Hope someone can enlighten me as well
Why are you getting an error for concept id 226264
How to get the standard concept from a source concept id
Why are you getting an error for concept id 226264? Because that concept does not exists in the OMOP concept table. I think what is going on is that what you call a drug_source_concept_id is an RxNorm code, not an OMOP concept_id. To get the OMOP concept id for the RxNorm RxCui 226264
SELECT * from concept where vocabulary_id = ‘RxNorm’ and concept_code = 226264;
This yields the OMOP concept
concept_id
concept_name
domain_id
vocabulary_id
concept_class_id
standard_concept
concept_code
valid_start_date
valid_end_date
invalid_reason
19053957
Hibiscrub
Drug
RxNorm
Brand Name
226264
1970-01-01
2099-12-31
19053957 is the value that OMOP expects to see in the drug.drug_source_concept_id. And the drug_source value would be 226264, or if you want to also maintain the description, something like ‘226264:Hibiscrub’
How to get the standard concept from a source concept id
I suggest you view the OMOP vocabulary tutorials on YouTube to get a better understanding of how to map to standard concepts. Then come back with the question about mapping to standard concepts using the Concept Relationship table.