Package 'ACEsearch'

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

Help Index


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'))