Esempio n. 1
0
 public function updateDocumentsTitle(stdClass $params)
 {
     $data = get_object_vars($params);
     $id = $data['id'];
     unset($data['id'], $data['date']);
     $this->db->setSQL($this->db->sqlBind($data, 'patient_documents', 'U', ['id' => $id]));
     $this->db->execLog();
     return $params;
 }
Esempio n. 2
0
 public function getLabsLiveSearch(stdClass $params)
 {
     $this->db->setSQL("SELECT id,\n\t\t\t\t\t\t\t\t  parent_loinc,\n\t\t\t\t\t\t\t\t  loinc_number,\n\t\t\t\t\t\t\t\t  loinc_name\n\t\t\t\t\t\t\tFROM  labs_panels\n\t\t\t\t\t\t\tWHERE parent_loinc <> loinc_number\n\t\t\t\t\t\t\t  AND loinc_name      LIKE'{$params->query}%'");
     $records = $this->db->fetchRecords(PDO::FETCH_ASSOC);
     $total = count($records);
     $records = array_slice($records, $params->start, $params->limit);
     return array('totals' => $total, 'rows' => $records);
 }
Esempio n. 3
0
 public function updatePreventiveCareDismissedAlertsByPid(stdClass $params)
 {
     $data = get_object_vars($params);
     unset($data['id'], $data['description']);
     $this->db->setSQL($this->db->sqlBind($data, 'preventive_care_inactive_patient', 'U', array('id' => $params->id)));
     $this->db->execLog();
     return $params;
 }
Esempio n. 4
0
 public function logEmergency()
 {
     $data['pid'] = $this->pid;
     $data['eid'] = $this->eid;
     $data['uid'] = $_SESSION['user']['id'];
     $data['date_created'] = Time::getLocalTime();
     $this->db->setSQL($this->db->sqlBind($data, 'emergencies', 'I'));
     $this->db->execLog();
     $this->emergencyId = $this->db->lastInsertId;
 }
Esempio n. 5
0
 public function removeAllowBlank($table)
 {
     $this->db->setSQL("Select `id`, `options` FROM {$table}");
     foreach ($this->db->fetchRecords(PDO::FETCH_ASSOC) as $row) {
         $options = json_decode($row['options'], true);
         if (isset($options['allowBlank'])) {
             unset($options['allowBlank']);
             $id = $row['id'];
             $data['options'] = json_encode($options);
             $this->db->setSQL($this->db->sqlBind($data, $table, 'U', array('id' => $id)));
             $this->db->execOnly();
         }
     }
 }
Esempio n. 6
0
 /**
  * @brief       MatchaHelper constructor.
  * @details     This method starts the connection with mysql server using
  * $_SESSION values
  *              during the login process.
  *
  * @author      Gino Rivera (Certun) <*****@*****.**>
  * @version     Vega 1.0
  *
  */
 function __construct()
 {
     self::$__freeze = false;
     // Connect to the database
     // This is compatible with the old methods
     if (defined('site_db_type')) {
         self::connect(array('host' => site_db_host, 'port' => site_db_port, 'name' => site_db_database, 'user' => site_db_username, 'pass' => site_db_password, 'app' => ROOT . '/app'));
     }
     self::$__secretKey = site_aes_key;
     MatchaAudit::$__audit = true;
     MatchaAudit::$hookTable = 'audit_transaction_log';
     MatchaAudit::$hookClass = 'MatchaHelper';
     MatchaAudit::$hookMethod = 'storeAudit';
     MatchaModel::setSenchaModel('App.model.administration.TransactionLog');
     MatchaModel::setSenchaModel('App.model.administration.AuditLog');
 }
Esempio n. 7
0
/**
 * Created by JetBrains PhpStorm.
 * User: Untusoft
 * Date: 3/20/12
 * Time: 8:52 AM
 * To change this template use File | Settings | File Templates.
 */
