CohortExplorer::Command::Query::Compare - CohortExplorer class to compare entities across visits
compare [OPTIONS] [VARIABLE]
c [OPTIONS] [VARIABLE]
The compare command enables the user to compare entities across visits. The user can also impose conditions on variables. Moreover, the command also enables the user to view summary statistics and export data in csv format. The command is only available to longitudinal datasources with data on at least 2 visits.
This class is inherited from CohortExplorer::Command::Query and overrides the following methods:
This method returns the usage information for the command.
This method returns a ref to the list containing all variables (including visit variables) for validating arguments and condition option(s).
This method returns a hash ref with keys, static, dynamic or both depending on the variables supplied as arguments and conditions. The value of each key is a hash containing SQL parameters such as -columns, -from, -where, -group_by and -having.
static
dynamic
-columns
-from
-where
-group_by
-having
This method writes result set into a csv file and returns a ref to the list containing entity_ids.
This method writes the table data into a csv file. The data includes entity_id of all entities present in the result set followed by values of all visit variables.
entity_id
This method returns a hash ref with entity_id as keys and variable name-value pairs as values. The statistics in this command are calculated with respect to entity_id and the number of observations for each variable is the number of times (or visits) each variable was recorded for each entity during the course of the study.
Provide directory to export data
Export table by name
Export all tables
Save command
Show summary statistics
Impose conditions using the operators: =, !=, >, <, >=, <=, between, not_between, like, not_like, ilike, in, not_in, regexp and not_regexp.
=
!=
>
<
>=
<=
between
not_between
like
not_like
ilike
in
not_in
regexp
not_regexp
The keyword undef can be used to specify null.
undef
The variables entity_id and visit (if applicable) must not be provided as arguments as they are already part of the query-set. However, the user can impose conditions on both variables. Other variables in arguments and conditions must be referenced as table.variable or visit.table.variable where visit = vAny, vLast, v1, v2, v3 ... vMax. Here vMax is the maximum visit number for which data is available. When a condition is imposed on a variable with no prefix such as vAny, vLast, v1, v2 and v3 the command assumes the condition applies to all visits of the variable.
visit
table.variable
visit.table.variable
vAny
vLast
v1
v2
v3
vMax
The directory specified in out option must have RWX enabled for CohortExplorer.
out
compare --out=/home/user/exports --stats --save-command --cond=v1.CER.Score='>, 20' v1.SC.Date compare --out=/home/user/exports --export=CER --cond=SD.Sex='=, Male' v1.CER.Score v3.DIS.Status compare --out=/home/user/exports --export=CER --cond=v2.CER.Score'!=, undef' vLast.DIS.Status compare -o/home/user/exports -Ssa -c vLast.CER.Score='in, 25, 30, 40' DIS.Status compare -o/home/user/exports -eCER -eSD -c vLast.CER.Score='between, 25, 30' DIS.Status
This class throws throw_cmd_run_exception exception imported from CLI::Framework::Exceptions if Text::CSV_XS fails to construct a csv string from the list containing variable values.
throw_cmd_run_exception
CohortExplorer
CohortExplorer::Datasource
CohortExplorer::Command::Describe
CohortExplorer::Command::Find
CohortExplorer::Command::History
CohortExplorer::Command::Query::Search
CohortExplorer::Command::Query::Compare
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".
Abhishek Dixit
To install CohortExplorer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CohortExplorer
CPAN shell
perl -MCPAN -e shell install CohortExplorer
For more information on module installation, please visit the detailed CPAN module installation guide.