//=============================================================================== set_time_limit(0); if (isset($_POST["mode"])) { if ($_POST["mode"] == "DeletePayments") { $DeletePaymentId = trim(formData('DeletePaymentId')); $ResultSearch = sqlStatement("SELECT distinct encounter,pid from ar_activity where session_id ='{$DeletePaymentId}'"); if (sqlNumRows($ResultSearch) > 0) { while ($RowSearch = sqlFetchArray($ResultSearch)) { $Encounter = $RowSearch['encounter']; $PId = $RowSearch['pid']; sqlStatement("update form_encounter set last_level_closed=last_level_closed - 1 where pid ='{$PId}' and encounter='{$Encounter}'"); } } //delete and log that action row_delete("ar_session", "session_id ='{$DeletePaymentId}'"); row_delete("ar_activity", "session_id ='{$DeletePaymentId}'"); $Message = 'Delete'; //------------------ $_POST["mode"] = "SearchPayment"; } //=============================================================================== //Search section. //=============================================================================== if ($_POST["mode"] == "SearchPayment") { $FromDate = trim(formData('FromDate')); $ToDate = trim(formData('ToDate')); $PaymentMethod = trim(formData('payment_method')); $CheckNumber = trim(formData('check_number')); $PaymentAmount = trim(formData('payment_amount')); $PayingEntity = trim(formData('type_name')); $PaymentCategory = trim(formData('adjustment_code'));
function form_delete($formdir, $formid) { $formdir = $formdir == 'newpatient' ? 'encounter' : $formdir; if (substr($formdir, 0, 3) == 'LBF') { row_delete("lbf_data", "form_id = '{$formid}'"); } else { row_delete("form_{$formdir}", "id = '{$formid}'"); } }
$screen = 'edit_payment'; //=============================================================================== // deletion of payment distribution code //=============================================================================== if (isset($_POST["mode"])) { if ($_POST["mode"] == "DeletePaymentDistribution") { $DeletePaymentDistributionId = trim(formData('DeletePaymentDistributionId')); $DeletePaymentDistributionIdArray = explode('_', $DeletePaymentDistributionId); $payment_id = $DeletePaymentDistributionIdArray[0]; $PId = $DeletePaymentDistributionIdArray[1]; $Encounter = $DeletePaymentDistributionIdArray[2]; $Code = $DeletePaymentDistributionIdArray[3]; $Modifier = $DeletePaymentDistributionIdArray[4]; $Codetype = $DeletePaymentDistributionIdArray[5]; //delete and log that action row_delete("ar_activity", "session_id ='{$payment_id}' and pid ='{$PId}' AND " . "encounter='{$Encounter}' and code_type='{$Codetype}' and code='{$Code}' and modifier='{$Modifier}'"); $Message = 'Delete'; //------------------ $_POST["mode"] = "searchdatabase"; } } //=============================================================================== //Modify Payment Code. //=============================================================================== if (isset($_POST["mode"])) { if ($_POST["mode"] == "ModifyPayments" || $_POST["mode"] == "FinishPayments") { $payment_id = $_REQUEST['payment_id']; //ar_session Code //=============================================================================== if (trim(formData('type_name')) == 'insurance') { $QueryPart = "payer_id = '" . trim(formData('hidden_type_code')) . "', patient_id = '" . 0;
/*** START CODE to DEAL WITH PMSFH/ISUUE_TYPES ****/ if ($_REQUEST['PMSFH_save'] == '1') { if (!$PMSFH) { $PMSFH = build_PMSFH($pid); } $issue = $_REQUEST['issue']; $deletion = $_REQUEST['deletion']; $form_save = $_REQUEST['form_save']; $pid = $_SESSION['pid']; $encounter = $_SESSION['encounter']; $form_id = $_REQUEST['form_id']; $form_type = $_REQUEST['form_type']; $r_PMSFH = $_REQUEST['r_PMSFH']; if ($deletion == 1) { row_delete("issue_encounter", "list_id = '{$issue}'"); row_delete("lists", "id = '{$issue}'"); $PMSFH = build_PMSFH($pid); send_json_values($PMSFH); exit; } else { if ($form_type == 'ROS') { //ROS $query = "UPDATE form_eye_mag set ROSGENERAL=?,ROSHEENT=?,ROSCV=?,ROSPULM=?,ROSGI=?,ROSGU=?,ROSDERM=?,ROSNEURO=?,ROSPSYCH=?,ROSMUSCULO=?,ROSIMMUNO=?,ROSENDOCRINE=? where id=? and pid=?"; sqlStatement($query, array($_REQUEST['ROSGENERAL'], $_REQUEST['ROSHEENT'], $_REQUEST['ROSCV'], $_REQUEST['ROSPULM'], $_REQUEST['ROSGI'], $_REQUEST['ROSGU'], $_REQUEST['ROSDERM'], $_REQUEST['ROSNEURO'], $_REQUEST['ROSPSYCH'], $_REQUEST['ROSMUSCULO'], $_REQUEST['ROSIMMUNO'], $_REQUEST['ROSENDOCRINE'], $form_id, $pid)); $PMSFH = build_PMSFH($pid); send_json_values($PMSFH); exit; } elseif ($form_type == 'SOCH') { //SocHx $newdata = array(); $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = 'HIS' AND uor > 0 AND field_id != '' " . "ORDER BY group_name, seq");
function delete_document($document) { $trow = sqlQuery("SELECT url FROM documents WHERE id = '{$document}'"); $url = $trow['url']; row_delete("categories_to_documents", "document_id = '{$document}'"); row_delete("documents", "id = '{$document}'"); row_delete("gprelations", "type1 = 1 AND id1 = '{$document}'"); if (substr($url, 0, 7) == 'file://') { @unlink(substr($url, 7)); } }
if ($_POST['form_save']) { if ($debug) { echo xl("This module is in test mode. The database will not be changed.", '', '<p><b>', "</b><p>\n"); } if ($INTEGRATED_AR) { $session_id = arGetSession($form_payer_id, $form_reference, $form_check_date, $form_deposit_date, $form_pay_total); // The sl_eob_search page needs its invoice links modified to invoke // javascript to load form parms for all the above and submit. // At the same time that page would be modified to work off the // openemr database exclusively. // And back to the sl_eob_invoice page, I think we may want to move // the source input fields from row level to header level. // Handle deletes. row_delete() is borrowed from deleter.php. if ($ALLOW_DELETE && !$debug) { foreach ($_POST['form_del'] as $arseq => $dummy) { row_delete("ar_activity", "pid = '{$patient_id}' AND " . "encounter = '{$encounter_id}' AND sequence_no = '{$arseq}'"); } } } $paytotal = 0; foreach ($_POST['form_line'] as $code => $cdata) { if (!$INTEGRATED_AR) { $thissrc = trim($cdata['src']); $thisdate = trim($cdata['date']); } $thispay = trim($cdata['pay']); $thisadj = trim($cdata['adj']); $thisins = trim($cdata['ins']); $reason = strip_escape_custom($cdata['reason']); // Get the adjustment reason type. Possible values are: // 1 = Charge adjustment
function delete_document($document) { $trow = sqlQuery("SELECT url, thumb_url, storagemethod, couch_docid, couch_revid FROM documents WHERE id = ?", array($document)); $url = $trow['url']; $thumb_url = $trow['thumb_url']; row_delete("categories_to_documents", "document_id = '" . add_escape_custom($document) . "'"); row_delete("documents", "id = '" . add_escape_custom($document) . "'"); row_delete("gprelations", "type1 = 1 AND id1 = '" . add_escape_custom($document) . "'"); switch ((int) $trow['storagemethod']) { //for hard disk store case 0: @unlink(substr($url, 7)); if (!is_null($thumb_url)) { @unlink(substr($thumb_url, 7)); } break; //for CouchDB store //for CouchDB store case 1: $couchDB = new CouchDB(); $couchDB->DeleteDoc($GLOBALS['couchdb_dbase'], $trow['couch_docid'], $trow['couch_revid']); break; } }
//=============================================================================== // deletion of payment distribution code //=============================================================================== if (isset($_POST["mode"])) { if ($_POST["mode"] == "DeletePaymentDistribution") { $DeletePaymentDistributionId=trim(formData('DeletePaymentDistributionId' )); $DeletePaymentDistributionIdArray=split('_',$DeletePaymentDistributionId); $payment_id=$DeletePaymentDistributionIdArray[0]; $PId=$DeletePaymentDistributionIdArray[1]; $Encounter=$DeletePaymentDistributionIdArray[2]; $Code=$DeletePaymentDistributionIdArray[3]; $Modifier=$DeletePaymentDistributionIdArray[4]; //delete and log that action row_delete("ar_activity", "session_id ='$payment_id' and pid ='$PId' AND " . "encounter='$Encounter' and code='$Code' and modifier='$Modifier'"); $Message='Delete'; //------------------ $_POST["mode"] = "searchdatabase"; } } //=============================================================================== //Modify Payment Code. //=============================================================================== if (isset($_POST["mode"])) { if ($_POST["mode"] == "ModifyPayments" || $_POST["mode"] == "FinishPayments") { $payment_id=$_REQUEST['payment_id']; //ar_session Code //===============================================================================