Open Farreeda opened 1 year ago
I think this may need three functions that look something like this:
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:
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)