if (!isset($_SESSION)) {
    session_name('Untusoft');
    session_start();
    session_cache_limiter('private');
}
include_once ROOT . '/classes/MatchaHelper.php';
echo '<pre>';
$db = new MatchaHelper();
$file_handle = fopen("HCPC2013_A-N.csv", "r");
$rows = array();
$buff = array('code' => null, 'code_text' => null, 'code_text_short' => null);
$count = 0;
while (!feof($file_handle)) {
    $line = fgets($file_handle);
    $data = array();
    $foo = explode("\t", $line);
    if ($count == 0) {
        $buff = array('code' => $foo[0], 'code_text' => $foo[3], 'code_text_short' => $foo[4]);
    } elseif ($buff['code'] != $foo[0]) {
        $rows[] = $buff;
        $buff = array('code' => $foo[0], 'code_text' => $foo[3], 'code_text_short' => $foo[4]);
    } else {
        $buff['code_text'] = $buff['code_text'] . ' ' . $foo[3];
Esempio n. 8
0
/**
 * Created by JetBrains PhpStorm.
 * User: ernesto
 * Date: 7/4/12
 * Time: 2:23 PM
 * To change this template use File | Settings | File Templates.
 */
if (!isset($_SESSION)) {
    session_name('GaiaEHR');
    session_start();
    session_cache_limiter('private');
}
define('_GaiaEXEC', 1);
include_once dirname(dirname(__FILE__)) . '/registry.php';
include_once dirname(dirname(__FILE__)) . '/classes/MatchaHelper.php';
$db = new MatchaHelper();
$tables = array('calendar_events', 'emergencies', 'encounters', 'encounter_services', 'encounter_1500_options', 'encounter_dictation', 'encounter_dx', 'encounter_history', 'encounter_procedures', 'encounter_review_of_systems', 'encounter_review_of_systems_check', 'encounter_services', 'encounter_soap', 'encounter_vitals', 'messages', 'users_sessions', 'patient', 'patient_allergies', 'patient_care_plan_goals', 'patient_cognitive_functional_status', 'patient_disclosures', 'patient_images', 'patient_immunizations', 'patient_medications', 'patient_notes', 'patient_active_problems', 'patient_dental', 'patient_doctors_notes', 'patient_family_history', 'patient_orders', 'patient_order_results', 'patient_order_results_observations', 'patient_pools', 'patient_labs_results', 'patient_labs', 'patient_documents', 'patient_pools', 'patient_prescriptions', 'patient_referrals', 'patient_reminders', 'patient_social_history', 'patient_disclosures', 'patient_surgery', 'patient_chart_checkout', 'patient_zone', 'preventive_care_inactive_patient', 'patient_insurances', 'audit_log', 'audit_transaction_log', 'payment_transactions', 'log');
function getDirectoryList($directory)
{
    $results = array();
    $handler = opendir($directory);
    while ($file = readdir($handler)) {
        if ($file != "." && $file != "..") {
            $results[] = $file;
        }
    }
    closedir($handler);
    return $results;
}
function RemoveReclusiveDir($dir)
{
Esempio n. 9
0
 /**
  * Function: getPatientBalanceByPid
  */
 public function getPatientBalanceByPid($pid)
 {
     $this->db->setSQL("SELECT SUM(amount) as balance FROM payment_transactions WHERE payer_id = '{$pid}'");
     $balance_total = $this->db->fetchRecord();
     return $balance_total['balance'];
 }
Esempio n. 10
0
 /**
  * @return array
  */
 public function getCptUsedByClinic()
 {
     $this->db->setSQL("SELECT DISTINCT cpt.code, cpt.code_text, cpt.code_text_medium, cpt.code_text_short\n                             FROM encounter_services AS ecc\n                        LEFT JOIN cpt_codes AS cpt ON ecc.code = cpt.code\n                         ORDER BY cpt.code DESC");
     $records = $this->db->fetchRecords(PDO::FETCH_ASSOC);
     return ['totals' => count($records), 'rows' => $records];
 }
Esempio n. 11
0
 function __construct()
 {
     $this->conn = MatchaHelper::getConn();
 }