NAME

CohortExplorer::Command::Find - CohortExplorer class to find variables using keywords

SYNOPSIS

find [OPTIONS] [KEYWORD]

f [OPTIONS] [KEYWORD]

DESCRIPTION

This class is inherited from CLI::Framework::Command and overrides the following methods:

usage_text()

This method returns the usage information for the command.

option_spec()

( 
  [ 'ignore-case|i' => 'ignore case' ], 
  [ 'fuzzy|f' => 'fuzzy search'      ] 
)

validate( $opts, @args )

Validates the command options and arguments and throws exception if validation fails.

run( $opts, @args )

This method enables the user to search variables using keywords. The command looks for the presence of keywords in the columns specified under variable_structure method of the inherited datasource class. The command attempts to output the variable dictionary (i.e. meta data) of variables that are found. The variable dictionary can include the following variable attributes:

  1. variable name (mandatory)

  2. table name (mandatory)

  3. type (i.e. integer, decimal, date, datetime etc.)

  4. unit

  5. categories (if any)

  6. label

OPTIONS

-f, --fuzzy

Fuzzy search

-i, --ignore-case

Ignore case

DIAGNOSTICS

This command throws the following exceptions imported from CLI::Framework::Exceptions:

  1. throw_cmd_run_exception: This exception is thrown if one of the following conditions are met,

    • The select method from SQL::Abstract::More fails to construct the SQL from the supplied hash ref.

    • The method execute from DBI fails to execute the SQL query.

  2. throw_cmd_validation_exception: This exception is thrown only if no arguments (i.e. keywords) are supplied because this command requires at least one argument.

DEPENDENCIES

CLI::Framework::Command

CLI::Framework::Exceptions

DBI

Exception::Class::TryCatch

SQL::Abstract::More

EXAMPLES

find --fuzzy --ignore-case cancer diabetes (fuzzy and case insensitive search)

find Demographics (exact search)

find -fi mmHg (options with bundling and aliases)

SEE ALSO

CohortExplorer

CohortExplorer::Datasource

CohortExplorer::Command::Describe

CohortExplorer::Command::History

CohortExplorer::Command::Query::Search

CohortExplorer::Command::Query::Compare

LICENSE AND COPYRIGHT

Copyright (c) 2013-2014 Abhishek Dixit (adixit@cpan.org). All rights reserved.

This program is free software: you can redistribute it and/or modify it under the terms of either:

  • the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or

  • the "Artistic Licence".

AUTHOR

Abhishek Dixit