function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     if (is_numeric($_POST['id'])) {
         $this->icompanies[0] = new InsuranceCompany($_POST['id']);
     } else {
         $this->icompanies[0] = new InsuranceCompany();
     }
     parent::populate_object($this->icompanies[0]);
     $this->icompanies[0]->persist();
     $this->icompanies[0]->populate();
     // Post insurance companies as customers to the accounting system
     // unless globals.php requests otherwise.
     //
     if (!$GLOBALS['insurance_companies_are_not_customers']) {
         $this->_sync_ws($this->icompanies[0]);
     }
     //echo "action processeed";
     $_POST['process'] = "";
     header('Location:' . $GLOBALS['webroot'] . "/controller.php?" . "practice_settings&insurance_company&action=list");
     //Z&H
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->well_child = new FormWellChild($_POST['id']);
     parent::populate_object($this->well_child);
     $new_form = false;
     if (empty($_POST['id'])) {
         $new_form = true;
     }
     $this->well_child->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if ($new_form) {
         addForm($GLOBALS['encounter'], "Well Child Visit", $this->well_child->id, "well_child", $GLOBALS['pid'], $_SESSION['userauthorized']);
     }
     if (!empty($_POST['cpt_code'])) {
         $sql = "select * from codes where code ='" . mysql_real_escape_string($_POST['cpt_code']) . "' order by id";
         $results = sqlQ($sql);
         $row = mysql_fetch_array($results);
         if (!empty($row)) {
             addBilling(date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'], $row['modifier'], $row['units'], $row['fee']);
         }
     }
     $_POST['process'] = "";
     return;
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->hptje_primary = new FormHpTjePrimary($_POST['id']);
     parent::populate_object($this->hptje_primary);
     $this->hptje_primary->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Head Pain TJE", $this->hptje_primary->id, "hp_tje_primary", $GLOBALS['pid'], $_SESSION['userauthorized']);
     $_POST['process'] = "";
     return;
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->prior_auth = new FormPriorAuth($_POST['id']);
     parent::populate_object($this->prior_auth);
     $this->prior_auth->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Prior Authorization Form", $this->prior_auth->id, "prior_auth", $GLOBALS['pid'], $_SESSION['userauthorized']);
     $_POST['process'] = "";
     return;
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->form = new FormLegLength($_POST['id']);
     parent::populate_object($this->form);
     $this->form->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Extremities measurements", $this->form->id, "leg_length", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
Example #6
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->ros = new FormROS($_POST['id']);
     parent::populate_object($this->ros);
     $this->ros->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Review Of Systems", $this->ros->id, "ros", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
Example #7
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->form = new FormSOAP($_POST['id']);
     parent::populate_object($this->form);
     $this->form->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "SOAP", $this->form->id, "soap2", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->form = new FormActivityImpact($_POST['id']);
     parent::populate_object($this->form);
     $this->form->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Impact of Activities of Daily Living", $this->form->id, "activity_impact", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
Example #9
0
 function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     if (is_numeric($_POST['id'])) {
         $this->pharmacies[0] = new Pharmacy($_POST['id']);
     } else {
         $this->pharmacies[0] = new Pharmacy();
     }
     parent::populate_object($this->pharmacies[0]);
     //print_r($this->pharmacies[0]);
     //echo $this->pharmacies[0]->toString(true);
     $this->pharmacies[0]->persist();
     //echo "action processeed";
     $_POST['process'] = "";
 }
 function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     if (is_numeric($_POST['id'])) {
         $this->icompanies[0] = new InsuranceCompany($_POST['id']);
     } else {
         $this->icompanies[0] = new InsuranceCompany();
     }
     parent::populate_object($this->icompanies[0]);
     $this->icompanies[0]->persist();
     $this->icompanies[0]->populate();
     //echo "action processeed";
     $_POST['process'] = "";
     header('Location:' . $GLOBALS['webroot'] . "/controller.php?" . "practice_settings&insurance_company&action=list");
     //Z&H
 }
