// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class RouteOfAdministration extends SupportModule
{
    var $MODULE_NAME = "Route of Administration";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "ff8d557b-2e55-4ed0-8733-7a3f05a143e5";
    var $MODULE_HIDDEN = true;
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "routeofadmin";
    var $widget_hash = '##display_value## (##abbrev##)';
    public function __construct()
    {
        // Call parent constructor
        parent::__construct();
    }
}
// end class RouteOfAdministration
register_module("RouteOfAdministration");
Example #2
0
                } else {
                    if ($cov['covtype'] + 0 == 2) {
                        $proc_data['proccov2'] = $cov['id'];
                    } else {
                        if ($cov['covtype'] + 0 == 3) {
                            $proc_data['proccov3'] = $cov['id'];
                        } else {
                            if ($cov['covtype'] + 0 == 4) {
                                $proc_data['proccov4'] = $cov['id'];
                            }
                        }
                    }
                }
                $proc->add($proc_data);
            }
        }
    }
    // end method add_post
    public function getEncountersList($ptid)
    {
        $query = "SELECT en.id,en.pnotesdt AS note_date,en.pnotesdescrip AS note_desc,en.pnotestype AS note_type, u.userdescrip AS user FROM enotes en " . " LEFT OUTER JOIN user u ON u.id=en.pnotesuser WHERE en.pnotespat=" . $GLOBALS['sql']->quote($ptid);
        return $GLOBALS['sql']->queryAll($query);
    }
    public function getEncounterNoteInfo($enid)
    {
        $query = "SELECT * FROM enotes WHERE id=" . $GLOBALS['sql']->quote($enid);
        return $GLOBALS['sql']->queryRow($query);
    }
}
register_module("EncounterNotes");
    // Returns:
    //
    //	Array of hashes
    //
    public function getUncompletedItems($patient = NULL)
    {
        $u = freemed::user_cache();
        $q = "select mfc.id,p.id as patient_id,date(mfc.stamp) as stamp,mfct.name as status_name,mfct.module as status_module,'Incomplete Form' as summary,'form_incomplete' as type,CONCAT( p.ptlname, ', ', p.ptfname, ' ', p.ptmname ) AS patient_name from " . $this->table_name . " mfc left join patient p on p.id = mfc.patient left join module_field_checker_type mfct on mfct.id = mfc.module_type where status_completed=0 and user = "******" and mfc.patient=" . $GLOBALS['sql']->quote($patient) : " ");
        return $GLOBALS['sql']->queryAll($q);
    }
    // end method getUncompletedItems
    // Method: getUncompletedItemsCount
    //
    //	evaluates uncompleted items  count
    //
    //
    // Returns:
    //
    //	integer
    //
    public function getUncompletedItemsCount($patient = NULL)
    {
        $u = freemed::user_cache();
        $q = "select count(*) as count from " . $this->table_name . " mfc where mfc.status_completed=0 and mfc.user = "******" and mfc.patient=" . $GLOBALS['sql']->quote($patient) : " ");
        $return = $GLOBALS['sql']->queryRow($q);
        return $return['count'];
    }
}
// end class ModuleFieldChecker
register_module("ModuleFieldChecker");
Example #4
0
class ReportingPrintLog extends SupportModule
{
    var $MODULE_NAME = "Reporting Print Log";
    var $MODULE_VERSION = "0.8.4";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "b0f7d606-0b7c-4ffe-8105-a68c6f099ee2";
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "reporting_print_log";
    var $variables = array('report_name', 'report_params', 'report_format', 'user');
    public function __construct()
    {
        // __("Call-in Patients")
        // Call parent constructor
        parent::__construct();
    }
    // end constructor Callin
    protected function add_pre(&$data)
    {
        unset($data['stamp']);
        $data['user'] = freemed::user_cache()->user_number;
    }
    // end method add_pre
    public function GetAllRecords()
    {
        $user = freemed::user_cache()->user_number;
        $q = "SELECT * from " . $this->table_name . " WHERE user =" . $GLOBALS['sql']->quote($user);
        return $GLOBALS['sql']->queryAll($q);
    }
}
register_module('ReportingPrintLog');
Example #5
0
 /**
  * ADD MODULES
  */
 $preInstalledTools = array('CLDSC', 'CLCAL', 'CLANN', 'CLDOC', 'CLQWZ', 'CLLNP', 'CLWRK', 'CLFRM', 'CLGRP', 'CLUSR', 'CLWIKI');
 if (file_exists(get_path('rootSys') . 'module')) {
     $moduleDirIterator = new DirectoryIterator(get_path('rootSys') . 'module');
     foreach ($moduleDirIterator as $moduleDir) {
         if ($moduleDir->isDir() && !$moduleDir->isDot()) {
             $preInstalledTools[] = $moduleDir->getFilename();
         }
     }
 }
 foreach ($preInstalledTools as $claroLabel) {
     $modulePath = get_module_path($claroLabel);
     if (file_exists($modulePath)) {
         $moduleId = register_module($modulePath);
         if (false !== activate_module($moduleId)) {
             trigger_error('module (id:' . $moduleId . ' ) not activated ', E_USER_WARNING);
         }
     } else {
         trigger_error('module path not found', E_USER_WARNING);
     }
 }
 // init default right profile
 init_default_right_profile();
 /***
  * Generate module conf from definition files.
  */
 $config_code_list = get_config_code_list('module');
 if (is_array($config_code_list)) {
     foreach ($config_code_list as $config_code) {
Example #6
0
    public function ProcessSuperbills($superbills = 0)
    {
        if ($superbills == 0) {
            $query = "SELECT * FROM " . $this->table_name . " WHERE processed = 0 AND reviewed > 0";
        } else {
            // Use enumerated superbill ids
            $query = "SELECT * FROM " . $this->table_name . " WHERE FIND_IN_SET( id, " . $GLOBALS['sql']->quote(join(',', $superbills)) . " )";
        }
        $s = $GLOBALS['sql']->queryAll($query);
        foreach ($s as $bill) {
            $dxs = explode(',', $bill['dx']);
            $pxs = explode(',', $bill['procs']);
            $detail = unserialize($bill['detail']);
            foreach ($pxs as $px) {
                // Get current coverages
                // Calculate charges
                // Create database insert
                $ins = $GLOBALS['sql']->insert_query('procrec', array('procpatient' => $bill['patient'], 'proccpt' => $px, 'procdiag1' => $dx[0], 'procdiag2' => $dx[1], 'procdiag3' => $dx[2], 'procdiag4' => $dx[3], 'procbillable' => 1, 'procbilled' => 0, 'procamtpaid' => 0));
                $result = $GLOBALS['sql']->query($ins);
            }
            // end foreach procedure
            // Mark superbill as processed
            $query = $GLOBALS['sql']->update_query($this->table_name, array('processed' => freemed::user_cache()->user_number), array('id' => $id + 0));
        }
        // end foreach superbill
        return true;
    }
}
// end class SuperBill
register_module("SuperBill");
Example #7
0
    {
        $url = "https://nppes.cms.hhs.gov/NPPES/NPIRegistrySearch.do?searchType=ind&lastName=" . urlencode($last_name) . "&firstName=" . urlencode($first_name) . "&state=" . urlencode(strtoupper($state));
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $f = curl_exec($ch);
        //print "length = ".strlen($f)."\n";
        if (strpos($f, 'No matching records found.') !== false) {
            syslog(LOG_DEBUG, "LookupNPI: No matching records found for {$first_name}, {$last_name}, {$state}");
            return false;
        }
        $hash = explode("\n", $f);
        foreach ($hash as $k => $h) {
            if (strpos($h, '>NPI:<')) {
                //print "Found 'NPI:'\n";
                $npi_at = $k + 1;
                break;
            }
        }
        if ($npi_at) {
            preg_match('/>([^<]+)<\\//i', $hash[$npi_at], $match);
            return $match[1];
        } else {
            return false;
        }
    }
}
// end class ProviderModule
register_module("ProviderModule");
Example #8
0
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class Bccdc extends SupportModule
{
    var $MODULE_NAME = "BC-CDC Vaccination Codes";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "06ac950c-bead-4e26-8020-08c5abba9602";
    var $MODULE_HIDDEN = true;
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "bccdc";
    var $widget_hash = '##description## (##agent_code##)';
    public function __construct()
    {
        // Call parent constructor
        parent::__construct();
    }
}
// end class Bccdc
register_module("Bccdc");
Example #9
0
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class DocumentCategory extends SupportModule
{
    var $MODULE_NAME = "Document Categorization";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "b9b6c952-c88f-473f-96bf-bacf1a23e439";
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $record_name = "Document Category";
    var $table_name = "documents_tc";
    var $widget_hash = '##description##';
    var $variables = array("type", "category", "description");
    public function __construct()
    {
        // i18n: __("Document Category")
        $this->list_view = array(__("Type") => "type", __("Category") => "category", __("Description") => "description");
        parent::__construct();
    }
}
// end class DocumentCategory
register_module("DocumentCategory");
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class CalendarGroupAttendance extends SupportModule
{
    var $MODULE_NAME = "Calendar Group Attendance";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "ed245f1f-f724-4741-9bc3-3f8fc0ce81b6";
    var $MODULE_HIDDEN = true;
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "calgroupattend";
    var $variables = array('calgroupid', 'calid', 'patientid', 'calstatus');
    public function __construct()
    {
        // __("Call-in Patients")
        // Call parent constructor
        parent::__construct();
    }
    // end constructor Callin
    protected function add_pre(&$data)
    {
    }
    // end method add_pre
    protected function del_pre(&$data)
    {
    }
}
register_module('CalendarGroupAttendance');
Example #11
0
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "884f604b-b5c0-475a-9cfa-5c912111f80e";
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $record_name = "CPT Codes";
    var $table_name = "cpt";
    var $order_fields = "cptcode";
    var $widget_hash = "##cptcode## ##cptnameint##";
    var $archive_field = "cptarchive";
    public function __construct()
    {
        $this->variables = array("cptcode", "cptnameint", "cptnameext", "cptgender", "cpttaxed", "cpttype", "cptreqcpt", "cptexccpt", "cptreqicd", "cptexcicd", "cptrelval", "cptdeftos", "cptdefstdfee", "cptstdfee", "cpttos", "cpttosprfx", "cptarchive");
        $this->list_view = array(__("Procedural Code") => "cptcode", __("Internal Description") => "cptnameint", __("External Description") => "cptnameext");
        // Run parent constructor
        parent::__construct();
    }
    // end constructor CptCodes
    protected function add_pre(&$data)
    {
        $d['cptstdfee'] = serialize($d['cptstdfee']);
        $d['cpttos'] = serialize($d['cpttos']);
    }
    protected function mod_pre(&$data)
    {
        $d['cptstdfee'] = serialize($d['cptstdfee']);
        $d['cpttos'] = serialize($d['cpttos']);
    }
}
// end class CptCodes
register_module("CptCodes");
Example #12
0
    // end method RemoveOldCoverage
    // Method: GetCoverages
    //
    //	Get primary coverage for a patient.
    //
    // Parameters:
    //
    //	$patient - Patient ID
    //
    // Returns:
    //
    //	hash
    //
    public function GetPrimaryCoverage($patient)
    {
        //$q = "SELECT i.insconame as insuranceName, c.covpatinsno as policyNo,CASE WHEN c.covrel='S' THEN CONCAT(p.ptfname,',',p.ptlname,' ',p.ptmname) ELSE CONCAT(c.covfname,',',c.covlname,' ',c.covmname) END as CardHolderName,covrel as relationToPatient,CASE WHEN c.covrel='S' THEN p.ptdob ELSE c.covdob END as policyHolderDOB, c.coveffdt as effectiveDate, c.covdeduct as deductible,a.authnum as authorization,a.authdtbegin as effectDateOfAuth,c.covcopay as copay,a.authtype as typeofAuth FROM coverage c LEFT OUTER JOIN insco i ON c.covinsco = i.id LEFT OUTER JOIN authorizations a ON a.authpatient = c.covpatient LEFT OUTER JOIN patient p ON c.covpatient = p.id WHERE c.covpatient = ".$GLOBALS['sql']->quote( $patient )." ORDER BY c.covstatus ASC";
        $q = "SELECT * from coverage where covtype=1 and covpatient = " . $GLOBALS['sql']->quote($patient);
        $r = $GLOBALS['sql']->queryRow($q);
        return $r;
    }
    // end method GetPrimaryCoverage
    public function GetCoverageByType($patient, $type)
    {
        $q = "SELECT a.id as Id,b.insconame as comp_name FROM coverage as a,insco as b WHERE a.covstatus=1 AND a.covtype=" . $GLOBALS['sql']->quote($type) . " AND covpatient=" . $GLOBALS['sql']->quote($patient) . " AND a.covinsco=b.id";
        $r = $GLOBALS['sql']->queryAll($q);
        return $r;
    }
}
// end class PatientCoverages
register_module("PatientCoverages");
Example #13
0
    //	Patient id number
    //
    public function lookupPatient($module, $id)
    {
        $cache = freemed::module_cache();
        foreach ($cache as $v) {
            if ($t = $v['META_INFORMATION']['table_name']) {
                $tables[strtolower($v['MODULE_CLASS'])] = $t;
                $pfield[strtolower($v['MODULE_CLASS'])] = $v['META_INFORMATION']['patient_field'];
            }
        }
        if ($pfield[strtolower($module)] and $tables[strtolower($module)]) {
            $r = $GLOBALS['sql']->get_link($tables[strtolower($module)], $id);
            return $r[$pfield[strtolower($module)]];
        } else {
            return 0;
        }
    }
    // end method lookupPatient
    // Update
    function _update()
    {
        global $sql;
        $version = freemed::module_version($this->MODULE_NAME);
        //if (!version_check($version, '0.2')) {
        //}
    }
}
// end class Annotations
register_module("Annotations");
Example #14
0
        foreach ($res as $r) {
            $m[] = trim($r['rxdrug'] . ' ' . $r['rxdosage'] . ' ' . $r['rxroute']);
        }
        return @join(', ', $m);
    }
    // end method recent_text
    // Method: GetDistinctRx
    //
    //	Retrieve all prescriptions for a patient withoout duplicates.
    //
    // Parameters:
    //
    //	$patient - Patient id
    //
    // Returns:
    //
    //	Array of hashes:
    //	* rx - RX description
    //	* sig - RX signature
    //	* often - RX interval
    //	* id - RX id
    //
    public function GetDistinctRx($patient)
    {
        $q = "SELECT CONCAT( r.rxdrug, ' ', r.rxform, ' ', r.rxdosage, ' ', IFNULL(ps.product_strength_description, '') ) AS rx, r.rxsig AS sig, r.rxinterval AS often, r.id AS id FROM rx r LEFT OUTER JOIN multum_product_strength ps ON ps.product_strength_code = r.rxunit WHERE r.rxpatient = " . $GLOBALS['sql']->quote($patient) . " AND ( r.rxorigrx = 0 OR ISNULL( r.rxorigrx ) )";
        return $GLOBALS['sql']->queryAll($q);
    }
}
// end class Prescription
register_module("Prescription");
Example #15
0
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class CptModifiers extends SupportModule
{
    var $MODULE_NAME = "CPT Modifiers";
    var $MODULE_VERSION = "0.1.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "031fa33c-8824-4c6f-ab8a-d1bab8594a73";
    var $PACKAGE_MINIMUM_VERSION = '0.6.0';
    var $record_name = "CPT Modifiers";
    var $table_name = "cptmod";
    var $widget_hash = '##cptmod## - ##cptmoddescrip##';
    var $archive_field = "cptmodarchive";
    var $variables = array("cptmod", "cptmoddescrip", "cptmodarchive");
    public function __construct()
    {
        // i18n: __("CPT Modifiers Maintenance")
        $this->list_view = array(__("Modifier") => "cptmod", __("Description") => "cptmoddescrip");
        parent::__construct();
    }
}
// end class CptModifiers
register_module("CptModifiers");
Example #16
0
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class FaxStatus extends SupportModule
{
    var $MODULE_NAME = "Fax Status";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "03b49f2f-c3ed-4e63-9d3c-c58d8f61cd88";
    var $MODULE_HIDDEN = true;
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "faxstatus";
    public function __construct()
    {
        // __("Fax Status")
        // Call parent constructor
        parent::__construct();
    }
}
// end module FaxStatus
register_module('FaxStatus');
    //	* id
    //
    public function GetSystemTaskUserInbox($box = NULL)
    {
        $q = "SELECT DATE_FORMAT(s.stamp, '%m/%d/%Y') AS stamp_mdy, s.stamp AS stamp, s.patient AS patient, s.box AS box, s.module AS module, m.module_name AS module_name, CONCAT( p.ptlname, ', ', p.ptfname, ' ', p.ptmname, ' (', p.ptid, ')' ) AS patient_name, s.oid AS oid, s.summary AS summary, s.id AS id FROM systemtaskinbox s LEFT OUTER JOIN modules m ON s.module = m.module_class LEFT OUTER JOIN patient p ON s.patient = p.id WHERE s.user = "******" AND s.box = " . $GLOBALS['sql']->quote($box) : '');
        return $GLOBALS['sql']->queryAll($q);
    }
    // end method GetSystemTaskUserInbox
    // Method: GetSystemTaskPatientInboxCount
    //
    //	Get number of system task inbox items for a patient.
    //
    // Parameters:
    //
    //	$patient - Patient id
    //
    //	$box - Organizational box text name.
    //
    // Returns:
    //
    //	Number of items in the organizational box for the current user.
    //
    public function GetSystemTaskPatientInboxCount($patient, $box)
    {
        $q = "SELECT count FROM systemtaskinboxpatientsummary WHERE patient = " . $GLOBALS['sql']->quote($patient) . " AND box = " . $GLOBALS['sql']->quote($box);
        return (int) $GLOBALS['sql']->queryOne($q);
    }
}
// end class SystemNotifications
register_module("SystemNotifications");
Example #18
0
        }
        switch ($format) {
            case 'xls':
                Header('Content-type: application/x-ms-excel');
                break;
            case 'html':
                Header('Content-type: text/html');
                break;
            case 'xml':
                Header('Content-type: text/xml');
                break;
            case 'pdf':
            default:
                Header('Content-type: application/pdf');
                break;
        }
        Header("Content-Transfer-Encoding:­binary");
        Header("Content-Disposition: inline; filename=\"" . $param['report_formatting'] . ".{$ext}\"");
        Header("Cache-Control: no-cache, must-revalidate");
        // HTTP/1.1
        Header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
        // Date in the past
        readfile($output_file);
        @unlink($output_file);
        @unlink($output_file . '_files');
        die;
    }
}
// end class Reporting
register_module("Reporting");
Example #19
0
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class Loinc extends SupportModule
{
    var $MODULE_NAME = "LOINC";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "df7ced04-7ea6-4770-ac50-cfa628680771";
    var $MODULE_HIDDEN = true;
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "loinc";
    public function __construct()
    {
        // Call parent constructor
        parent::__construct();
    }
}
// end class Loinc
register_module("Loinc");
    // Returns:
    //
    //	array of Hashes.
    public function GetAll()
    {
        freemed::acl_enforce('admin', 'write');
        $q = "select sbs.id, sbs.sbshour as starthour,sbs.sbsminute as startmin,sbs.sbsduration as duration,sbs.sbdate as date," . "sbs.sbsprovider,sbs.sbsprovidergroup,sbs.stamp as entered_on,u.userdescrip as entered_by," . "concat(p.phylname,' ,',p.phyfname,' ',p.phymname) as provider,pg.phygroupname as provider_group " . "from scheduler_block_slots sbs " . "left join physician p on p.id = sbs.sbsprovider " . "left join phygroup pg on pg.id = sbs.sbsprovidergroup " . "left join user u on u.id = sbs.user";
        return $GLOBALS['sql']->queryAll($q);
    }
    // end method GetAll
    // Method: GetBlockTimings
    //
    //	Get array of all group records.
    //
    // Returns:
    //
    //	array of Hashes.
    public function GetBlockedTimeSlots($providerid, $date = null)
    {
        freemed::acl_enforce('scheduling', 'write');
        $providerGroups = CreateObject('org.freemedsoftware.module.ProviderGroups');
        $providerGroupsIds = $providerGroups->getGroupIds($providerid);
        $q = "select sbshour,sbsminute,sbsduration from scheduler_block_slots where sbsprovider=" . $GLOBALS['sql']->quote($providerid) . ($date ? " and sbdate='" . $date . "'" : "");
        foreach ($providerGroupsIds as $ids) {
            $q = $q . " or sbsprovidergroup = " . $ids['id'];
        }
        return $GLOBALS['sql']->queryAll($q);
    }
}
register_module('SchedulerBlockSlots');
Example #21
0
    protected function mod_pre(&$data)
    {
        /*
        $data['phygroupidmap'] = serialize ( $data['phygroupidmap'] );
        $data['phygroupidmap'] = join ( ',', $data['phygroupdocs'] );
        */
        $data['phygroupdtmod'] = date("Y-m-d");
    }
    public function getProviderIds($id)
    {
        $q = "SELECT phygroupidmap as provs FROM phygroup WHERE id=" . $GLOBALS['sql']->quote($id);
        $result = $GLOBALS['sql']->queryRow($q);
        $arr = explode(",", $result['provs']);
        return $arr;
    }
    // Method: getGroupIds
    //
    //	Get array of all group ids in which provider exists.
    //
    // Returns:
    //
    //	array of Hashes.
    public function getGroupIds($providerId)
    {
        $q = "select id from phygroup where find_in_set(" . $GLOBALS['sql']->quote($providerId) . ",phygroupidmap)";
        return $GLOBALS['sql']->queryAll($q);
    }
}
// end class ProviderGroups
register_module("ProviderGroups");
Example #22
0
<?php

