public function loginSession() { $date = time(); $data['sid'] = session_id(); $data['uid'] = $_SESSION['user']['id']; $data['login'] = $date; $data['last_request '] = $date; $this->db->setSQL($this->db->sqlBind($data, 'users_sessions', 'I')); $this->db->execLog(); $_SESSION['session_id'] = $this->db->lastInsertId; return $_SESSION['session_id']; }
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; }
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); }
/** * 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 deleteCptCode(stdClass $params) { $this->db->setSQL("SELECT status FROM encounter_codes_cpt WHERE id = '{$params->id}'"); $cpt = $this->db->fetchRecord(); if ($cpt['status'] == 0) { $this->db->setSQL("DELETE FROM encounter_codes_cpt WHERE id ='{$params->id}'"); $this->db->execLog(); } return array('totals' => 1, 'rows' => $params); }
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; }
/** * @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 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); }
/** * This function will update the fields and print * the success callback if no errors found along the way * * @param stdClass $params * @return array */ public function updateField(stdClass $params) { $data = get_object_vars($params); $data = $this->sanitizedData($data); $field = array(); $field['xtype'] = $data['xtype']; $field['form_id'] = intval($data['form_id']); $field['parentId'] = $data['parentId']; $field['pos'] = intval($data['pos']); $this->db->setSQL($this->db->sqlBind($field, 'forms_fields', 'U', array('id' => $params->id))); $this->db->execLog(); unset($data['id'], $data['xtype'], $data['form_id'], $data['parentId'], $data['pos'], $data['leaf']); $this->setFieldOptions($data, $params->id); return array('success' => true); }
//------------------------------------------ // 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['state'] = dataEncode($data['state']); $row['zip'] = dataEncode($data['zip']); // secondary address $row['street2'] = dataEncode($data['street2']); $row['streetb2'] = dataEncode($data['streetb2']); $row['city2'] = dataEncode($data['city2']); $row['state2'] = dataEncode($data['state2']); $row['zip2'] = dataEncode($data['zip2']); // phones $row['phone'] = dataEncode($data['phone']); $row['phonew1'] = dataEncode($data['phonew1']); $row['phonew2'] = dataEncode($data['phonew2']); $row['phonecell'] = dataEncode($data['phonecell']); $row['fax'] = dataEncode($data['fax']); //additional info $row['email'] = dataEncode($data['email']); $row['assistant'] = dataEncode($data['assistant']); $row['url'] = dataEncode($data['url']); $row['upin'] = dataEncode($data['upin']); $row['npi'] = dataEncode($data['npi']); $row['federaltaxid'] = dataEncode($data['federaltaxid']); $row['taxonomy'] = dataEncode($data['taxonomy']); $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 // ************************************************************************************* $mitos_db->setSQL("INSERT INTO users \n \t\t\t SET username = '******', " . "\n\t\t\t\t password = '******', " . "\n\t\t\t\t abook_type = '" . $row['abook_type'] . "', " . "\n\t\t\t\t title = '" . $row['title'] . "', " . "\n\t\t\t\t fname = '" . $row['fname'] . "', " . "\n\t\t\t\t mname = '" . $row['mname'] . "', " . "\n\t\t\t\t lname = '" . $row['lname'] . "', " . "\n\t\t\t\t specialty = '" . $row['specialty'] . "', " . "\n\t\t\t\t organization = '" . $row['organization'] . "', " . "\n\t\t\t\t valedictory = '" . $row['valedictory'] . "', " . "\n\t\t\t\t street = '" . $row['street'] . "', " . "\n\t\t\t\t streetb = '" . $row['streetb'] . "', " . "\n\t\t\t\t city = '" . $row['city'] . "', " . "\n\t\t\t\t state = '" . $row['state'] . "', " . "\n\t\t\t\t zip = '" . $row['zip'] . "', " . "\n\t\t\t\t street2 = '" . $row['street2'] . "', " . "\n\t\t\t\t streetb2 = '" . $row['streetb2'] . "', " . "\n\t\t\t\t city2 = '" . $row['city2'] . "', " . "\n\t\t\t\t state2 = '" . $row['state2'] . "', " . "\n\t\t\t\t zip2 = '" . $row['zip2'] . "', " . "\n\t\t\t\t phone = '" . $row['phone'] . "', " . "\n\t\t\t\t phonew1 = '" . $row['phonew1'] . "', " . "\n\t\t\t\t phonew2 = '" . $row['phonew2'] . "', " . "\n\t\t\t\t phonecell = '" . $row['phonecell'] . "', " . "\n\t\t\t\t fax = '" . $row['fax'] . "', " . "\n\t\t\t\t email = '" . $row['email'] . "', " . "\n\t\t\t\t assistant = '" . $row['assistant'] . "', " . "\n\t\t\t\t url = '" . $row['url'] . "', " . "\n\t\t\t\t upin = '" . $row['upin'] . "', " . "\n\t\t\t\t npi = '" . $row['npi'] . "', " . "\n\t\t\t\t federaltaxid = '" . $row['federaltaxid'] . "', " . "\n\t\t\t\t taxonomy = '" . $row['taxonomy'] . "', " . "\n\t\t\t\t notes = '" . $row['notes'] . "'"); $mitos_db->execLog(); echo "{ success: true }";
/** * @param stdClass $params * @return array */ public function deleteEvent(stdClass $params) { $this->db->setSQL("DELETE FROM calendar_events WHERE id='{$params->id}'"); $this->db->execLog(); return array('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(); }