Example #11
0
 function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     if (is_numeric($_POST['id'])) {
         $this->x12_partner[0] = new X12Partner($_POST['id']);
     } else {
         $this->x12_partner[0] = new X12Partner();
     }
     parent::populate_object($this->x12_partner[0]);
     $this->x12_partner[0]->persist();
     //insurance numbers need to be repopulated so that insurance_company_name recieves a value
     $this->x12_partner[0]->populate();
     //echo "action processeed";
     $_POST['process'] = "";
     $this->_state = false;
     return $this->edit_action(null, $this->x12_partner[0]);
 }
Example #12
0
 function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     if (is_numeric($_POST['id'])) {
         $this->x12_partner[0] = new X12Partner($_POST['id']);
     } else {
         $this->x12_partner[0] = new X12Partner();
     }
     parent::populate_object($this->x12_partner[0]);
     $this->x12_partner[0]->persist();
     //insurance numbers need to be repopulated so that insurance_company_name recieves a value
     $this->x12_partner[0]->populate();
     //echo "action processeed";
     $_POST['process'] = "";
     $this->_state = false;
     header('Location:' . $GLOBALS['webroot'] . "/controller.php?" . "practice_settings&x12_partner&action=list");
     //Z&H
     //return $this->edit_action(null,$this->x12_partner[0]);
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->prosthesis = new FormProsthesis($_POST['id']);
     parent::populate_object($this->prosthesis);
     $this->prosthesis->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Prosthesis & Orthotics Form", $this->prosthesis->id, "prosthesis", $GLOBALS['pid'], $_SESSION['userauthorized']);
     if (!empty($_POST['cpt_code'])) {
         $sql = "select * from codes where code ='" . mysql_real_escape_string($_POST['cpt_code']) . "' order by id";
         $results = sqlQ($sql);
         $row = mysql_fetch_array($results);
         if (!empty($row)) {
             addBilling(date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'], $row['modifier'], $row['units'], $row['fee']);
         }
     }
     $_POST['process'] = "";
     return;
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->evaluation = new FormEvaluation($_POST['id']);
     parent::populate_object($this->evaluation);
     $this->evaluation->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Evaluation Form", $this->evaluation->id, "evaluation", $GLOBALS['pid'], $_SESSION['userauthorized']);
     if (!empty($_POST['cpt_code'])) {
         $sql = "select * from codes where code ='" . add_escape_custom($_POST['cpt_code']) . "' order by id";
         $results = sqlQ($sql);
         $row = sqlFetchArray($results);
         if (!empty($row)) {
             addBilling(date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'], $row['modifier'], $row['units'], $row['fee']);
         }
     }
     $_POST['process'] = "";
     return;
 }
Example #15
0
 function note_action_process($patient_id)
 {
     // this function is a dual function that will set up a note associated with a document or send a document via email.
     if ($_POST['process'] != "true") {
         return;
     }
     $n = new Note();
     $n->set_owner($_SESSION['authUserID']);
     parent::populate_object($n);
     if ($_POST['identifier'] == "no") {
         // associate a note with a document
         $n->persist();
     } elseif ($_POST['identifier'] == "yes") {
         // send the document via email
         $d = new Document($_POST['foreign_id']);
         $url = $d->get_url();
         $storagemethod = $d->get_storagemethod();
         $couch_docid = $d->get_couch_docid();
         $couch_revid = $d->get_couch_revid();
         if ($couch_docid && $couch_revid) {
             $couch = new CouchDB();
             $data = array($GLOBALS['couchdb_dbase'], $couch_docid);
             $resp = $couch->retrieve_doc($data);
             $content = $resp->data;
             if ($content == '' && $GLOBALS['couchdb_log'] == 1) {
                 $log_content = date('Y-m-d H:i:s') . " ==> Retrieving document\r\n";
                 $log_content = date('Y-m-d H:i:s') . " ==> URL: " . $url . "\r\n";
                 $log_content .= date('Y-m-d H:i:s') . " ==> CouchDB Document Id: " . $couch_docid . "\r\n";
                 $log_content .= date('Y-m-d H:i:s') . " ==> CouchDB Revision Id: " . $couch_revid . "\r\n";
                 $log_content .= date('Y-m-d H:i:s') . " ==> Failed to fetch document content from CouchDB.\r\n";
                 //$log_content .= date('Y-m-d H:i:s')." ==> Will try to download file from HardDisk if exists.\r\n\r\n";
                 $this->document_upload_download_log($d->get_foreign_id(), $log_content);
                 die(xlt("File retrieval from CouchDB failed"));
             }
             // place it in a temporary file and will remove the file below after emailed
             $temp_couchdb_url = $GLOBALS['OE_SITE_DIR'] . '/documents/temp/couch_' . date("YmdHis") . $d->get_url_file();
             $fh = fopen($temp_couchdb_url, "w");
             fwrite($fh, base64_decode($content));
             fclose($fh);
             $temp_url = $temp_couchdb_url;
             // doing this ensure hard drive file never deleted in case something weird happens
         } else {
             $url = preg_replace("|^(.*)://|", "", $url);
             // Collect filename and path
             $from_all = explode("/", $url);
             $from_filename = array_pop($from_all);
             $from_pathname_array = array();
             for ($i = 0; $i < $d->get_path_depth(); $i++) {
                 $from_pathname_array[] = array_pop($from_all);
             }
             $from_pathname_array = array_reverse($from_pathname_array);
             $from_pathname = implode("/", $from_pathname_array);
             $temp_url = $GLOBALS['OE_SITE_DIR'] . '/documents/' . $from_pathname . '/' . $from_filename;
         }
         if (!file_exists($temp_url)) {
             echo xl('The requested document is not present at the expected location on the filesystem or there are not sufficient permissions to access it.', '', '', ' ') . $temp_url;
         }
         $url = $temp_url;
         $body_notes = attr($_POST['note']);
         $pdetails = getPatientData($patient_id);
         $pname = $pdetails['fname'] . " " . $pdetails['lname'];
         $this->document_send($_POST['provide_email'], $body_notes, $url, $pname);
         if ($couch_docid && $couch_revid) {
             // remove the temporary couchdb file
             unlink($temp_couchdb_url);
         }
     }
     $this->_state = false;
     $_POST['process'] = "";
     return $this->view_action($patient_id, $n->get_foreign_id());
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $weight = $_POST["weight"];
     $height = $_POST["height"];
     if ($weight > 0 && $height > 0) {
         $_POST["BMI"] = $weight / $height / $height * 10000;
     }
     if ($_POST["BMI"] > 42) {
         $_POST["BMI_status"] = 'Obesity III';
     } elseif ($_POST["BMI"] > 34) {
         $_POST["BMI_status"] = 'Obesity II';
     } elseif ($_POST["BMI"] > 30) {
         $_POST["BMI_status"] = 'Obesity I';
     } elseif ($_POST["BMI"] > 27) {
         $_POST["BMI_status"] = 'Overweight';
     } elseif ($_POST["BMI"] > 25) {
         $_POST["BMI_status"] = 'Normal BL';
     } elseif ($_POST["BMI"] > 18.5) {
         $_POST["BMI_status"] = 'Normal';
     } elseif ($_POST["BMI"] > 10) {
         $_POST["BMI_status"] = 'Underweight';
     }
     $temperature = $_POST["temperature"];
     if ($temperature == '0' || $temperature == '') {
         $_POST["temp_method"] = "";
     }
     $this->vitals = new FormVitalsM($_POST['id']);
     parent::populate_object($this->vitals);
     $this->vitals->persist();
     if ($GLOBALS['encounter'] < 1) {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Vitals (Metric)", $this->vitals->id, "vitalsM", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
 /**
  * @brief called to store the submitted form's contents to the database, adding the form to the encounter if necissary.
  */
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->model = $this->createModel($_POST['id']);
     parent::populate_object($this->model);
     $this->model->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], $this->model->getTitle(), $this->model->id, $this->model->getCode(), $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
 }
 function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     // Stupid Smarty code treats empty values as not specified values.
     // Since active is a checkbox, represent the unchecked state as -1.
     if (empty($_POST['active'])) {
         $_POST['active'] = '-1';
     }
     $this->prescriptions[0] = new Prescription($_POST['id']);
     parent::populate_object($this->prescriptions[0]);
     //echo $this->prescriptions[0]->toString(true);
     $this->prescriptions[0]->persist();
     $_POST['process'] = "";
     // If the "Prescribe and Dispense" button was clicked, then
     // redisplay as in edit_action() but also replicate the fee and
     // include a piece of javascript to call dispense().
     //
     if ($_POST['disp_button']) {
         $this->assign("DISP_QUANTITY", $_POST['disp_quantity']);
         $this->assign("DISP_FEE", $_POST['disp_fee']);
         $this->assign("ENDING_JAVASCRIPT", "dispense();");
         $this->_state = false;
         return $this->edit_action($this->prescriptions[0]->id);
     }
     // Set the AMC reporting flag (to record percentage of prescriptions that
     // are set as e-prescriptions)
     if (!empty($_POST['escribe_flag'])) {
         // add the e-prescribe flag
         processAmcCall('e_prescribe_amc', true, 'add', $this->prescriptions[0]->get_patient_id(), 'prescriptions', $this->prescriptions[0]->id);
     } else {
         // remove the e-prescribe flag
         processAmcCall('e_prescribe_amc', true, 'remove', $this->prescriptions[0]->get_patient_id(), 'prescriptions', $this->prescriptions[0]->id);
     }
     // TajEmo Work by CB 2012/05/29 02:58:29 PM to stop from going to send screen. Improves Work Flow
     //     if ($this->prescriptions[0]->get_active() > 0) {
     //       return $this->send_action($this->prescriptions[0]->id);
     //     }
     $this->list_action($this->prescriptions[0]->get_patient_id());
     exit;
 }
Example #19
0
 function note_action_process($patient_id)
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $n = new Note();
     parent::populate_object($n);
     $n->persist();
     $this->_state = false;
     $_POST['process'] = "";
     return $this->view_action($patient_id, $n->get_foreign_id());
 }
Example #20
0
 function edit_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     //print_r($_POST);
     // Stupid Smarty code treats empty values as not specified values.
     // Since active is a checkbox, represent the unchecked state as -1.
     if (empty($_POST['active'])) {
         $_POST['active'] = '-1';
     }
     $this->prescriptions[0] = new Prescription($_POST['id']);
     parent::populate_object($this->prescriptions[0]);
     //echo $this->prescriptions[0]->toString(true);
     $this->prescriptions[0]->persist();
     $_POST['process'] = "";
     // If the "Prescribe and Dispense" button was clicked, then
     // redisplay as in edit_action() but also replicate the fee and
     // include a piece of javascript to call dispense().
     //
     if ($_POST['disp_button']) {
         $this->assign("DISP_QUANTITY", $_POST['disp_quantity']);
         $this->assign("DISP_FEE", $_POST['disp_fee']);
         $this->assign("ENDING_JAVASCRIPT", "dispense();");
         $this->_state = false;
         return $this->edit_action($this->prescriptions[0]->id);
     }
     if ($this->prescriptions[0]->get_active() > 0) {
         return $this->send_action($this->prescriptions[0]->id);
     }
     $this->list_action($this->prescriptions[0]->get_patient_id());
     exit;
 }