Returns a list of track names in the database.

emr_track.ls(
  ...,
  db_id = NULL,
  ignore.case = FALSE,
  perl = FALSE,
  fixed = FALSE,
  useBytes = FALSE
)

emr_track.global.ls(
  ...,
  ignore.case = FALSE,
  perl = FALSE,
  fixed = FALSE,
  useBytes = FALSE
)

emr_track.user.ls(
  ...,
  ignore.case = FALSE,
  perl = FALSE,
  fixed = FALSE,
  useBytes = FALSE
)

emr_track.logical.ls(
  ...,
  ignore.case = FALSE,
  perl = FALSE,
  fixed = FALSE,
  useBytes = FALSE
)

Arguments

...

these arguments are of either form 'pattern' or 'attribute = pattern'

db_id

db dir string (path), one of the paths supplied in emr_db.connect. If NULL - all track names would be returned.

ignore.case, perl, fixed, useBytes

see 'grep'

Value

An array that contains the names of tracks that match the supplied patterns.

Details

'emr_track.ls' returns a list of all tracks (global and user) in the database that match the pattern (see 'grep'). If called without any arguments all tracks are returned.

If pattern is specified without a track attribute (i.e. in the form of 'pattern') then filtering is applied to the track names. If pattern is supplied with a track attribute (i.e. in the form of 'name = pattern') then track attribute is matched against the pattern.

Multiple patterns are applied one after another. The resulted list of tracks should match all the patterns.

If db_id parameter is set, only tracks within the specific db would be shown. Note that tracks which were overridden by other databases would not be shown, even if their files exist within the database. See emr_db.connect for more details.

'emr_track.global.ls', 'emr_track.user.ls', 'emr_track.logical.ls' work similarly to 'emr_track.ls' but instead of returning all track names, each of them returns either global, local or logical tracks accordingly.

Examples


emr_db.init_examples()
#> NULL

# get all track names
emr_track.ls()
#> [1] "categorical_track" "dense_track"       "logical_track"    
#> [4] "patients.dob"      "sparse_track"     

# get track names that match the pattern "den*"
emr_track.ls("den*")
#> [1] "dense_track"

emr_track.attr.set("sparse_track", "gender", "female")
emr_track.attr.set("dense_track", "gender", "male")
emr_track.ls(gender = "")
#> [1] "dense_track"  "sparse_track"
emr_track.ls(gender = "female")
#> [1] "sparse_track"
emr_track.ls(gender = "^male")
#> [1] "dense_track"