OHDSI Home | Forums | Wiki | Github

CDM - Vocabulary - Help

Hi All,

How to add custom defined concepts in the CDM vocabulary?

Currently i download the existing vocabulary from the Athena. We have our own list of surgical procedure which is very difficult to map with the existing concepts. Is there any option to add custom defined concepts in the cdm vocabulary.

Please advice

thanks
regards
Chidam

Hi, @Chidam,
There is an option of adding new custom concepts.

First, you need to create the records in the Concept & Vocabulary tables for the new custom vocabulary/vocabularies (so you need to give a name and vocabulary_id), i.e.:

insert into @target_schema.concept (concept_id, concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, valid_start_date, valid_end_date, invalid_reason)
values (2000000001, ‘Custom vocabulary name’, ‘Metadata’, ‘Vocabulary’, ‘Vocabulary’, NULL, ‘OMOP generated’, TO_DATE(‘19700101’, ‘yyyymmdd’), TO_DATE(‘20991231’, ‘yyyymmdd’), NULL);

insert into @target_schema.vocabulary (vocabulary_id, vocabulary_name, vocabulary_version, vocabulary_reference, vocabulary_concept_id)
values (‘Custom vocabulary id’, ‘Custom vocabulary name’,‘i.e., August 2019’, ‘Some kind of reference (i.e. Dataset name)’, 2000000001);

Then, place the custom concepts to the concept table starting with 2000000000 concept_id (don’t forget to leave some for the custom vocabularies).
Since these concepts are Standard, add the mappings to themselves (forward ‘Maps to’ and reverse ‘Mapped from’) to the Concept_relationship table.

Hello @Chidam,

I’ve also described this process previously in another forum thread. Hope it helps.

Thanks Alexdavv,

Thanks for your advise, Have you tried this approach your side?

so, i create new vocabulary, and i create concepts with newly created vocabulary. i start concept id 2000000001 (as you mentioned). I don’t have any other info like relationship tables and other mappings, it will work right?

If i don’t have any other relationship with the concept, ATLAS will work right?

Please give reply. Thanks in advance

regards
Chidam

Thanks rookie_crewkie,

I saw the forum thread, great. Have you tried this approach your side?

please advise

thanks
regards
Chidam

Hello @Chidam,

Yes, I do this on a regular basis. Unfortunately, I cannot share the code, but the automation of the process is quite trivial.
Once you have your new concepts in place, you can map them to existing OMOP concepts (or to themselves, if no matching concept can be found). This can be done either via SOURCE_TO_CONCEPT_MAP table or by creating additional ‘Maps to’/‘Mapped from’ relationships in CONCEPT_RELATIONSHIP table. Both ways work fine, this is just an ETL decision.
In your case, I’d propose to add custom concepts for your surgical procedures and map them to themselves in CONCEPT_RELATIONSHIP as @Alexdavv advised.

Exactly. If you don’t have the hierarchy in the source data or not planning to use it, just create the links from custom concepts to themselves and back. And even the concept_ancestor table is not to be used this way.

These new custom concepts will be available in Atlas. And after you ETL the source data and put these concept_ids to both source_concept_id and event_concept_id of the event tables, you can easily access in Atlas, the same way as general Standard concepts work.

hi Alexdavv,

thanks a lot, let me try myside. Thanks for your advise

regards
Chidam

thanks rookie_crewkie,

I will follow your instructions to implement custom concepts. thanks for your advise

thanks
Chidam

t