public function deleteCptCode(stdClass $params) { $this->db->setSQL("SELECT status FROM encounter_services WHERE id = '{$params->id}'"); $cpt = $this->db->fetchRecord(); if ($cpt['status'] == 0) { $this->db->setSQL("DELETE FROM encounter_services WHERE id ='{$params->id}'"); $this->db->execLog(); } return ['totals' => 1, 'rows' => $params]; }
public function getEncounterReviewByEid($eid) { $this->db->setSQL("SELECT pid, review_alcohol, review_smoke, review_pregnant FROM encounters WHERE eid = '{$eid}'"); $rec = $this->db->fetchRecord(); $this->db->setSQL("SELECT review_smoke, service_date FROM encounters WHERE pid = '{$rec['pid']}' ORDER BY service_date DESC LIMIT 1"); $smoke = $this->db->fetchRecord(); $hasHistory = $smoke !== false && isset($smoke['review_smoke']); $rec['last_history_smoke'] = $hasHistory ? $smoke['review_smoke'] : ''; $rec['last_history_smoke_date'] = $hasHistory ? $smoke['service_date'] : ''; return $rec; }
/** * @param $item_id * @return array */ private function getItemsOptions($item_id) { $foo = array(); $this->db->setSQL("Select `options` FROM `forms_field_options` WHERE `field_id` = '{$item_id}'"); $options = $this->db->fetchRecord(); $options = json_decode($options['options'], true); foreach ($options as $option => $value) { if ($option == 'allowBlank') { $value = $value ? false : true; } $foo[$option] = $value; } return $foo; }
public function getpreventiveCareById($id) { $this->db->setSQL("SELECT * FROM preventive_care_guidelines WHERE id = '{$id}'"); return $this->db->fetchRecord(); }
/** * 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']; }
public function getAllPatientData($pid) { $this->db->setSQL("SELECT * FROM patient WHERE pid = '{$pid}'"); return $this->db->fetchRecord(PDO::FETCH_ASSOC); }