forked from BenGlicksberg/ROMOP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
showDataTypes.R
24 lines (19 loc) · 865 Bytes
/
showDataTypes.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#' Shows available data types from the OMOP ontology
#'
#' Details relevant vocabularies per ontological domain. Requires dataOntology to have been created (makeDataOntology funciton).
#' @return Returns a table of vocabularies contained within clinical domains: Condition, Observation, Measurement, Device, Procedure, Drug.
#' @export
#'
#' @examples
#' showDataTypes()
#'
showDataTypes <- function() {
if (exists("dataOntology")) { # ensure dataOntology exists
dataTypes = dataOntology[domain_id %in% c("Condition","Observation","Measurement","Device","Procedure","Drug"),c("domain_id", "vocabulary_id")]
dataTypes = dataTypes[!duplicated(dataTypes)]
dataTypes = dataTypes[order(domain_id),]
return(dataTypes)
} else { #endif dataOntology exists
message("Error: dataOntology does not exist. Please first run makeDataOntology.")
}
}