public function logoutSession() { $data['logout'] = time(); $this->db->setSQL($this->db->sqlBind($data, 'users_sessions', 'U', array('id' => $_SESSION['session_id']))); $this->db->execOnly(); return true; }
public function updateCurrentPatientPoolAreaByPid(array $data, $pid) { $area = $this->getCurrentPatientPoolAreaByPid($pid); $this->db->setSQL($this->db->sqlBind($data, 'patient_pools', 'U', array('id' => $area['id']))); $this->db->execLog(); return; }
public function updatePatientDisclosure(stdClass $params) { $data = get_object_vars($params); unset($data['id']); $this->db->setSQL($this->db->sqlBind($data, 'patient_disclosures', 'U', array('id' => $params->id))); $this->db->execLog(); return $params; }
public function updateEncounterHCFAOptions(stdClass $params) { $data = get_object_vars($params); unset($data['eid']); $this->db->setSQL($this->db->sqlBind($data, 'encounter_hcfa_1500_options', 'U', array('eid' => $params->eid))); $this->db->execLog(); return array('success' => true); }
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; }
/** * Not in used. For Now you can only set the Facility "inactive" * * @param stdClass $params * @return stdClass */ public function deleteFacility(stdClass $params) { $data['active'] = 0; unset($data['id']); $sql = $this->db->sqlBind($data, 'facility', 'U', array('id' => $params->id)); $this->db->setSQL($sql); $this->db->execLog(); return $params; }
public function updateCptCode(stdClass $params) { $data = get_object_vars($params); unset($data['id'], $data['eid'], $data['code'], $data['code_text'], $data['code_text_medium']); $params->id = intval($params->id); $this->db->setSQL($this->db->sqlBind($data, 'encounter_codes_cpt', 'U', "id='{$params->id}'")); $this->db->execLog(); return array('totals' => 1, 'rows' => $params); }
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', array('id' => $id))); $this->db->execLog(); return $params; }
public function updateMyAccount(stdClass $params) { $data = get_object_vars($params); unset($data['id']); $sql = $this->db->sqlBind($data, 'users', 'U', array('id' => $params->id)); $this->db->setSQL($sql); $this->db->execLog(); return array('success' => true); }
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; }
public function reviewMedicalWindowEncounter(stdClass $params) { $data = get_object_vars($params); $eid = $data['eid']; $area = $data['area']; unset($data['area'], $data['eid']); $data[$area] = 1; $this->db->setSQL($this->db->sqlBind($data, 'encounters', 'U', array('eid' => $eid))); $this->db->execLog(); return array('success' => true); }
/** * @param stdClass $params * @return stdClass * NOTES: Update contact address to who? * Naming: "updatePatientAddress" */ public function updateAddress(stdClass $params) { $data = get_object_vars($params); unset($data['id'], $data['fullname'], $data['fulladdress']); $sql = $this->db->sqlBind($data, "users", "U", "id='" . $params->id . "'"); $this->db->setSQL($sql); $this->db->execLog(); $params->fullname = Person::fullname($params->fname, $params->mname, $params->lname); $params->fulladdress = Person::fulladdress($params->street, $params->streetb, $params->city, $params->state, $params->zip); return $params; }
/** * Function: addPayment */ public function addPayment(stdClass $params) { $data = get_object_vars($params); $this->db->setSQL($this->db->sqlBind($data, "payment_transactions", "I")); $this->db->execLog(); if ($this->db->lastInsertId == 0) { return (array) ($success = 'false'); } else { return (array) ($success = 'true'); } }
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', "id='{$id}'")); $this->db->execOnly(); } } }
/** * @param stdClass $params * @return array */ public function updateEvent(stdClass $params) { $row['user_id'] = $params->calendarId; $row['category'] = $params->category; $row['facility'] = $params->facility; $row['billing_facillity'] = $params->billing_facility; $row['patient_id'] = $params->patient_id; $row['title'] = $params->title; $row['status'] = $params->status; $row['start'] = $params->start; $row['end'] = $params->end; $row['rrule'] = $params->rrule; $row['loc'] = $params->loc; $row['notes'] = $params->notes; $row['url'] = $params->url; $row['ad'] = $params->ad; $this->db->setSQL($this->db->sqlBind($row, 'calendar_events', 'U', array('id' => $params->id))); $this->db->execLog(); return array('success' => true); }
$mitos_db->setSQL("SELECT id FROM insurance_companies ORDER BY id DESC"); $irec = $mitos_db->fetch(); $new_id = max($prec['id'], $irec['id']) + 1; // ************************************************************************************* // Validate and pass the POST variables to an array // This is the moment to validate the entered values from the user // although Sencha EXTJS make good validation, we could check again // just in case // ************************************************************************************* switch ($_GET['task']) { case "pharmacy": $row['id'] = $new_id; $row['name'] = $data['name']; $row['transmit_method'] = $data['transmit_method']; $row['email'] = $data['email']; $sql = $mitos_db->sqlBind($row, "pharmacies", "I"); break; case "insurance": $row['id'] = $new_id; $row['name'] = $data['name']; $row['attn'] = $data['attn']; $row['cms_id'] = $data['cms_id']; $row['freeb_type'] = $data['freeb_type']; $row['x12_receiver_id'] = $data['x12_receiver_id']; $row['x12_default_partner_id'] = $data['x12_default_partner_id']; $row['alt_cms_id'] = $data['alt_cms_id']; $sql = $mitos_db->sqlBind($row, "insurance_companies", "I"); break; case "insuranceNumbers": break; case "x12Partners":
$row['street2'] = $data['street2']; $row['streetb2'] = $data['streetb2']; $row['city2'] = $data['city2']; $row['state2'] = $data['state2']; $row['zip2'] = $data['zip2']; $row['phone'] = $data['phone']; $row['phonew1'] = $data['phonew1']; $row['phonew2'] = $data['phonew2']; $row['phonecell'] = $data['phonecell']; $row['fax'] = $data['fax']; $row['email'] = $data['email']; $row['assistant'] = $data['assistant']; $row['url'] = $data['url']; $row['upin'] = $data['upin']; $row['npi'] = $data['npi']; $row['federaltaxid'] = $data['federaltaxid']; $row['taxonomy'] = $data['taxonomy']; $row['notes'] = $data['notes']; // ************************************************************************************* // Finally that validated POST variables is inserted to the database // This one make the JOB of two, if it has an ID key run the UPDATE statement // if not run the INSERT stament // ************************************************************************************* $sql = $mitos_db->sqlBind($row, "users", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret == "") { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; }
} else { $row['pos_code'] = $row['pos_code']; } array_push($rows, $row); } //--------------------------------------------------------------------------------------- // here we are adding "totals" and the root "row" for sencha use //--------------------------------------------------------------------------------------- print_r(json_encode(array('totals' => $total, 'row' => $rows))); exit; case 'POST': unset($data['id']); $data['service_location'] = $data['service_location'] == 'on' ? 1 : 0; $data['accepts_assignment'] = $data['accepts_assignment'] == 'on' ? 1 : 0; $data['billing_location'] = $data['billing_location'] == 'on' ? 1 : 0; $sql = $mitos_db->sqlBind($data, "facility", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret[2]) { echo '{ "success": false, "errors": { "reason": "' . $ret[2] . '" }}'; } else { echo '{ "success": true }'; } exit; case 'PUT': $id = $data['id']; unset($data['id']); $data['service_location'] = $data['service_location'] == 'on' ? 1 : 0; $data['accepts_assignment'] = $data['accepts_assignment'] == 'on' ? 1 : 0; $data['billing_location'] = $data['billing_location'] == 'on' ? 1 : 0; // *************************************************************************************
// ************************************************************************************* // Parce the data generated by EXTJS witch is JSON // ************************************************************************************* $data = json_decode($_REQUEST['row']); // ************************************************************************************* // Validate and pass the POST variables to an array // This is the moment to validate the entered values from the user // although Sencha EXTJS make good validation, we could check again // just in case // ************************************************************************************* $row['list_id'] = dataEncode($data->list_id); $row['option_id'] = dataEncode($data->option_id); $row['title'] = dataEncode($data->title); $row['seq'] = dataEncode($data->seq); $row['is_default'] = trim($data->is_default) == 'on' ? 1 : 0; $row['option_value'] = dataEncode($data->option_value); $row['mapping'] = dataEncode($data->mapping); $row['notes'] = dataEncode($data->notes); // ************************************************************************************* // Finally that validated POST variables is inserted to the database // This one make the JOB of two, if it has an ID key run the UPDATE statement // if not run the INSERT stament // ************************************************************************************* $sql = $mitos_db->sqlBind($row, "list_options", "i"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret == "") { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; }
$file_handle = fopen("icds.txt", "r"); while (!feof($file_handle)) { $line = fgets($file_handle); $data = array(); $foo = explode("\t", $line); $data['id'] = $foo[0]; $data['parent_id'] = $foo[1]; $data['code_text'] = $foo[2]; $data['code_text_short'] = $foo[3]; $data['code'] = $foo[4]; $data['digits'] = $foo[5]; $data['sequence'] = $foo[6]; $data['category_range'] = $foo[7]; $data['billing_status'] = $foo[8]; $data['status'] = $foo[9]; $data['is_custom_code'] = $foo[10]; // $data['doc_url3'] = $foo[11]; // $data['r'] = $foo[12]; // $data['s'] = $foo[13]; // $data['t'] = $foo[14]; // $data['u'] = $foo[15]; // $data['v'] = $foo[16]; // $data['w'] = $foo[17]; // $data['x'] = $foo[18]; $db->setSQL($db->sqlBind($data, 'codes_icds', 'I')); $db->execOnly(); } if (feof($file_handle)) { print 'The End!'; } fclose($file_handle);
include_once $_SESSION['site']['root'] . "/classes/dbHelper.php"; include_once $_SESSION['site']['root'] . "/repo/global_functions/global_functions.php"; $_SESSION['site']['flops'] = 0; $mitos_db = new dbHelper(); $data = $_POST; foreach ($data as $key => $val) { if ($val == null) { unset($data[$key]); } if ($val == 'off') { $data[$key] = 0; } if ($val == 'on') { $data[$key] = 1; } } $sql = $mitos_db->sqlBind($data, "form_data_demographics", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); $pid = $mitos_db->lastInsertId; $mitos_db->setSQL("SELECT pid, fname, mname, lname\n FROM form_data_demographics\n WHERE pid = '{$pid}'"); $rows = array(); foreach ($mitos_db->execStatement(PDO::FETCH_ASSOC) as $row) { $row['fullname'] = fullname($row['fname'], $row['mname'], $row['lname']); array_push($rows, $row); } if ($ret[2]) { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo '{ "success": true, "patient": { "pid": "' . $row['pid'] . '", fullname:"' . $row['fullname'] . '" } }'; }
// } // } //} $filename = 'cdt.txt'; $handle = fopen($filename, 'r'); $string = fread($handle, filesize($filename)); //preg_match("/(\w*?) (.*\n)/", $string, $matches, PREG_OFFSET_CAPTURE); // //print '<pre>'; //print_r($matches); // //$html = "<b>bold text</b><a href=howdy.html>click me</a>"; preg_match_all("/(.*?) (.*)\n/", $string, $matches, PREG_SET_ORDER); foreach ($matches as $val) { $data = array('code' => $val[1], 'text' => $val[2]); $db->setSQL($db->sqlBind($data, 'cdt_codes', 'I')); $db->execOnly(); } // print_r($res); //foreach($res as $num => $val){ // echo '<pre>'; // if(is_odd($num)){ // foreach($res[$num] as $item => $inside){ // //$surgeries=($inside); // $data['surgeries'] = $inside; // // print $db->sqlBind($data, 'table_example', 'I'); // echo '<br>'; //// $sql= "INSERT INTO surgeries (type, surgery, type_num) VALUES('".$tittle."','".$surgeries."','".$type_num."')"; //// //// mysql_query($sql);
// Reverse $row['fld_length'] = $data->fld_length; $row['max_length'] = $data->max_length; $row['list_id'] = $reverse_list[0]['option_id']; $row['titlecols'] = $data->titlecols; $row['datacols'] = $data->datacols; $row['default_value'] = $data->default_value; $row['edit_options'] = $data->edit_options; $row['description'] = $data->description; $row['group_order'] = $data->group_order; // ************************************************************************************* // Finally that validated POST variables is inserted to the database // This one make the JOB of two, if it has an ID key run the UPDATE statement // if not run the INSERT stament // ************************************************************************************* $sql = $mitos_db->sqlBind($row, "layout_options", "U", "item_id='" . $row['item_id'] . "'"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); $urow['seq'] = $new_seq; $sql = $mitos_db->sqlBind($urow, "layout_options", "U", "item_id='" . $urow['item_id'] . "'"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); $new_seq++; } else { $urow['seq'] = $new_seq; $sql = $mitos_db->sqlBind($urow, "layout_options", "U", "item_id='" . $urow['item_id'] . "'"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); $new_seq++; } }
// Database class instance //------------------------------------------ $mitos_db = new dbHelper(); // ************************************************************************************* // Parce the data generated by EXTJS witch is JSON // ************************************************************************************* $data = json_decode($_POST['row'], true); // ************************************************************************************* // Validate and pass the POST variables to an array // This is the moment to validate the entered values from the user // although Sencha EXTJS make good validation, we could check again // just in case // ************************************************************************************* $row['user'] = $_SESSION['user']['name']; $row['date'] = $data['date']; $row['body'] = $data['body']; $row['groupname'] = $data['groupname']; $row['activity'] = '1'; // ************************************************************************************* // Finally that validated POST variables is inserted to the database // This one make the JOB of two, if it has an ID key run the UPDATE statement // if not run the INSERT statement // ************************************************************************************* $sql = $mitos_db->sqlBind($row, "onotes", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret == "") { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; }
$total = $mitos_db->rowCount(); $mitos_db->setSQL("SELECT * FROM codes WHERE active = '{$active}' {$and} {$code} {$AND} {$search} {$SHOW} ORDER BY code_type, code, code_text LIMIT {$start},{$limit}"); $rows = array(); foreach ($mitos_db->execStatement(PDO::FETCH_ASSOC) as $row) { array_push($rows, $row); } //------------------------------------------------------------------------------ // here we are adding "totals" and the root "row" for sencha use //------------------------------------------------------------------------------ print_r(json_encode(array('totals' => $total, 'row' => $rows))); exit; case 'POST': unset($data['id']); $data['active'] = $data['active'] == 'on' ? 1 : 0; $data['reportable'] = $data['reportable'] == 'on' ? 1 : 0; $sql = $mitos_db->sqlBind($data, "codes", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret[2]) { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; } exit; case 'PUT': $id = $data['id']; unset($data['id']); $data['active'] = $data['active'] == 'on' ? 1 : 0; $data['reportable'] = $data['reportable'] == 'on' ? 1 : 0; $sql = $mitos_db->sqlBind($data, "codes", "U", "id='{$id}'"); $mitos_db->setSQL($sql);
// ************************************************************************************* // Parce the data generated by EXTJS witch is JSON // ************************************************************************************* $data = json_decode($_POST['row'], true); //------------------------------------------ // get the current user name //------------------------------------------ $user = $_SESSION['user']['name']; // ************************************************************************************* // Validate and pass the POST variables to an array // This is the moment to validate the entered values from the user // although Sencha EXTJS make good validation, we could check again // just in case // ************************************************************************************* $row['date'] = $data['date']; $row['body'] = $data['body']; $row['groupname'] = $data['groupname']; $row['activity'] = $data['activity']; // ************************************************************************************* // Finally that validated POST variables is inserted to the database // This one make the JOB of two, if it has an ID key run the UPDATE statement // if not run the INSERT statement // ************************************************************************************* $sql = $mitos_db->sqlBind($row, "onotes", "U", "id='" . $data['id'] . "'"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret == "") { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; }
public function unSetPatientZoneByPatientZoneId($PatientZoneId) { $data['time_out'] = Time::getLocalTime(); $this->db->setSQL($this->db->sqlBind($data, 'patient_zone', 'U', array('id' => $PatientZoneId))); $this->db->execLog(); }
//------------------------------------------ // Database class instance //------------------------------------------ $mitos_db = new dbHelper(); // ************************************************************************************* // Validate and pass the POST variables to an array // This is the moment to validate the entered values from the user // although Sencha EXTJS make good validation, we could check again // just in case // ************************************************************************************* $row['list_id'] = dataEncode($data->list_id); $row['option_id'] = dataEncode($data->option_id); $row['title'] = dataEncode($data->title); $row['seq'] = dataEncode($data->seq); $row['is_default'] = trim($data->is_default) == 'true' ? 1 : 0; $row['option_value'] = dataEncode($data->option_value); $row['mapping'] = dataEncode($data->mapping); $row['notes'] = dataEncode($data->notes); // ************************************************************************************* // Finally that validated POST variables is inserted to the database // This one make the JOB of two, if it has an ID key run the UPDATE statement // if not run the INSERT stament // ************************************************************************************* $sql = $mitos_db->sqlBind($row, "list_options", "u", "id='" . $data->id . "'"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret == "") { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; }
$row['role_id'] = $rec['role_id']; array_push($rows, $row); } print_r(json_encode(array('totals' => $total, 'row' => $rows))); exit; case 'POST': $role['role_id'] = $data['role_id']; unset($data['id'], $data['role_id'], $data['fullname']); $data['password'] = $aes->encrypt($data['password']); $data['authorized'] = $data['authorized'] == 'on' ? 1 : 0; $data['active'] = $data['active'] == 'on' ? 1 : 0; $data['calendar'] = $data['calendar'] == 'on' ? 1 : 0; if ($data['taxonomy'] == "") { unset($data['taxonomy']); } $sql = $mitos_db->sqlBind($data, "users", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); $role['user_id'] = $mitos_db->lastInsertId; $sql = $mitos_db->sqlBind($role, "acl_user_roles", "I"); $mitos_db->setSQL($sql); $ret = $mitos_db->execLog(); if ($ret[2]) { echo '{ success: false, errors: { reason: "' . $ret[2] . '" }}'; } else { echo "{ success: true }"; } exit; case 'PUT': $id = $data['id']; $role['role_id'] = $data['role_id'];