Title: | 'ACE' Search Engine API |
---|---|
Description: | 'ACE' (Advanced Cohort Engine) is a powerful tool that allows constructing cohorts of patients extremely quickly and efficiently. This package is designed to interface directly with an instance of 'ACE' search engine and facilitates API queries and data dumps. Prerequisite is a good knowledge of the temporal language to be able to efficiently construct a query. More information available at <https://shahlab.stanford.edu/start>. |
Authors: | Vladimir Polony |
Maintainer: | Vladimir Polony <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-12 03:09:54 UTC |
Source: | https://github.com/cran/ACEsearch |
Attempts to connect to ACE instance using URL:PORT
ACEsearch.connect(url)
ACEsearch.connect(url)
url |
url address of a running ACE instance, usually containing port information |
data frame containing connection information used for all other accessory functions
ACEsearch.connect("http://localhost:8080")
ACEsearch.connect("http://localhost:8080")
Returns the statistics information
ACEsearch.contains(connection, patient_id)
ACEsearch.contains(connection, patient_id)
connection |
connection object returned from connect(url) function |
patient_id |
numerical id of the patient |
TRUE or FALSE
ACEsearch.contains(ACEsearch.connect('http://localhost:8080'), 123)
ACEsearch.contains(ACEsearch.connect('http://localhost:8080'), 123)
Queries ACE with a CSV() command and imports the contents of the csv into a data frame
ACEsearch.csv(connection, query, file_name = NULL)
ACEsearch.csv(connection, query, file_name = NULL)
connection |
connection object returned from connect(url) function |
query |
ACE CSV query |
file_name |
if specified, stores the csv into the file_name, otherwise the temporary file used to download the data will be deleted after the data.frame is generated |
data frame containing CSV file
ACEsearch.csv(ACEsearch.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)') ACEsearch.csv(ACEsearch.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)', '/output.csv')
ACEsearch.csv(ACEsearch.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)') ACEsearch.csv(ACEsearch.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)', '/output.csv')
Dumps patient from ACE to a file on disk
ACEsearch.dump(connection, patient_id, path, selection_query = NULL, contains_start = FALSE, contains_end = FALSE)
ACEsearch.dump(connection, patient_id, path, selection_query = NULL, contains_start = FALSE, contains_end = FALSE)
connection |
connection object returned from connect(url) function |
patient_id |
numerical id of the patient |
path |
path where to store the generated files |
selection_query |
returns only the part of patient's data that intersects with the result of the selection_query |
contains_start |
the dumped time interval's start has to be intersecting the selection_query |
contains_end |
the dumped time interval's end has to be intersecting the selection_query |
data frame containing patient IDs and time intervals (optional)
ACEsearch.dump(ACEsearch.connect('http://localhost:8080'), 123, '/path/to/dump/files/') ACEsearch.dump(ACEsearch.connect('http://localhost:8080'), 123, '/path/', 'ICD9=250.50', TRUE, TRUE)
ACEsearch.dump(ACEsearch.connect('http://localhost:8080'), 123, '/path/to/dump/files/') ACEsearch.dump(ACEsearch.connect('http://localhost:8080'), 123, '/path/', 'ICD9=250.50', TRUE, TRUE)
Queries ACE and returns a list of patient IDs
ACEsearch.query(connection, query, output_time = FALSE)
ACEsearch.query(connection, query, output_time = FALSE)
connection |
connection object returned from connect(url) function |
query |
ACE query |
output_time |
equivalent to wrapping the query in OUTPUT() command. Togerther with patient IDs outputs each time interval in patient's timeline when the query was evaluated as true |
data frame containing patient IDs and time intervals (optional)
ACEsearch.query(ACEsearch.connect('http://localhost:8080'), 'ICD9=250.50') ACEsearch.query(ACEsearch.connect('http://localhost:8080'), 'ICD9=250.50', TRUE)
ACEsearch.query(ACEsearch.connect('http://localhost:8080'), 'ICD9=250.50') ACEsearch.query(ACEsearch.connect('http://localhost:8080'), 'ICD9=250.50', TRUE)
Returns the status of the ACE search engine
ACEsearch.status(connection)
ACEsearch.status(connection)
connection |
connection object returned from connect(url) function |
data frame containing patient IDs and time intervals (optional)
ACEsearch.status(ACEsearch.connect('http://localhost:8080'))
ACEsearch.status(ACEsearch.connect('http://localhost:8080'))