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'                       ],
  [ 'and|a' => 'Join keywords using AND (default OR)' ] 
)

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 columns specified in variable_structure method of the sub class. The command attempts to print the variable dictionary (i.e. meta data) of variables meeting the search criteria. 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) separated by newline

  6. label

OPTIONS

-f, --fuzzy

Fuzzy search

-i, --ignore-case

Ignore case

-a, --and

Join keywords using AND (default OR)

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 query 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 if the user has not supplied any arguments/keywords to the command. The command expects 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 mmhg (fuzzy and case insensitive search)

find Demographics (exact search)

find -fia mmse total (using AND operation 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