Title: | Stanford 'ATLAS' Search Engine API |
---|---|
Description: | Stanford 'ATLAS' (Advanced Temporal Search 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 'ATLAS' 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: | GPL-3 |
Version: | 1.0.0 |
Built: | 2025-01-26 04:25:48 UTC |
Source: | https://github.com/cran/atlas |
Attempts to connect to ATLAS instance using URL:PORT
atlas.connect(url)
atlas.connect(url)
url |
url address of a running ATLAS instance, usually containing port information |
data frame containing connection information used for all other accessory functions
atlas.connect("http://localhost:8080")
atlas.connect("http://localhost:8080")
Returns the statistics information
atlas.contains(connection, patient_id)
atlas.contains(connection, patient_id)
connection |
connection object returned from connect(url) function |
patient_id |
numerical id of the patient |
TRUE or FALSE
atlas.contains(atlas.connect('http://localhost:8080'), 123)
atlas.contains(atlas.connect('http://localhost:8080'), 123)
Queries ATLAS with a CSV() command and imports the contents of the csv into a data frame
atlas.csv(connection, query, file_name = NULL)
atlas.csv(connection, query, file_name = NULL)
connection |
connection object returned from connect(url) function |
query |
ATLAS 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
atlas.csv(atlas.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)') atlas.csv(atlas.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)', '/output.csv')
atlas.csv(atlas.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)') atlas.csv(atlas.connect('http://localhost:8080'), 'CSV(ICD9=250.50, CPT, LABS, ICD9)', '/output.csv')
Dumps patient from ATLAS to a file on disk
atlas.dump(connection, patient_id, path, selection_query = NULL, contains_start = FALSE, contains_end = FALSE)
atlas.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)
atlas.dump(atlas.connect('http://localhost:8080'), 123, '/path/to/dump/files/') atlas.dump(atlas.connect('http://localhost:8080'), 123, '/path/', 'ICD9=250.50', TRUE, TRUE)
atlas.dump(atlas.connect('http://localhost:8080'), 123, '/path/to/dump/files/') atlas.dump(atlas.connect('http://localhost:8080'), 123, '/path/', 'ICD9=250.50', TRUE, TRUE)
Queries ATLAS and returns a list of patient IDs
atlas.query(connection, query, output_time = FALSE)
atlas.query(connection, query, output_time = FALSE)
connection |
connection object returned from connect(url) function |
query |
ATLAS 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)
atlas.query(atlas.connect('http://localhost:8080'), 'ICD9=250.50') atlas.query(atlas.connect('http://localhost:8080'), 'ICD9=250.50', TRUE)
atlas.query(atlas.connect('http://localhost:8080'), 'ICD9=250.50') atlas.query(atlas.connect('http://localhost:8080'), 'ICD9=250.50', TRUE)
Returns the status of the ATLAS
atlas.status(connection)
atlas.status(connection)
connection |
connection object returned from connect(url) function |
data frame containing patient IDs and time intervals (optional)
atlas.status(atlas.connect('http://localhost:8080'))
atlas.status(atlas.connect('http://localhost:8080'))