DataFax::StudyDB - DataFax DFstudies.db parser
use DataFax::StudyDB; my $db = DataFax::StudyDB->new('datafax_dir'=>'/opt/datafax', 'datafax_host'=>'mydfsvr'); # or my $db = new DataFax::StudyDB 'datafax_dir'=>'/opt/datafax', 'datafax_host'=>'mydfsvr';
This class locates DataFax DFstudies.db, parse it and load it to a relational database such as Oracle.
Input variables:
datafax_dir - full path to where DataFax system is installled If not specified, it will try to get it from $ENV{DATAFAX_DIR}. datafax_host - DataFax server name or IP address If not specified, it will try to get it from $ENV{DATAFAX_HOST} or `hostname` on UNIX system.
Variables used or routines called:
None
How to use:
my $db = DataFax::StudyDB->new('datafax_dir'=>'/opt/datafax', 'datafax_host'=>'mydfsvr'); Return: an empty or initialized class object.
This method constructs a Perl object and capture any parameters if specified. It creates and defaults the following variables:
datafax_dir = $ENV{DATAFAX_DIR} datafax_host = $ENV{DATAFAX_HOST} | `hostname` unix_os = 'linux|solaris'
The :all tag includes the all the methods in this module.
use DataFax::StudyDB qw(:all);
It includes the following sub-routines:
$ifn - input file name $ar - a parameter array ref source_dir - source directory datafax_dir - DataFax directory datafax_host - DataFax server name/IP address real_time - whether to ge real time data
DataFax::StudySubs get_dfparam - get parameters
my $s = new DataFax::StudyDB; my $ifn = '/opt/datafax/lib/DFstudies.db'; my $pr = { real_time=>1,datafax_host=>'df_svr', datafax_usr=>'datafax', datafax_pwd=>'secret'}; my ($c, $d) = $s->readDFstudies{$ifn); my ($c, $d) = $s->readDFstudies{"", $pr);
Return: ($c,$d) where $c is an array ref while $d is hash ref.
$c->[$i][$j] - array ref where $i is row number and $j is column number; $i=0 - the first row contains the column names in the following order study_number,study_title,client_name,study_dir, source_dir,datafax_dir,host_name,rpc_program, rpc_program_no,rpc_version_no,study_status,comments $d->{$sn}{$itm} hash ref where $sn is three-digit study number padding with leading zeros $itm is column names as listed in $c->[0].
This method reads DFstudies and parse the file into two arrays.
Version 0.10
This version is to create a method to read in DFstudies.db.
0.11 - use new method from DataFax
Version 0.20
Oracle::Loader, Oracle::Trigger, CGI::Getopt, File::Xcopy, DataFax, CGI::AppBuilder, etc.
Copyright (c) 2005 Hanming Tu. All rights reserved.
This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install DataFax::StudyDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DataFax::StudyDB
CPAN shell
perl -MCPAN -e shell install DataFax::StudyDB
For more information on module installation, please visit the detailed CPAN module installation guide.