Commit 099e1022 authored by Cossin Sebastien's avatar Cossin Sebastien
Browse files

update package drugsmapping: add query to retrieve clinical drug component and...

update package drugsmapping: add query to retrieve clinical drug component and their precise ingredient
parent cf820485
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
...@@ -4,5 +4,7 @@ export(extract_concept_id) ...@@ -4,5 +4,7 @@ export(extract_concept_id)
export(extract_dose_form_french) export(extract_dose_form_french)
export(getENVvariables) export(getENVvariables)
export(getPostGresConnection) export(getPostGresConnection)
export(get_sparql_query_cdc_with_quantified_drug)
export(get_sparql_query_clinical_drug_comp)
export(get_sparql_query_dose_form) export(get_sparql_query_dose_form)
export(get_sql_query_dose_form) export(get_sql_query_dose_form)
...@@ -22,3 +22,37 @@ extract_concept_id <- function(uri) { ...@@ -22,3 +22,37 @@ extract_concept_id <- function(uri) {
concept_id <- as.numeric(concept_id) concept_id <- as.numeric(concept_id)
return(concept_id) return(concept_id)
} }
#' @title query the sparql to retrieve clinical drug component and ingredients
#' @export
get_sparql_query_clinical_drug_comp <- function(){
query <- "
select ?ingredient ?clinical_drug_comp ?clinical_drug_comp_label ?ingredient_label ?precise_ingredient_label where {
?ingredient a ? <https://athena.ohdsi.org/Ingredient>;
rdfs:label ?ingredient_label ;
<https://athena.ohdsi.org/RxNorm_ing_of> ?clinical_drug_comp .
?clinical_drug_comp a <https://athena.ohdsi.org/Clinical_Drug_Comp> ;
rdfs:label ?clinical_drug_comp_label .
OPTIONAL {
?clinical_drug_comp <https://athena.ohdsi.org/Has_precise_ing> ?precise_ingredient .
?precise_ingredient rdfs:label ?precise_ingredient_label .
}
}"
return(query)
}
#' @title Find the clinical drug component (cdc) that has a quantified form and get the dose_form_label
#' @export
get_sparql_query_cdc_with_quantified_drug <- function() {
query <- "
select ?clinical_drug_comp ?dose_form_label where {
?clinical_drug_comp a <https://athena.ohdsi.org/Clinical_Drug_Comp> ;
<https://athena.ohdsi.org/Constitutes> ?clinical_drug .
?clinical_drug <https://athena.ohdsi.org/Has_quantified_form> ?quantified_form .
?quantified_form <https://athena.ohdsi.org/RxNorm_has_dose_form> ?dose_form.
?dose_form rdfs:label ?dose_form_label
}"
return(query)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparql.R
\name{get_sparql_query_cdc_with_quantified_drug}
\alias{get_sparql_query_cdc_with_quantified_drug}
\title{Find the clinical drug component (cdc) that has a quantified form and get the dose_form_label}
\usage{
get_sparql_query_cdc_with_quantified_drug()
}
\description{
Find the clinical drug component (cdc) that has a quantified form and get the dose_form_label
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparql.R
\name{get_sparql_query_clinical_drug_comp}
\alias{get_sparql_query_clinical_drug_comp}
\title{query the sparql to retrieve clinical drug component and ingredients}
\usage{
get_sparql_query_clinical_drug_comp()
}
\description{
query the sparql to retrieve clinical drug component and ingredients
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment