Type: | Package |
Title: | 'ACE' Search Engine API |
Version: | 1.0.0 |
Author: | Vladimir Polony |
Date: | 2020-09-09 |
Maintainer: | Vladimir Polony <podalv@gmail.com> |
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. |
License: | MIT + file LICENSE |
URL: | https://shahlab.stanford.edu/start |
Imports: | httr, testthat |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.0.1.9000 |
NeedsCompilation: | no |
Packaged: | 2020-09-24 16:11:54 UTC; podalv |
Repository: | CRAN |
Date/Publication: | 2020-09-28 09:40:06 UTC |
Connects to ACE instance
Description
Attempts to connect to ACE instance using URL:PORT
Usage
ACEsearch.connect(url)
Arguments
url |
url address of a running ACE instance, usually containing port information |
Value
data frame containing connection information used for all other accessory functions
Examples
ACEsearch.connect("http://localhost:8080")
Returns whether patient with the specified patient_id exists
Description
Returns the statistics information
Usage
ACEsearch.contains(connection, patient_id)
Arguments
connection |
connection object returned from connect(url) function |
patient_id |
numerical id of the patient |
Value
TRUE or FALSE
Examples
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
Description
Queries ACE with a CSV() command and imports the contents of the csv into a data frame
Usage
ACEsearch.csv(connection, query, file_name = NULL)
Arguments
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 |
Value
data frame containing CSV file
Examples
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
Description
Dumps patient from ACE to a file on disk
Usage
ACEsearch.dump(connection, patient_id, path, selection_query = NULL,
contains_start = FALSE, contains_end = FALSE)
Arguments
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 |
Value
data frame containing patient IDs and time intervals (optional)
Examples
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
Description
Queries ACE and returns a list of patient IDs
Usage
ACEsearch.query(connection, query, output_time = FALSE)
Arguments
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 |
Value
data frame containing patient IDs and time intervals (optional)
Examples
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
Description
Returns the status of the ACE search engine
Usage
ACEsearch.status(connection)
Arguments
connection |
connection object returned from connect(url) function |
Value
data frame containing patient IDs and time intervals (optional)
Examples
ACEsearch.status(ACEsearch.connect('http://localhost:8080'))