-
Notifications
You must be signed in to change notification settings - Fork 0
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
Map OMOP data to drug_prescriptions
table
#25
Comments
R Script has been developed that maps The following steps provide instructions on accessing chunks from 1- Load required libraries:
2- Authenticate connection to BigQuery
3- SQL queries for retrieving data from drug_exposure and concept tables:
4- Save data
Note: Concept table has been filtered on domain_id = {DRUG, ROUTE, and UNIT}. |
The developed script performs the mapping and transformation of drug exposure data from the OMOP format into a RAMSES-compatible format. Let's go through the code block by block: 1. Loading Libraries# Load necessary libraries
library(dplyr)
library(readr)
library(AMR) # For drug name mapping
2. Loading Data# Load data from CSV files
drug_exposure <- read_csv("/path/to/cleaned_drug_exposure.csv")
concept <- read_csv("path/to/cleaned_concept.csv")
3. Print Column Names and Data Preview# Print the column names to check if they are correct
print(colnames(concept))
# Print the cleaned data to verify everything looks correct
print(head(concept))
# Ensure the relevant columns are available in drug_exposure
print(colnames(drug_exposure))
print(head(drug_exposure))
4. Joining Drug Data and Concept Table#Mapping using left join
drug_exposure <- drug_exposure %>%
left_join(concept, by = c("drug_concept_id" = "concept_id")) %>%
rename(drug_name = concept_name) %>% # Rename concept_name to drug_name
mutate(route = NA) # Since route_concept_id is NA.
5. Removing Unnecessary Columns# Remove unnecessary columns from concept table
drug_exposure <- drug_exposure %>%
select(-domain_id, -vocabulary_id, -concept_class_id, -standard_concept,
-concept_code, -valid_start_date, -valid_end_date, -invalid_reason)
6. Mapping
|
IssuesDuring the process of mapping OMOP drug exposure data to RAMSES, several issues were encountered that led to incomplete or missing mappings. Notably, some drug standards were not mapped correctly, resulting in entries being labelled as "Unknown drug" in the final dataset. This was primarily due to:
|
Pull request has been created for this code addition. |
Extract data from the example OMOP data to fill the
drug_prescriptions
table from the validate article. This is a split from #17.Please feel free to assign yourself to the issue. Please the respective branch for development.
The text was updated successfully, but these errors were encountered: