Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizontal relationship exploration #229

Open
albertpratsu opened this issue Oct 23, 2024 · 2 comments
Open

Horizontal relationship exploration #229

albertpratsu opened this issue Oct 23, 2024 · 2 comments

Comments

@albertpratsu
Copy link
Collaborator

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
Copy link
Collaborator

@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
Copy link
Collaborator Author

albertpratsu commented Oct 23, 2024

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants