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

[FEATURE] Function gets treatement response for a drug #52

Open
Farreeda opened this issue Mar 24, 2023 · 1 comment
Open

[FEATURE] Function gets treatement response for a drug #52

Farreeda opened this issue Mar 24, 2023 · 1 comment

Comments

@Farreeda
Copy link
Contributor

using funSQL, a function that takes the drug name as argument and returns a table of person_id and value_as_number (from measurement table)

@TheCedarPrince
Copy link
Member

I think this may need three functions that look something like this:

  1. Function to get all drug_exposure_id's related to a single person
    1. Look at the Drug Exposure table
  2. Function to get drug_concept_ids associated with each drug_exposure_id
    1. Look at the Drug Exposure table
  3. Function to get amount_value for a given drug_concept_id
    1. Look at the Drug Strength table

Then, the interface I imagine would look something like this:

using OMOPCDMCohortCreator 

# Other code goes here

# Returns a DataFrame with two columns: person_id, drug_exposure_id
drug_exposures = GetDrugExposures([1, 2, 3], conn)

# Returns a DataFrame with two columns: person_id, drug_concept_id
drug_concepts = GetDrugConceptIDs(drug_exposures.drug_exposure_id, conn)

# Returns a DataFrame with two columns: drug_concept_id, amount_value
drug_amounts = GetDrugConceptIDs(drug_concepts.drug_concept_id, conn)

You could use the GetPatientGender function as a starting point in making these functions:

https://github.com/JuliaHealth/OMOPCDMCohortCreator.jl/blob/77126d02e304479991fe9fde9f47f71cb3d6ebaa/src/getters.jl#LL167-L185

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