Class: I2CE CustomReport (4.1.4): Difference between revisions

From IHRIS Wiki
(Created page with "{{otherversions|Class: I2CE_CustomReport}} This article describes the class ''I2CE_CustomReport'' . *Extends the class: I2CE_Fuzzy. *Location: Par...")
 
No edit summary
 
Line 31: Line 31:
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L58 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 58
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-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
===$id_length===
The length for the id and parent columns in cached report tables.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L63 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 63
*Type: protected integer $id_length


===$get_field_def===
===$get_field_def===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L102 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 102
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L109 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 109
*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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L105 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 105
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L112 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 112
*Type: static protected $report_table_cols
*Type: static protected $report_table_cols


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


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


Line 51: Line 56:
===__construct()===
===__construct()===
The constructor
The constructor
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L65 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 65
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L70 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 70
*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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L463 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 463
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L470 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 470
*Signature: protected function _generateCache()
*Signature: protected function _generateCache()
===dropTable()===
===dropTable()===
Drop the zebra_XXX table
Drop the zebra_XXX table
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L452 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 452
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L459 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 459
*Signature: public function dropTable($update_status)
*Signature: public function dropTable($update_status)
*Parameters:
*Parameters:
Line 67: Line 72:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L390 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 390
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L397 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 397
*Signature: public function generateCache($force,$cache_forms)
*Signature: public function generateCache($force,$cache_forms)
*Parameters:
*Parameters:
Line 76: Line 81:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L152 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 152
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L159 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 159
*Signature: static public function getCachedTableName($report,$withDB,$table_prefix,$counter)
*Signature: static public function getCachedTableName($report,$withDB,$table_prefix,$counter)
*Parameters:
*Parameters:
Line 88: Line 93:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L110 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 110
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L117 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 117
*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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L1107 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 1107
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L1114 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 1114
*Signature: protected function getCreateField($form,$field,$name)
*Signature: protected function getCreateField($form,$field,$name)
*Parameters:
*Parameters:
Line 100: Line 105:
**$name  
**$name  
===getFormRelationship()===
===getFormRelationship()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L95 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 95
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L102 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 102
*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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L139 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 139
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L146 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 146
*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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L363 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 363
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L370 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 370
*Signature: static public function getLastGenerationTime($report)
*Signature: static public function getLastGenerationTime($report)
*Parameters:
*Parameters:
Line 115: Line 120:
===getQueryAsName()===
===getQueryAsName()===
Return the array or string with the portion before the ' AS ' removed.
Return the array or string with the portion before the ' AS ' removed.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L600 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 600
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L607 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 607
*Signature: static public function getQueryAsName($selects)
*Signature: static public function getQueryAsName($selects)
*Parameters:
*Parameters:
Line 121: Line 126:
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===getReportedFunctions()===
===getReportedFunctions()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L553 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 553
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L560 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 560
*Signature: protected function getReportedFunctions()
*Signature: protected function getReportedFunctions()
===getReports()===
===getReports()===
Get all available report
Get all available report
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L187 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 187
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L194 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 194
*Signature: static public function getReports()
*Signature: static public function getReports()
===getSingleQueryAsName()===
===getSingleQueryAsName()===
Return the named as value for a select query. e.g. `demographic`.`id` AS `demographic+id` would return `demographic+id`
Return the named as value for a select query. e.g. `demographic`.`id` AS `demographic+id` would return `demographic+id`
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L585 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 585
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L592 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 592
*Signature: static public function getSingleQueryAsName($select)
*Signature: static public function getSingleQueryAsName($select)
*Parameters:
*Parameters:
Line 136: Line 141:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L267 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 267
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L274 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 274
*Signature: static public function getStatus($report,$hooman_readable)
*Signature: static public function getStatus($report,$hooman_readable)
*Parameters:
*Parameters:
Line 145: Line 150:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L209 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 209
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L216 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 216
*Signature: static public function hasFailed($report)
*Signature: static public function hasFailed($report)
*Parameters:
*Parameters:
Line 151: Line 156:
*Returns: mixed.<br/>True if it has failed, false if it has not failed, null if the report does not exist.
*Returns: mixed.<br/>True if it has failed, false if it has not failed, null if the report does not exist.
===hooman()===
===hooman()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L238 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 238
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L245 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 245
*Signature: static protected function hooman($key)
*Signature: static protected function hooman($key)
*Parameters:
*Parameters:
Line 157: Line 162:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L311 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 311
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L318 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 318
*Signature: static public function isStale($report)
*Signature: static public function isStale($report)
*Parameters:
*Parameters:
Line 164: Line 169:
===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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L196 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 196
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L203 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 203
*Signature: static public function reportExists($report)
*Signature: static public function reportExists($report)
*Parameters:
*Parameters:
Line 171: Line 176:
===setStatus()===
===setStatus()===
Set the status us a report.
Set the status us a report.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L299 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 299
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L306 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 306
*Signature: static public function setStatus($report,$status)
*Signature: static public function setStatus($report,$status)
*Parameters:
*Parameters:
Line 177: Line 182:
** [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.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L610 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 610
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1.4-release/annotate/head:/modules/CustomReports/lib/I2CE_CustomReport.php#L617 i2ce/modules/CustomReports/lib/I2CE_CustomReport.php] on line 617
*Signature: protected function setupQueries()
*Signature: protected function setupQueries()
==Inherited Methods==
==Inherited Methods==

Latest revision as of 10:25, 27 July 2012


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)

$id_length

The length for the id and parent columns in cached report tables.

$get_field_def

$report_table_cols

$hooman

$reportedFunctions

Methods

__construct()

The constructor

_generateCache()

dropTable()

Drop the zebra_XXX table

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 397
  • 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

  • Defined in i2ce/modules/CustomReports/lib/I2CE_CustomReport.php on line 159
  • Signature: static public function getCachedTableName($report,$withDB,$table_prefix,$counter)
  • Parameters:
    • $report
    • $withDB
      • Default Value: true
    • $table_prefix
      • Default Value:
    • $counter
      • Default Value: false

getColumnsInReportTable()

Get the actual columns in the cached report table

getCreateField()

getFormRelationship()

getFormsRequiredByReport()

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

getLastGenerationTime()

getQueryAsName()

Return the array or string with the portion before the ' AS ' removed.

getReportedFunctions()

getReports()

Get all available report

getSingleQueryAsName()

Return the named as value for a select query. e.g. `demographic`.`id` AS `demographic+id` would return `demographic+id`

getStatus()

Get the status of the requested report

  • Defined in i2ce/modules/CustomReports/lib/I2CE_CustomReport.php on line 274
  • 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

hooman()

isStale()

Check to see if a report is stale.

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()