// ----------------------------------------------------------------------
// Smart PHP Framework
// Copyright (c) 2004, 2005
// by Armand Turpel < *****@*****.** >
// http://smart.open-publisher.net/
// ----------------------------------------------------------------------
// GNU LESSER GENERAL PUBLIC LICENSE
// To read the license please visit http://www.gnu.org/licenses/lgpl.txt
// ----------------------------------------------------------------------
/**
 * System module init
 *
 *
 */
// Check if this file is included in the SMART environement
//
if (!defined('SF_SECURE_INCLUDE')) {
    die('No Permission on' . __FILE__);
}
// Name of the module
define('MOD_SYSTEM', 'system');
// register this module
if (FALSE == register_module(MOD_SYSTEM, array('module' => MOD_SYSTEM))) {
    trigger_error('The module ' . MOD_SYSTEM . ' exist: ' . __FILE__ . ' ' . __LINE__, E_USER_ERROR);
}
Example #23
0
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
LoadObjectDependency('org.freemedsoftware.core.SupportModule');
class LogModule extends SupportModule
{
    var $MODULE_NAME = "Log";
    var $MODULE_VERSION = "0.1";
    var $MODULE_FILE = __FILE__;
    var $MODULE_UID = "fed9935d-3d3a-4569-92f6-34550eb86a4e";
    var $MODULE_HIDDEN = true;
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $record_name = "Log";
    var $table_name = 'log';
    public function __construct()
    {
        // __("Log")
        $this->variables = array('logstamp', 'loguser', 'logpatient', 'logsystem', 'logsubsystem', 'logseverity', 'logmsg');
        // call parent constructor
        parent::__construct();
    }
    // end constructor Log
    protected function prepare($data)
    {
        $d = $data;
        $d['logstamp'] = SQL__NOW;
        return $d;
    }
}
// end class LogModule
register_module("LogModule");
    var $order_field = "pntname";
    var $widget_hash = "##pntname##";
    public function __construct()
    {
        $this->variables = array('pntname', 'pntphy', 'pnt_S', 'pnt_O', 'pnt_A', 'pnt_P', 'pnt_I', 'pnt_E', 'pnt_R');
        $this->list_view = array(__("Name") => "pntname");
        // Run parent constructor
        parent::__construct();
    }
    // end constructor
    // Method: GetTemplate
    //
    //	Get template text for an template by id.
    //
    // Parameters:
    //
    //	$id - ID of the template in question.
    //
    // Returns:
    //
    //	Hash.
    //
    public function GetTemplate($id)
    {
        $q = "SELECT * FROM pnotes_templates WHERE id=" . ($id + 0);
        return $GLOBALS['sql']->queryRow($q);
    }
}
// end class ProgressNotesTemplates
register_module("ProgressNotesTemplates");
Example #25
0
    protected function GetLocalCachedFile($id)
    {
        // Create hash for filename
        $hash = PHYSICAL_LOCATION . "/data/cache/" . $this->table_name . "-" . md5($id);
        // If it exists, return file name
        if (file_exists($hash)) {
            return $hash;
        } else {
            // ... otherwise cache it first ...
            $r = $GLOBALS['sql']->get_link($this->table_name, $id);
            file_put_contents($hash, $r['ufffile']);
            // ... then return the hash.
            return $hash;
        }
    }
    // end method GetLocalCachedFile
    protected function UpdateFileFromCachedFile($id)
    {
        $hash = PHYSICAL_LOCATION . "/data/cache/" . $this->table_name . "-" . md5($id);
        if (!file_exists($hash)) {
            return false;
        } else {
            $query = $GLOBALS['sql']->update_query($this->table_name, array('ufffile' => file_get_contents($hash)), array('id' => $id));
            $GLOBALS['sql']->query($query);
            return true;
        }
    }
}
// end class UnfiledDocuments
register_module('UnfiledDocuments');
            $collectorid = getcollectorid("advalvas");
            $query = "DELETE FROM station " . "WHERE collectorid='" . addslashes($collectorid) . "'";
            $sql->query($query);
            $query = "DELETE FROM program";
            $sql->query($query);
            print_header_open();
            print_title("Choose Stations for " . $this->MODULE_NAME);
            print_header_close();
            print "\n                        <FORM ACTION=\"" . page_name() . "\" METHOD=POST>\n                        <INPUT TYPE=HIDDEN NAME=\"module\" VALUE=\"" . prepare($module) . "\">\n                        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2>\n                        <TR BGCOLOR=\"#ccccff\">\n                                <TD><B>Original Name</B></TD>\n                                <TD><B>xawtv Name</B></TD>\n                                <TD><B>Channel</B></TD>\n                        </TR>\n                ";
            while (list($name, $value) = each($HTTP_POST_VARS)) {
                if ($value == 1) {
                    $suburl = "?NL&" . $name;
                    $channel_name = preg_replace("/_/", " ", $name);
                    $channel_name = preg_replace("/\\|/", "+", $channel_name);
                    $query = $sql->insert_query("station", array("sname" => $this->transformName($channel_name), "collectorid" => $collectorid, "suburl" => $suburl, "rname" => $this->transformName($channel_name), "channel" => "0"));
                    $result = $sql->query($query);
                    $sid = $sql->last_record($result);
                    print "\n\t\t\t\t<TR>\n\t\t\t\t\t\t<TD>" . prepare($channel_name) . "</TD>\n\t\t\t\t\t\t<TD>\n\t\t\t\t\t\t\t\t<INPUT TYPE=TEXT NAME=\"T" . htmlentities($sid) . "\"\n\t\t\t\t\t\t\t\tVALUE=\"" . prepare($channel_name) . "\">\n\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t<TD>" . html_form::text_widget("C" . htmlentities($sid)) . "</TD>\n\t\t\t\t</TR>\n\t\t\t\t";
                }
            }
            print "</TABLE>\n";
            print "<P><INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Update\"></P>\n";
            print "</FORM>\n";
            print_page_close();
            exit;
        }
    }
    // end class advalvasCollector
    register_module("advalvasCollector");
}
// end if not defined
                return false;
            }
        }
        if (is_array($rooms)) {
            foreach ($rooms as $k => $v) {
                $return[] = $k;
            }
            return $return;
        } else {
            // Ridiculous restrictions?
            return false;
        }
    }
    // end method get_rooms
    function _update()
    {
        $version = freemed::module_version($this->MODULE_NAME);
        // Version 0.1.1
        //
        //	Add colors
        //
        if (!version_check($version, '0.1.1')) {
            $GLOBALS['sql']->query('ALTER TABLE ' . $this->table_name . ' ' . 'ADD COLUMN atcolor CHAR(7) AFTER atequipment');
            $GLOBALS['sql']->query('UPDATE ' . $this->table_name . ' ' . 'SET atcolor=\'\' WHERE id>0');
        }
        // end version 0.1.1
    }
}
// end class AppointmentTemplates
register_module("AppointmentTemplates");
    var $PACKAGE_MINIMUM_VERSION = '0.7.0';
    var $widget_hash = "##pnotestname##";
    var $table_name = "entemplate";
    var $variables = array('pnotestuser', 'pnotesttype', 'pnotestproccode', 'pnotestdiag1', 'pnotestdiag2', 'pnotestdiag3', 'pnotestdiag4', 'pnotestmod1', 'pnotestmod2', 'pnotestmod3', 'pnotestpos', 'pnotestprocunits', 'pnotest_S', 'pnotest_O', 'pnotest_A', 'pnotest_P', 'pnotest_I', 'pnotest_E', 'pnotest_R', 'pnotestsbp', 'pnotestdbp', 'pnotesttemp', 'pnotestheartrate', 'pnotestresprate', 'pnotestweight', 'pnotestheight', 'pnotestgeneral', 'pnotestbmi', 'pnotestcc', 'pnotesthpi', 'pnotestrosgenralstatus', 'pnotestrosgenral', 'pnotestrosheadstatus', 'pnotestroshead', 'pnotestroseyesstatus', 'pnotestroseyes', 'pnotestroseyescmnts', 'pnotestrosentstatus', 'pnotestrosent', 'pnotestrosentcmnts', 'pnotestroscvstatus', 'pnotestroscv', 'pnotestroscvsmnts', 'pnotestrosrespstatus', 'pnotestrosresp', 'pnotestrosrespcmnts', 'pnotestrosgistatus', 'pnotestroshgi', 'pnotestrosgicmnts', 'pnotestrosgustatus', 'pnotestrosgu', 'pnotestrosgucmnts', 'pnotestrosmusclestatus', 'pnotestrosmuscles', 'pnotestrosmusclescmnts', 'pnotestrosskinstatus', 'pnotestrosskin', 'pnotestrosskincmnts', 'pnotestrospsychstatus', 'pnotestrospsych', 'pnotestrospsychcmnts', 'pnotestrosendostatus', 'pnotestrosendo', 'pnotestrosendocmnts', 'pnotestroshemlympstatus', 'pnotestroshemlymp', 'pnotestroshemlympcmnts', 'pnotestrosneurostatus', 'pnotestrosneuro', 'pnotestrosneurocmnts', 'pnotestrosimmallrgstatus', 'pnotestrosimmallrg', 'pnotestph', 'pnotestfh', 'pnotestshalcoholstatus', 'pnotestshalcoholcmnt', 'pnotestshtobaccostatus', 'pnotestshtobaccocmnt', 'pnotestshtcounseled', 'pnotestshilctdrugstatus', 'pnotestshilctdrugscmnt', 'pnotestshliveswithstatus', 'pnotestshliveswithcmnt', 'pnotestshoccupation', 'pnotestshivrskfacstatus', 'pnotestshivrskfaccmnt', 'pnotestshtravelstatus', 'pnotestshtravelcmnt', 'pnotestshpetsstatus', 'pnotestshpetscmnt', 'pnotestshhobbiesstatus', 'pnotestshhobbiescmnt', 'pnotestshhousing', 'pnotestpeheadfreecmnt', 'pnotestpeeyeclpistatus', 'pnotestpeeyeclpicmnt', 'pnotestpeeyedesstatus', 'pnotestpeeyedescmnt', 'pnotestpeeyevpsstatus', 'pnotestpeeyevpscmnt', 'pnotestpeeyeavnstatus', 'pnotestpeeyeavncmnt', 'pnotestpeeyehemstatus', 'pnotestpeeyehemcmnt', 'pnotestpeeyeexustatus', 'pnotestpeeyeexucmnt', 'pnotestpeeyecupdiscratio', 'pnotestpeeyefreecmnt', 'pnotestpeentectstatus', 'pnotestpeentectcmnt', 'pnotestpeentnmsstatus', 'pnotestpeentnmscmnt', 'pnotestpeentlgtstatus', 'pnotestpeentlgtcmnt', 'pnotestpeentomsgstatus', 'pnotestpeentomsgcmnt', 'pnotestpeenthttpstatus', 'pnotestpeenthttpcmnt', 'pnotestpeentthyrostatus', 'pnotestpeentthyrocmnt', 'pnotestpeentfreecmnt', 'pnotestpeneckbrjvdstatus', 'pnotestpeneckbrjvdcmnt', 'pnotestpeneckfreecmnt', 'pnotestpebrstddmstatus', 'pnotestpebrstddmcmnt', 'pnotestpebrstfreecmnt', 'pnotestperespeffstatus', 'pnotestperespeffcmnt', 'pnotestperesplungstatus', 'pnotestperesplungcmnt', 'pnotestperespfreecmnt', 'pnotestpecvregrhystatus', 'pnotestpecvregrhycmnt', 'pnotestpecvs1consstatus', 'pnotestpecvs1conscmnt', 'pnotestpecvs2physplstatus', 'pnotestpecvs2physplcmnt', 'pnotestpecvmurstatus', 'pnotestpecvmurcmnt', 'pnotestpecvpalhrtstatus', 'pnotestpecvpalhrtcmnt', 'pnotestpecvabdaorstatus', 'pnotestpecvabdaorcmnt', 'pnotestpecvfemartstatus', 'pnotestpecvfemartcmnt', 'pnotestpecvpedpulstatus', 'pnotestpecvpadpulcmnt', 'pnotestpecvfreecmnt', 'pnotestpegiscarsstatus', 'pnotestpegiscarscmnt', 'pnotestpegibruitstatus', 'pnotestpegibruitcmnt', 'pnotestpegimassstatus', 'pnotestpegimasscmnt', 'pnotestpegitendstatus', 'pnotestpegitendcmnt', 'pnotestpegiheptstatus', 'pnotestpegiheptcmnt', 'pnotestpegisplenstatus', 'pnotestpegisplencmnt', 'pnotestpegiaprsstatus', 'pnotestpegiaprscmnt', 'pnotestpegibowsndstatus', 'pnotestpegibowsndcmnt', 'pnotestpegistoolstatus', 'pnotestpegistoolcmnt', 'pnotestpegifreecmnt', 'pnotestpegugender', 'pnotestpegupenisstatus', 'pnotestpegupeniscmnt', 'pnotestpegutestesstatus', 'pnotestpegutestescmnt', 'pnotestpeguproststatus', 'pnotestpeguprostcmnt', 'pnotestpeguextgenstatus', 'pnotestpeguextgencmnt', 'pnotestpegucervixstatus', 'pnotestpegucervixcmnt', 'pnotestpeguutadnstatus', 'pnotestpeguutadncmnt', 'pnotestpegufreecmnt', 'pnotestpelympnodesstatus', 'pnotestpelympnodescmnt', 'pnotestpelympfreecmnt', 'pnotestpeskintissuestatus', 'pnotestpeskintissuecmnt', 'pnotestpeskinfreecmnt', 'pnotestpemsgaitststatus', 'pnotestpemsgaitstcmnt', 'pnotestpemsdignlsstatus', 'pnotestpemsdignlscmnt', 'pnotestpemsromstbstatus', 'pnotestpemsromstbcmnt', 'pnotestpemsjntbnsmusstatus', 'pnotestpemsjntbnsmuscmnt', 'pnotestpemsmusstrtnstatus', 'pnotestpemsmusstrtncmnt', 'pnotestpemsfreecmnt', 'pnotestpeneurocrnervstatus', 'pnotestpeneurocrnervcmnt', 'pnotestpeneurodtrsstatus', 'pnotestpeneurodtrscmnt', 'pnotestpeneuromotorstatus', 'pnotestpeneuromotorcmnt', 'pnotestpeneurosnststatus', 'pnotestpeneurosnstcmnt', 'pnotestpeneurofreecmnt', 'pnotestpepsychjudinsstatus', 'pnotestpepsychjudinscmnt', 'pnotestpepsychmoodeffstatus', 'pnotestpepsychmoodeffcmnt', 'pnotestpepsychorntppstatus', 'pnotestpepsychorntppcmnt', 'pnotestpepsychmemorystatus', 'pnotestpepsychmemorycmnt', 'pnotestpepsychfreecmnt', 'pnotestbillable', 'pnotesthandp', 'pnotestsections', 'pnotestfields', 'pnotestname');
    protected function add_pre(&$data)
    {
        $data['pnotestuser'] = freemed::user_cache()->user_number;
    }
    // end method add_pre
    protected function mod_pre(&$data)
    {
        $data['pnotestuser'] = freemed::user_cache()->user_number;
    }
    // end method add_pre
    public function getTemplates($type = NULL)
    {
        if ($type == NULL) {
            $query = "SELECT id,pnotestname AS tempname, pnotestuser AS tempuser,pnotesttype AS notetype FROM entemplate";
        } else {
            $query = "SELECT id,pnotestname AS tempname, pnotestuser AS tempuser,pnotesttype AS notetype FROM entemplate WHERE pnotesttype='" . $type . "'";
        }
        return $GLOBALS['sql']->queryAll($query);
    }
    public function getTemplateInfo($tid)
    {
        $query = "SELECT * FROM entemplate WHERE id=" . $GLOBALS['sql']->quote($tid);
        return $GLOBALS['sql']->queryRow($query);
    }
}
register_module("EncounterNotesTemplate");
Example #29
0
<?php

