A
download class.ReportsModule.php
Language: PHP
LOC: 63
Project Info
FreeMED Project(freemed)
Server: SourceForge
Type: cvs
...reemed\freemed\freemed\lib\
   acl.php
   API.php
   bcadd.php
   calendar-functions.php
   class.AdminModule.php
   class.Agata.php
   class.Authorizations.php
   class.BaseModule.php
   class.BillingModule.php
   class.CalendarModule.php
   class.ClaimLog.php
   class.Coverage.php
   class.Debug.php
   class.diagnosis_set.php
   class.Djvu.php
   class.EMRModule.php
   class.Fax.php
   class.FixedFormEntry.php
   ...s.FixedFormRenderer.php
   class.FormRenderer.php
   class.FreeMEDSelfTest.php
   class.GeneralConfig.php
   class.GraphModule.php
   class.Guarantor.php
   class.Handler_HL7v2.php
   ...s.Handler_HL7v2_A04.php
   ...s.Handler_HL7v2_A08.php
   ...s.Handler_HL7v2_S12.php
   ...s.Handler_HL7v2_S15.php
   class.InsuranceCompany.php
   class.LanguageRegistry.php
   class.Ledger.php
   ...s.MaintenanceModule.php
   class.Messages.php
   class.OMBS_Patient.php
   class.OMBS_Wrapper.php
   class.Parser_HL7v2.php
   class.Patient.php
   class.Payer.php
   class.PHPlot.php
   class.Physician.php
   class.Procedure.php
   class.RecordLock.php
   class.Remitt.php
   class.ReportsModule.php
   class.rxlist.php
   class.Scheduler.php
   class.TeX.php
   class.User.php
   class.UtilityModule.php
   class.vCalendar.php
   class.vCalendarEvent.php
   error_handler.php
   freemed.php
   i18n.php
   iso-set.php
   macros.php
   mail-functions.php
   settings.php
   settings.php.tmpl
   xml.php
   xmlrpc_services.php

<?php
	// $Id: class.ReportsModule.php,v 1.7 2005/02/14 17:41:26 rufustfirefly Exp $
	// $Author: rufustfirefly $

LoadObjectDependency('_FreeMED.BaseModule');

class ReportsModule extends BaseModule {

	var $CATEGORY_NAME = "Reports";
	var $CATEGORY_VERSION = "0.2";

	// vars to be passed from child modules
	var $form_vars;

	// user
	var $this_user;

	// contructor method
	function ReportsModule () {
		// call parent constructor
		$this->BaseModule();
	} // end function ReportsModule

	// override check_vars method
	function check_vars ($nullvar = "") {
		global $module;
		if (!isset($module)) 
		{
			trigger_error("Module not Defined", E_ERROR);
		}
		// FIXME!!: check access to facility
		//if (!freemed::check_access_for_patient($patient)) return false;
		return true;
	} // end function check_vars

	// function main
	// - generic main function
	function main ($nullvar = "") {
		global $display_buffer;
		global $action, $patient;

		if (!isset($this_user))
			$this->this_user = CreateObject('FreeMED.User');

		switch ($action) {

			case "display";
				$this->display();
				break;

			case "view":
			default:
				$this->view();
				// Create return links
				$display_buffer .= 
				template::link_bar(array(
				__("Reports") =>
				"reports.php",
				__("Return to Main Menu") =>
				"main.php"
				));
				break;
		} // end switch action

	} // end function main

	// ********************** MODULE SPECIFIC ACTIONS *********************

	// function display
	// by default, a wrapper for view
	function display () { $this->view(); }

	// function view
	// - view stub
	function view () { }

	// override _setup with create_table
	// Note: This has almost *no* application outside of limited
	//       tables that things like the qmaker reports module use.
	function _setup () {
		global $display_buffer;
		if (!$this->create_table()) return false;
		return freemed_import_stock_data ($this->table_name);
	} // end function _setup

	// function create_table
	// - used to initially create SQL table
	function create_table () {
		global $display_buffer;
		if (!isset($this->table_definition)) return false;
		$query = $GLOBALS['sql']->create_table_query(
			$this->table_name,
			$this->table_definition,
			( is_array($this->table_keys) ?
				array_merge(array("id"), $this->table_keys) :
				array("id")
			)
		);
		$result = $GLOBALS['sql']->query ($query);
		return !empty($result);
	} // end function create_table

} // end class ReportsModule

?>

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us