darwin-eu / CodelistGenerator

Identifying relevant concepts from the OMOP CDM vocabularies
https://darwin-eu.github.io/CodelistGenerator/
Other
12 stars 8 forks source link

Horizontal relationship exploration #229

Open albertpratsu opened 1 month ago

albertpratsu commented 1 month ago

Is your feature request related to a problem? Please describe. getCandidateCodes is fantastic at finding codes from different strings, but some vocabularies like SNOMED have very powerful horizontal relationships that could help with more complex phenotypes or with finding diseases based on symptoms.

Describe the solution you'd like Add an option to search using concept relationships, or have a separate function for it. Add a function to get all potential types of relationships of a code. Happy to discuss further and help develop!

edward-burn commented 1 month ago

@albertpratsu there is this utility function https://darwin-eu.github.io/CodelistGenerator/reference/getMappings.html, but do you want something more even more general?

getCandidateCodes has the option searchNonStandard which uses these "mapped from/to" relationships, but would you think to add functionality that goes beyond this?

albertpratsu commented 1 month ago

It is an advanced functionality, but say I want to get all conditions caused primarily by HIV, I could do:

## Check all conditions caused by HIV (concept id 4078242 )
HIV_infections <- cdm$concept_relationship |> filter(concept_id_1== 4078242) |> 
                  filter(relationship_id=="Causative agent of") |>
                left_join(cdm$concept, join_by(concept_id_2==concept_id))

There are other relationships that may help us refine and filter a long codelist, like "Has finding site " or "Has pathological process"

PRijnbeek commented 3 weeks ago

Suggest to move this discussion to the dev organization