// ----------------------------------------------------------------------
// Smart (PHP Framework)
// Copyright (c) 2004
// by Armand Turpel < *****@*****.** >
// http://smart.open-publisher.net/
// ----------------------------------------------------------------------
// LICENSE GPL
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
/**
 * Admin setup module init
 */
// Check if this file is included in the Smart environement
//
if (!defined('SF_SECURE_INCLUDE')) {
    die('No Permission on ' . __FILE__);
}
// Name of the module
define('MOD_SETUP', 'setup');
// Version of this module
define('MOD_SETUP_VERSION', '0.2');
// register this module
if (FALSE == register_module(MOD_SETUP, array('module' => MOD_SETUP, 'menu_visibility' => FALSE))) {
    trigger_error('The module ' . MOD_SETUP . ' exist: ' . __FILE__ . ' ' . __LINE__, E_USER_ERROR);
}
Example #30
0
    var $PACKAGE_MINIMUM_VERSION = '0.8.0';
    var $table_name = "icd9";
    var $record_name = "ICD10 Code";
    var $order_field = "icd10code,icdnum";
    var $widget_hash = "##icd10code## ##icd10descrip##";
    var $archive_field = "icdarchive";
    var $variables = array("icd9code", "icd10code", "icd9descrip", "icd10descrip", "icdmetadesc", "icddrg", "icdng", "icdamt", "icdcoll", "icdarchive");
    public function __construct()
    {
        $this->list_view = array(__("Code") => "icd10code", __("Description") => "icd10descrip");
        parent::__construct();
    }
    // end constructor IcdCodes
    public function display_short($code)
    {
        switch (freemed::config_value('icd')) {
            case '10':
                $suffix = '10';
                break;
            case '9':
            default:
                $suffix = '9';
                break;
        }
        $code_record = $GLOBALS['sql']->get_link($this->table_name, $code);
        return $code_record['icd' . $suffix . 'code'] . ' - ' . $code_record['icd' . $suffix . 'descrip'];
    }
}
// end class IcdCodes
register_module("IcdCodes");