EMRModule(); } // end constructor QuickmedsModule // The EMR box; probably the most important part of this module function summary ($patient, $dummy_items) { // Get patient object from global scope (if it exists) if (isset($GLOBALS[this_patient])) { global $this_patient; } else { $this_patient = CreateObject('FreeMED.Patient', $patient); } // Check to see if we *can* generate a statement for this // patient $query = "SELECT COUNT(id) AS count FROM procrec ". "WHERE procpatient='".addslashes($patient)."' ". "AND procbalcurrent > 0 ". "AND proccurcovtp = '0'"; $result = $GLOBALS['sql']->query( $query ); $r = $GLOBALS['sql']->fetch_array ( $result ); if ($r['count'] < 1) { $buffer .= "
".__("This patient does not have any statements to generate.")."
"; return $buffer; } $buffer .= "
MODULE_CLASS)."\"/>
"; return $buffer; } // end function QuickmedsModule->summary // view actually prints function view ( ) { $agata = CreateObject('FreeMED.Agata'); $agata->CreateReport( 'Merge', 'patient_statement', 'Patient Statement', array ("'where' = 'where'" => "pat.id = '". addslashes($_REQUEST['patient'])."'" ) ); switch ($_REQUEST['output']) { case _("PDF"): $agata->ServeMergeAsPDF(); break; // pdf case _("Postscript"): $agata->ServeReport(); break; // ps } // end } // end redirect view action // Disable summary bar function summary_bar() { } } // end class SinglePatientStatement register_module ("SinglePatientStatement"); ?>