Class: I2CE CustomReport: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 2: Line 2:
*Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]].
*Extends the class: [[Class: I2CE_Fuzzy | I2CE_Fuzzy]].
*Location: Part of the module [[I2CE Module List#CustomReports|CustomReports]] in the package [https://launchpad.net/i2ce I2CE]
*Location: Part of the module [[I2CE Module List#CustomReports|CustomReports]] in the package [https://launchpad.net/i2ce I2CE]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.1-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php modules/CustomReports/lib/I2CE_CustomReport.php]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L29 modules/CustomReports/lib/I2CE_CustomReport.php] on line 29
*Author: Carl Leitner <litlfred@ibiblio.org>
*Author: Carl Leitner <litlfred@ibiblio.org>
I2CE_CustomReport
I2CE_CustomReport
Line 8: Line 8:
===$config===
===$config===
The magic data node holding the configuration information for this report $var protected I2CE_MagicDataNode $config
The magic data node holding the configuration information for this report $var protected I2CE_MagicDataNode $config
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L35 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 35
*Type: protected $config
*Type: protected $config


===$table===
===$table===
$var protected string $table the name of the cached  table of the report
$var protected string $table the name of the cached  table of the report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L42 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 42
*Type: protected $table
*Type: protected $table


===$tmp_table===
===$tmp_table===
$var protected string $tmp_table the temporary name of the cached  table of the report
$var protected string $tmp_table the temporary name of the cached  table of the report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L47 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 47
*Type: protected $tmp_table
*Type: protected $tmp_table


===$db===
===$db===
The instance of the database to perform queries on.
The instance of the database to perform queries on.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L52 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 52
*Type: protected MDB2 $db
*Type: protected MDB2 $db


===$populate_queries===
===$populate_queries===
an array of queries used to populate the cached reports table(s)
an array of queries used to populate the cached reports table(s)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L58 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 58
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $populate_queries
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $populate_queries


===$init_queries===
===$init_queries===
an array of queries used to inialize the cached reports table(s)
an array of queries used to inialize the cached reports table(s)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L63 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 63
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $init_queries
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $init_queries


===$get_field_def===
===$get_field_def===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L108 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 108
*Type: protected MDB2_PreparedStatement $get_field_def
*Type: protected MDB2_PreparedStatement $get_field_def


===$report_table_cols===
===$report_table_cols===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L111 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 111
*Type: static protected $report_table_cols
*Type: static protected $report_table_cols


===$hooman===
===$hooman===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L231 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 231
*Type: static protected $hooman
*Type: static protected $hooman


===$reportedFunctions===
===$reportedFunctions===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L459 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 459
*Type: protected $reportedFunctions
*Type: protected $reportedFunctions


Line 45: Line 55:
===__construct()===
===__construct()===
The constructor
The constructor
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L69 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 69
*Signature: public function __construct($report)
*Signature: public function __construct($report)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $report <br/>The report name
** [http://www.php.net/manual/en/language.types.string.php string ] $report <br/>The report name
===_generateCache()===
===_generateCache()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L429 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 429
*Signature: protected function _generateCache()
*Signature: protected function _generateCache()
===generateCache()===
===generateCache()===
Below is the code to actually handle generation of reports Generate the cached report
Below is the code to actually handle generation of reports Generate the cached report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L370 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 370
*Signature: public function generateCache($force,$cache_forms)
*Signature: public function generateCache($force,$cache_forms)
*Parameters:
*Parameters:
Line 60: Line 73:
===getCachedTableName()===
===getCachedTableName()===
Below is the static code to actually handle checking/setting the status of a cached report
Below is the static code to actually handle checking/setting the status of a cached report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L158 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 158
*Signature: static public function getCachedTableName($report,$withDB,$table_prefix)
*Signature: static public function getCachedTableName($report,$withDB,$table_prefix)
*Parameters:
*Parameters:
Line 69: Line 83:
===getColumnsInReportTable()===
===getColumnsInReportTable()===
Get the actual columns in the cached report table
Get the actual columns in the cached report table
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L116 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 116
*Signature: static public function getColumnsInReportTable($report)
*Signature: static public function getColumnsInReportTable($report)
*Parameters:
*Parameters:
**$report  
**$report  
===getCreateField()===
===getCreateField()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L722 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 722
*Signature: protected function getCreateField($form,$field,$name)
*Signature: protected function getCreateField($form,$field,$name)
*Parameters:
*Parameters:
Line 79: Line 95:
**$name  
**$name  
===getFormRelationship()===
===getFormRelationship()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L101 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 101
*Signature: public function getFormRelationship()
*Signature: public function getFormRelationship()
===getFormsRequiredByReport()===
===getFormsRequiredByReport()===
Gets the forms required by the report @param string $report
Gets the forms required by the report @param string $report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L145 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 145
*Signature: public function getFormsRequiredByReport()
*Signature: public function getFormsRequiredByReport()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of string
===getLastGenerationTime()===
===getLastGenerationTime()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L343 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 343
*Signature: static public function getLastGenerationTime($report)
*Signature: static public function getLastGenerationTime($report)
*Parameters:
*Parameters:
Line 90: Line 109:
*Returns: mixed.<br/>False on failure, int the time the last report generation  on sucess
*Returns: mixed.<br/>False on failure, int the time the last report generation  on sucess
===getReportedFunctions()===
===getReportedFunctions()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L476 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 476
*Signature: protected function getReportedFunctions()
*Signature: protected function getReportedFunctions()
===getStatus()===
===getStatus()===
Get the status of the requested report
Get the status of the requested report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L247 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 247
*Signature: static public function getStatus($report,$hooman_readable)
*Signature: static public function getStatus($report,$hooman_readable)
*Parameters:
*Parameters:
Line 101: Line 122:
===hasFailed()===
===hasFailed()===
Checks to see if a report has failed in its generation
Checks to see if a report has failed in its generation
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L204 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 204
*Signature: static public function hasFailed($report)
*Signature: static public function hasFailed($report)
*Parameters:
*Parameters:
Line 107: Line 129:
===isStale()===
===isStale()===
Check to see if a report is stale.
Check to see if a report is stale.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L291 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 291
*Signature: static public function isStale($report)
*Signature: static public function isStale($report)
*Parameters:
*Parameters:
Line 112: Line 135:
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]<br/>true/false
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]<br/>true/false
===processReportingFunctions()===
===processReportingFunctions()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L462 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 462
*Signature: protected function processReportingFunctions()
*Signature: protected function processReportingFunctions()
===reportExists()===
===reportExists()===
Checks to see if a report exists
Checks to see if a report exists
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L191 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 191
*Signature: static public function reportExists($report)
*Signature: static public function reportExists($report)
*Parameters:
*Parameters:
Line 121: Line 146:
===setStatus()===
===setStatus()===
Set the status us a report.
Set the status us a report.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L279 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 279
*Signature: static public function setStatus($report,$status)
*Signature: static public function setStatus($report,$status)
*Parameters:
*Parameters:
Line 126: Line 152:
** [http://www.php.net/manual/en/language.types.string.php string ] $status
** [http://www.php.net/manual/en/language.types.string.php string ] $status
===setupQueries()===
===setupQueries()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L502 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 502
*Signature: protected function setupQueries()
*Signature: protected function setupQueries()
==Inherited Methods==
==Inherited Methods==

Revision as of 08:48, 10 November 2009

This article describes the class I2CE_CustomReport.

I2CE_CustomReport

Variables

$config

The magic data node holding the configuration information for this report $var protected I2CE_MagicDataNode $config

$table

$var protected string $table the name of the cached table of the report

$tmp_table

$var protected string $tmp_table the temporary name of the cached table of the report

$db

The instance of the database to perform queries on.

$populate_queries

an array of queries used to populate the cached reports table(s)

$init_queries

an array of queries used to inialize the cached reports table(s)

$get_field_def

$report_table_cols

$hooman

$reportedFunctions

Methods

__construct()

The constructor

_generateCache()

generateCache()

Below is the code to actually handle generation of reports Generate the cached report

  • Defined in i2ce/modules/CustomReports/lib/I2CE_CustomReport.php on line 370
  • Signature: public function generateCache($force,$cache_forms)
  • Parameters:
    • boolean $force
      Defaults to false. If set to true, it will force the regeneration of the report if it is in_progress
      • Default Value: false
    • boolean $cache_forms
      Defaults to True. If set to true, it will cache the forms required by this report
      • Default Value: true

getCachedTableName()

Below is the static code to actually handle checking/setting the status of a cached report

getColumnsInReportTable()

Get the actual columns in the cached report table

getCreateField()

getFormRelationship()

getFormsRequiredByReport()

Gets the forms required by the report @param string $report

getLastGenerationTime()

getReportedFunctions()

getStatus()

Get the status of the requested report

  • Defined in i2ce/modules/CustomReports/lib/I2CE_CustomReport.php on line 247
  • Signature: static public function getStatus($report,$hooman_readable)
  • Parameters:
    • string $report @param boolean hooman_readable defaults to false.
    • $hooman_readable
      • Default Value: false
  • Returns: string
    'does_not_exist','not_generated','generated','failed','in_progress', 'stale' if it is not hooman readable *

hasFailed()

Checks to see if a report has failed in its generation

isStale()

Check to see if a report is stale.

processReportingFunctions()

reportExists()

Checks to see if a report exists

setStatus()

Set the status us a report.

setupQueries()

Inherited Methods

_hasMethod()

This public method is inherited from I2CE_Fuzzy->_hasMethod()

Inherited Fuzzy Methods

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()