示例#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;
 }
示例#2
0
文件: Medical.php 项目: igez/gaiaehr
 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);
 }
示例#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;
 }
示例#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;
 }
示例#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();
         }
     }
 }
示例#6
0
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];
    }
    $count++;
    //    $db->setSQL($db->sqlBind($data,'codes_icds','I'));
    //    $db->execOnly();
}
if (feof($file_handle)) {
    print 'The End!';
}
fclose($file_handle);
foreach ($rows as $row) {
    $db->setSQL($db->sqlBind($row, 'hcpcs_codes', 'I'));
    $db->execOnly();
}
print_r($rows);
示例#7
0
{
    if (is_dir($dir)) {
        $objects = scandir($dir);
        foreach ($objects as $object) {
            if ($object != "." && $object != "..") {
                if (filetype($dir . "/" . $object) == "dir") {
                    RemoveReclusiveDir($dir . "/" . $object);
                } else {
                    unlink($dir . "/" . $object);
                }
            }
        }
        reset($objects);
        rmdir($dir);
    }
    return true;
}
//print '<h1>SQL Clean Up!</h1>';
foreach ($tables as $table) {
    $db->setSQL("TRUNCATE TABLE {$table}");
    $err = $db->execOnly();
    $msg = isset($err[1]) ? 'FAIL!' : 'PASS!';
    //print 'Empty  `' . $table . '`  ' . $msg . '<br>';
}
//print '<h1>Patient Directories Clean Up!</h1>';
$path = site_path . '/patients/';
$patientsDir = getDirectoryList($path);
foreach ($patientsDir as $dir) {
    RemoveReclusiveDir($path . $dir);
}
print 'Factory Reset Complete!';
示例#8
0
文件: Fees.php 项目: igez/gaiaehr
 /**
  * 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'];
 }
示例#9
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];
 }