function loadTemplate($file, $rec = null)
{
    global $scart;
    $file = PATHTOTEMPLATESEDIT . "/" . $file;
    $lines = file($file);
    foreach ($lines as $line_num => $line_value) {
        if ($line_num > 0) {
            $working .= $line_value;
        }
    }
    $read = $working;
    preg_match_all('([[a-z|_]+])', $read, $matches);
    if (is_array($matches)) {
        foreach ($matches[0] as $key => $value) {
            $findme = $value;
            $rec_value = substr(trim($value, "]"), 1);
            $replacewith = $rec[$rec_value];
            if ($value == "[date]") {
                $replacewith = fixDate($rec[$rec_value]);
            }
            if ($value == "[phone]") {
                $replacewith = fixPhone($rec[$rec_value]);
            }
            if ($value == "[buyers_name]") {
                $replacewith = stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["fname"]) . " " . stripslashes($_SESSION[SHOPPING_SESSION_ID]["field"]["lname"]);
            }
            if ($value == "[company_name]") {
                $replacewith = COMPANYNAME;
            }
            if ($value == "[company_phone]") {
                $replacewith = fixPhone(CONTACTPHONE);
            }
            if ($value == "[company_email]") {
                $replacewith = COMPANYEMAIL;
            }
            if ($value == "[admin_email]") {
                $replacewith = SEND_SMTP_TO;
            }
            if ($value == "[invoice_amount]") {
                $replacewith = "\$" . number_format($rec["amount"], 2);
            }
            if ($value == "[invoice_number]") {
                $replacewith = $rec["inv_numb"];
            }
            if ($value == "[approval_code]") {
                $replacewith = $rec["trans_numb"];
            }
            if ($value == "[last_four]") {
                $replacewith = $rec["last_four"];
            }
            if ($value == "[giftcard_program]") {
                $replacewith = GIFTCARD_PROGRAM;
            }
            $read = str_replace($findme, stripslashes($replacewith), $read);
        }
    }
    return $read;
}
Example #2
0
function setInsurance($pid, $ainsurance, $asubscriber, $seq)
{
    $iwhich = $seq == '2' ? "secondary" : ($seq == '3' ? "tertiary" : "primary");
    newInsuranceData($pid, $iwhich, $ainsurance["provider{$seq}"], $ainsurance["policy{$seq}"], $ainsurance["group{$seq}"], $ainsurance["name{$seq}"], $asubscriber["lname{$seq}"], $asubscriber["mname{$seq}"], $asubscriber["fname{$seq}"], $asubscriber["relationship{$seq}"], $asubscriber["ss{$seq}"], fixDate($asubscriber["dob{$seq}"]), $asubscriber["street{$seq}"], $asubscriber["zip{$seq}"], $asubscriber["city{$seq}"], $asubscriber["state{$seq}"], $asubscriber["country{$seq}"], $asubscriber["phone{$seq}"], $asubscriber["employer{$seq}"], $asubscriber["employer_street{$seq}"], $asubscriber["employer_city{$seq}"], $asubscriber["employer_zip{$seq}"], $asubscriber["employer_state{$seq}"], $asubscriber["employer_country{$seq}"], $ainsurance["copay{$seq}"], $asubscriber["sex{$seq}"]);
}
    echo "    \n";
    echo "  </td>\n";
    echo " </tr>\n";
    $grand_total_charges += $docrow['charges'];
    $grand_total_copays += $docrow['copays'];
    $grand_total_encounters += $docrow['encounters'];
    $docrow['charges'] = 0;
    $docrow['copays'] = 0;
    $docrow['encounters'] = 0;
}
$form_facility = isset($_POST['form_facility']) ? $_POST['form_facility'] : '';
$form_from_date = fixDate($_POST['form_from_date'], date('Y-m-d'));
$form_to_date = fixDate($_POST['form_to_date'], date('Y-m-d'));
if ($_POST['form_refresh']) {
    $form_from_date = fixDate($_POST['form_from_date'], date('Y-m-d'));
    $form_to_date = fixDate($_POST['form_to_date'], "");
    // MySQL doesn't grok full outer joins so we do it the hard way.
    //
    $query = "( " . "SELECT " . "e.pc_eventDate, e.pc_startTime, " . "fe.encounter, fe.date AS encdate, " . "f.authorized, " . "p.fname, p.lname, p.pid, p.pubpid, " . "CONCAT( u.lname, ', ', u.fname ) AS docname " . "FROM openemr_postcalendar_events AS e " . "LEFT OUTER JOIN form_encounter AS fe " . "ON fe.date = e.pc_eventDate AND fe.pid = e.pc_pid " . "LEFT OUTER JOIN forms AS f ON f.pid = fe.pid AND f.encounter = fe.encounter AND f.formdir = 'newpatient' " . "LEFT OUTER JOIN patient_data AS p ON p.pid = e.pc_pid " . "LEFT OUTER JOIN users AS u ON u.id = fe.provider_id WHERE ";
    if ($form_to_date) {
        $query .= "e.pc_eventDate >= '{$form_from_date}' AND e.pc_eventDate <= '{$form_to_date}' ";
    } else {
        $query .= "e.pc_eventDate = '{$form_from_date}' ";
    }
    if ($form_facility !== '') {
        $query .= "AND e.pc_facility = '{$form_facility}' ";
    }
    // $query .= "AND ( e.pc_catid = 5 OR e.pc_catid = 9 OR e.pc_catid = 10 ) " .
    $query .= "AND e.pc_pid != '' AND e.pc_apptstatus != '?' " . ") UNION ( " . "SELECT " . "e.pc_eventDate, e.pc_startTime, " . "fe.encounter, fe.date AS encdate, " . "f.authorized, " . "p.fname, p.lname, p.pid, p.pubpid, " . "CONCAT( u.lname, ', ', u.fname ) AS docname " . "FROM form_encounter AS fe " . "LEFT OUTER JOIN openemr_postcalendar_events AS e " . "ON fe.date = e.pc_eventDate AND fe.pid = e.pc_pid AND " . "e.pc_pid != '' AND e.pc_apptstatus != '?' " . "LEFT OUTER JOIN forms AS f ON f.pid = fe.pid AND f.encounter = fe.encounter AND f.formdir = 'newpatient' " . "LEFT OUTER JOIN patient_data AS p ON p.pid = fe.pid " . "LEFT OUTER JOIN users AS u ON u.id = fe.provider_id WHERE ";
    if ($form_to_date) {
        // $query .= "LEFT(fe.date, 10) >= '$form_from_date' AND LEFT(fe.date, 10) <= '$form_to_date' ";
Example #4
0
// Copyright (C) 2008 Rod Roark <*****@*****.**>
// Copyright (C) 2010 Tomasz Wyderka <*****@*****.**>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This report lists non reported patient diagnoses for a given date range.
require_once "../globals.php";
require_once "{$srcdir}/patient.inc";
require_once "../../custom/code_types.inc.php";
if (isset($_POST['form_from_date'])) {
    $from_date = $_POST['form_from_date'] !== "" ? fixDate($_POST['form_from_date'], date('Y-m-d')) : 0;
}
if (isset($_POST['form_to_date'])) {
    $to_date = $_POST['form_to_date'] !== "" ? fixDate($_POST['form_to_date'], date('Y-m-d')) : 0;
}
//
$form_code = isset($_POST['form_code']) ? $_POST['form_code'] : array();
//
if (empty($form_code)) {
    $query_codes = '';
} else {
    $query_codes = 'c.id in (';
    foreach ($form_code as $code) {
        $query_codes .= $code . ",";
    }
    $query_codes = substr($query_codes, 0, -1);
    $query_codes .= ') and ';
}
//
Example #5
0
$fake_register_globals = false;
require_once "../globals.php";
require_once "{$srcdir}/patient.inc";
require_once "{$srcdir}/options.inc.php";
require_once "../drugs/drugs.inc.php";
require_once "{$srcdir}/formatting.inc.php";
function add_date($givendate, $day = 0, $mth = 0, $yr = 0)
{
    $cd = strtotime($givendate);
    $newdate = date('Y-m-d', mktime(date('h', $cd), date('i', $cd), date('s', $cd), date('m', $cd) + $mth, date('d', $cd) + $day, date('Y', $cd) + $yr));
    return $newdate;
}
$type = $_POST["type"];
$facility = isset($_POST['facility']) ? $_POST['facility'] : '';
$sql_date_from = fixDate($_POST['date_from'], date('Y-01-01'));
$sql_date_to = fixDate($_POST['date_to'], add_date(date('Y-m-d')));
$patient_id = trim($_POST["patient_id"]);
$age_from = $_POST["age_from"];
$age_to = $_POST["age_to"];
$sql_gender = $_POST["gender"];
$sql_ethnicity = $_POST["ethnicity"];
$sql_race = $_POST["race"];
$form_drug_name = trim($_POST["form_drug_name"]);
$form_diagnosis = trim($_POST["form_diagnosis"]);
$form_lab_results = trim($_POST["form_lab_results"]);
$form_service_codes = trim($_POST["form_service_codes"]);
?>
<html>
<head>
<?php 
html_header_show();
Example #6
0
        ++$i;
    }
    return $i;
}
// If we are saving, then save and close the window.
//
if ($_POST['form_save']) {
    $i = 0;
    $text_type = "unknown";
    foreach ($ISSUE_TYPES as $key => $value) {
        if ($i++ == $_POST['form_type']) {
            $text_type = $key;
        }
    }
    $form_begin = fixDate($_POST['form_begin'], '');
    $form_end = fixDate($_POST['form_end'], '');
    if ($text_type == 'football_injury') {
        $form_injury_part = $_POST['form_injury_part'];
        $form_injury_type = $_POST['form_injury_type'];
    } else {
        $form_injury_part = $_POST['form_medical_system'];
        $form_injury_type = $_POST['form_medical_type'];
    }
    if ($issue) {
        $query = "UPDATE lists SET " . "type = '" . $text_type . "', " . "title = '" . $_POST['form_title'] . "', " . "comments = '" . $_POST['form_comments'] . "', " . "begdate = " . QuotedOrNull($form_begin) . ", " . "enddate = " . QuotedOrNull($form_end) . ", " . "returndate = " . QuotedOrNull($form_return) . ", " . "diagnosis = '" . $_POST['form_diagnosis'] . "', " . "occurrence = '" . $_POST['form_occur'] . "', " . "classification = '" . $_POST['form_classification'] . "', " . "reinjury_id = '" . $_POST['form_reinjury_id'] . "', " . "referredby = '" . $_POST['form_referredby'] . "', " . "injury_grade = '" . $_POST['form_injury_grade'] . "', " . "injury_part = '" . $form_injury_part . "', " . "injury_type = '" . $form_injury_type . "', " . "outcome = '" . $_POST['form_outcome'] . "', " . "destination = '" . $_POST['form_destination'] . "', " . "reaction ='" . $_POST['form_reaction'] . "' " . "WHERE id = '{$issue}'";
        sqlStatement($query);
        if ($text_type == "medication" && enddate != '') {
            sqlStatement('UPDATE prescriptions SET ' . 'medication = 0 where patient_id = ' . $thispid . " and upper(trim(drug)) = '" . strtoupper($_POST['form_title']) . "' " . ' and medication = 1');
        }
    } else {
        $issue = sqlInsert("INSERT INTO lists ( " . "date, pid, type, title, activity, comments, begdate, enddate, returndate, " . "diagnosis, occurrence, classification, referredby, user, groupname, " . "outcome, destination, reinjury_id, injury_grade, injury_part, injury_type, " . "reaction " . ") VALUES ( " . "NOW(), " . "'{$thispid}', " . "'" . $text_type . "', " . "'" . $_POST['form_title'] . "', " . "1, " . "'" . $_POST['form_comments'] . "', " . QuotedOrNull($form_begin) . ", " . QuotedOrNull($form_end) . ", " . QuotedOrNull($form_return) . ", " . "'" . $_POST['form_diagnosis'] . "', " . "'" . $_POST['form_occur'] . "', " . "'" . $_POST['form_classification'] . "', " . "'" . $_POST['form_referredby'] . "', " . "'" . ${$_SESSION}['authUser'] . "', " . "'" . ${$_SESSION}['authProvider'] . "', " . "'" . $_POST['form_outcome'] . "', " . "'" . $_POST['form_destination'] . "', " . "'" . $_POST['form_reinjury_id'] . "', " . "'" . $_POST['form_injury_grade'] . "', " . "'" . $form_injury_part . "', " . "'" . $form_injury_type . "', " . "'" . $_POST['form_reaction'] . "' " . ")");
Example #7
0
 public static function batch_despatch($var, $func, $data_credentials)
 {
     global $pid;
     if (UserService::valid($data_credentials)) {
         require_once "../../library/invoice_summary.inc.php";
         require_once "../../library/options.inc.php";
         require_once "../../library/acl.inc";
         require_once "../../library/patient.inc";
         if ($func == 'ar_responsible_party') {
             $patient_id = $pid;
             $encounter_id = $var['encounter'];
             $x['ar_responsible_party'] = ar_responsible_party($patient_id, $encounter_id);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'getInsuranceData') {
             $type = $var['type'];
             $given = $var['given'];
             $x = getInsuranceData($pid, $type, $given);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'generate_select_list') {
             $tag_name = $var['tag_name'];
             $list_id = $var['list_id'];
             $currvalue = $var['currvalue'];
             $title = $var['title'];
             $empty_name = $var['empty_name'];
             $class = $var['class'];
             $onchange = $var['onchange'];
             $x['generate_select_list'] = generate_select_list($tag_name, $list_id, $currvalue, $title, $empty_name, $class, $onchange);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'xl_layout_label') {
             $constant = $var['constant'];
             $x['xl_layout_label'] = xl_layout_label($constant);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'generate_form_field') {
             $frow = $var['frow'];
             $currvalue = $var['currvalue'];
             ob_start();
             generate_form_field($frow, $currvalue);
             $x['generate_form_field'] = ob_get_contents();
             ob_end_clean();
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'getInsuranceProviders') {
             $i = $var['i'];
             $provider = $var['provider'];
             $insurancei = getInsuranceProviders();
             $x = $insurancei;
             return $x;
         } elseif ($func == 'get_layout_form_value') {
             $frow = $var['frow'];
             $_POST = $var['post_array'];
             $x['get_layout_form_value'] = get_layout_form_value($frow);
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'updatePatientData') {
             $patient_data = $var['patient_data'];
             $create = $var['create'];
             updatePatientData($pid, $patient_data, $create);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'updateEmployerData') {
             $employer_data = $var['employer_data'];
             $create = $var['create'];
             updateEmployerData($pid, $employer_data, $create);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'newHistoryData') {
             newHistoryData($pid);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'newInsuranceData') {
             $_POST = $var[0];
             foreach ($var as $key => $value) {
                 if ($key >= 3) {
                     $var[$key] = formData($value);
                 }
                 if ($key >= 1) {
                     $parameters[$key] = $var[$key];
                 }
             }
             $parameters[12] = fixDate($parameters[12]);
             $parameters[27] = fixDate($parameters[27]);
             call_user_func_array('newInsuranceData', $parameters);
             $x['ok'] = 'ok';
             return UserService::function_return_to_xml($x);
         } elseif ($func == 'generate_layout_validation') {
             $form_id = $var['form_id'];
             ob_start();
             generate_layout_validation($form_id);
             $x = ob_get_clean();
             return $x;
         }
     } else {
         throw new SoapFault("Server", "credentials failed");
     }
 }
     if (PEAR::isError($success)) {
         fwrite(STDERR, "Error, failed to add instrument ({$testName}) to the battery for timepoint ({$sessionID}):\n" . $success->getMessage() . "\n");
         return false;
     }
     break;
     /**
      * Fixing the dates
      * arguments: $candID, $dateType, $newDate, $sessionID
      */
 /**
  * Fixing the dates
  * arguments: $candID, $dateType, $newDate, $sessionID
  */
 case 'fix_date':
     // fix the date (arguments are checked by the function
     $success = fixDate($candID, $dateType, $newDate, $sessionID);
     if (PEAR::isError($success)) {
         fwrite(STDERR, "Failed to fix the date ({$newDate}) of type ({$dateType}) for candidate ({$candID}) [timepoint ({$sessionID})]:\n" . $success->getMessage() . "\n");
         return false;
     }
     break;
     /**
      * Timepoint Diagnostics
      * Recommended: run the diagnostics once the dates have been fixed, you can also pass the 'correct' date and the date type to see what changes would happen if the dates were different
      */
 /**
  * Timepoint Diagnostics
  * Recommended: run the diagnostics once the dates have been fixed, you can also pass the 'correct' date and the date type to see what changes would happen if the dates were different
  */
 case 'diagnose':
     if (!empty($sessionID)) {
Example #9
0
function loadColumnData($key, $row)
{
    global $areport, $arr_titles, $from_date, $to_date, $arr_show;
    // If no result, do nothing.
    if (empty($row['abnormal'])) {
        return;
    }
    // If first instance of this key, initialize its arrays.
    if (empty($areport[$key])) {
        $areport[$key] = array();
        $areport[$key]['.prp'] = 0;
        // previous pid
        $areport[$key]['.wom'] = 0;
        // number of positive results for women
        $areport[$key]['.men'] = 0;
        // number of positive results for men
        $areport[$key]['.neg'] = 0;
        // number of negative results
        $areport[$key]['.age'] = array(0, 0, 0, 0, 0, 0, 0, 0, 0);
        // age array
        foreach ($arr_show as $askey => $dummy) {
            if (substr($askey, 0, 1) == '.') {
                continue;
            }
            $areport[$key][$askey] = array();
        }
    }
    // Flag this patient as having been encountered for this report row.
    $areport[$key]['.prp'] = $row['pid'];
    // Collect abnormal results only, except for a column of total negatives.
    if ($row['abnormal'] == 'no') {
        ++$areport[$key]['.neg'];
        return;
    }
    // Increment the correct sex category.
    if (strcasecmp($row['sex'], 'Male') == 0) {
        ++$areport[$key]['.men'];
    } else {
        ++$areport[$key]['.wom'];
    }
    // Increment the correct age category.
    $age = getAge(fixDate($row['DOB']), $row['date_ordered']);
    $i = min(intval(($age - 5) / 5), 8);
    if ($age < 11) {
        $i = 0;
    }
    ++$areport[$key]['.age'][$i];
    // For each patient attribute to report, this increments the array item
    // whose key is the attribute's value.  This works well for list-based
    // attributes.  A key of "Unspecified" is used where the attribute has
    // no assigned value.
    foreach ($arr_show as $askey => $dummy) {
        if (substr($askey, 0, 1) == '.') {
            continue;
        }
        $status = empty($row[$askey]) ? 'Unspecified' : $row[$askey];
        $areport[$key][$askey][$status] += 1;
        $arr_titles[$askey][$status] += 1;
    }
}
Example #10
0
 /**
  * displayLatestMessageBoardPosts 
  * 
  * @param int $memberId 
  * 
  * @return void
  */
 function displayLatestMessageBoardPosts($memberId)
 {
     $memberId = (int) $memberId;
     $sql = "SELECT t.`id`, `subject`, `date`, `post` \n                FROM `fcms_board_posts` AS p, `fcms_board_threads` AS t, `fcms_users` AS u \n                WHERE t.`id` = p.`thread` \n                AND p.`user` = u.`id` \n                AND u.`id` = ?\n                ORDER BY `date` DESC \n                LIMIT 0, 5";
     $rows = $this->fcmsDatabase->getRows($sql, $memberId);
     if ($rows === false) {
         $this->fcmsError->displayError();
         return;
     }
     if (count($rows) <= 0) {
         return;
     }
     echo '
         <h2>' . T_('Latest Posts') . '</h2>';
     $tzOffset = getTimezone($memberId);
     foreach ($rows as $row) {
         $date = fixDate(T_('F j, Y, g:i a'), $tzOffset, $row['date']);
         $subject = $row['subject'];
         $post = removeBBCode($row['post']);
         $post = cleanOutput($post);
         $pos = strpos($subject, '#ANOUNCE#');
         if ($pos !== false) {
             $subject = substr($subject, 9, strlen($subject) - 9);
         }
         $subject = cleanOutput($subject);
         echo '
             <p>
                 <a href="messageboard.php?thread=' . $row['id'] . '">' . $subject . '</a> 
                 <span class="date">' . $date . '</span><br/>
                 ' . $post . '
             </p>';
     }
 }
Example #11
0
function LWDate($field)
{
    $tmp = fixDate($field);
    return substr($tmp, 5, 2) . substr($tmp, 8, 2) . substr($tmp, 0, 4);
}
Example #12
0
function loadColumnData($key, $row, $quantity = 1)
{
    global $areport, $arr_titles, $form_content, $from_date, $to_date, $arr_show;
    // If first instance of this key, initialize its arrays.
    if (empty($areport[$key])) {
        $areport[$key] = array();
        $areport[$key]['.prp'] = 0;
        // previous pid
        $areport[$key]['.wom'] = 0;
        // number of services for women
        $areport[$key]['.men'] = 0;
        // number of services for men
        $areport[$key]['.age2'] = array(0, 0);
        // age array
        $areport[$key]['.age9'] = array(0, 0, 0, 0, 0, 0, 0, 0, 0);
        // age array
        foreach ($arr_show as $askey => $dummy) {
            if (substr($askey, 0, 1) == '.') {
                continue;
            }
            $areport[$key][$askey] = array();
        }
    }
    // Skip this key if we are counting unique patients and the key
    // has already seen this patient.
    if ($form_content == '2' && $row['pid'] == $areport[$key]['.prp']) {
        return;
    }
    // If we are counting new acceptors, then require a unique patient
    // whose contraceptive start date is within the reporting period.
    if ($form_content == '3') {
        // if ($row['pid'] == $areport[$key]['prp']) return;
        if ($row['pid'] == $areport[$key]['.prp']) {
            return;
        }
        // Check contraceptive start date.
        if (!$row['contrastart'] || $row['contrastart'] < $from_date || $row['contrastart'] > $to_date) {
            return;
        }
    }
    // If we are counting new clients, then require a unique patient
    // whose registration date is within the reporting period.
    if ($form_content == '4') {
        if ($row['pid'] == $areport[$key]['.prp']) {
            return;
        }
        // Check registration date.
        if (!$row['regdate'] || $row['regdate'] < $from_date || $row['regdate'] > $to_date) {
            return;
        }
    }
    // Flag this patient as having been encountered for this report row.
    // $areport[$key]['prp'] = $row['pid'];
    $areport[$key]['.prp'] = $row['pid'];
    // Increment the correct sex category.
    if (strcasecmp($row['sex'], 'Male') == 0) {
        $areport[$key]['.men'] += $quantity;
    } else {
        $areport[$key]['.wom'] += $quantity;
    }
    // Increment the correct age categories.
    $age = getAge(fixDate($row['DOB']), $row['encdate']);
    $i = min(intval(($age - 5) / 5), 8);
    if ($age < 11) {
        $i = 0;
    }
    $areport[$key]['.age9'][$i] += $quantity;
    $i = $age < 25 ? 0 : 1;
    $areport[$key]['.age2'][$i] += $quantity;
    foreach ($arr_show as $askey => $dummy) {
        if (substr($askey, 0, 1) == '.') {
            continue;
        }
        $status = empty($row[$askey]) ? 'Unspecified' : $row[$askey];
        $areport[$key][$askey][$status] += $quantity;
        $arr_titles[$askey][$status] += $quantity;
    }
}
// encounters within the specified time period for patients without
// insurance.
require_once "../globals.php";
require_once "{$srcdir}/patient.inc";
require_once "{$srcdir}/sql-ledger.inc";
require_once "{$srcdir}/formatting.inc.php";
$alertmsg = '';
function bucks($amount)
{
    if ($amount) {
        return oeFormatMoney($amount);
    }
    return "";
}
$form_start_date = fixDate($_POST['form_start_date'], date("Y-01-01"));
$form_end_date = fixDate($_POST['form_end_date'], date("Y-m-d"));
$INTEGRATED_AR = $GLOBALS['oer_config']['ws_accounting']['enabled'] === 2;
if (!$INTEGRATED_AR) {
    SLConnect();
}
?>
<html>
<head>
<?php 
html_header_show();
?>
<style type="text/css">

/* specifically include & exclude from printing */
@media print {
    #report_parameters {
<?php

// Copyright (C) 2006-2015 Rod Roark <*****@*****.**>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This report lists patients that were seen within a given date
// range.
require_once "../globals.php";
require_once "{$srcdir}/patient.inc";
require_once "{$srcdir}/formatting.inc.php";
$from_date = fixDate($_POST['form_from_date'], date('Y-01-01'));
$to_date = fixDate($_POST['form_to_date'], date('Y-12-31'));
if ($_POST['form_labels']) {
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/force-download");
    header("Content-Disposition: attachment; filename=labels.txt");
    header("Content-Description: File Transfer");
} else {
    ?>
<html>
<head>
<?php 
    html_header_show();
    ?>
<style type="text/css">
/* specifically include & exclude from printing */
require ADCHEATSHEET;
require CLASS_LUNCHSPECIAL;
$lunch = new handleLunchSpecial();
?>

<?php 
getHeader("admin");
?>

<h3>Lunch Specials</h3>

<table class="form">
	<tr>
		<td class="field-name">Date:</td>
		<td class="field-value"><?php 
echo fixDate($lunch->date);
?>
</td>
		<td></td>
	</tr>
	<tr>
		<td class="field-name">Views:</td>
		<td class="field-value"><?php 
echo number_format($lunch->views);
?>
</td>
		<td></td>
	</tr>
	<tr>
		<td class="field-name">Options:</td>
		<td class="field-value"><a href="lunch_special_manage.php?menuid=<?php 
    }
    $newdata[$tblname][$colname] = $value;
}
updatePatientData($pid, $newdata['patient_data'], true);
updateEmployerData($pid, $newdata['employer_data'], true);
$i1dob = fixDate(formData("i1subscriber_DOB"));
$i1date = fixDate(formData("i1effective_date"));
// sqlStatement("unlock tables");
// end table lock
newHistoryData($pid);
newInsuranceData($pid, "primary", formData("i1provider"), formData("i1policy_number"), formData("i1group_number"), formData("i1plan_name"), formData("i1subscriber_lname"), formData("i1subscriber_mname"), formData("i1subscriber_fname"), formData("form_i1subscriber_relationship"), formData("i1subscriber_ss"), $i1dob, formData("i1subscriber_street"), formData("i1subscriber_postal_code"), formData("i1subscriber_city"), formData("form_i1subscriber_state"), formData("form_i1subscriber_country"), formData("i1subscriber_phone"), formData("i1subscriber_employer"), formData("i1subscriber_employer_street"), formData("i1subscriber_employer_city"), formData("i1subscriber_employer_postal_code"), formData("form_i1subscriber_employer_state"), formData("form_i1subscriber_employer_country"), formData('i1copay'), formData('form_i1subscriber_sex'), $i1date, formData('i1accept_assignment'));
$i2dob = fixDate(formData("i2subscriber_DOB"));
$i2date = fixDate(formData("i2effective_date"));
newInsuranceData($pid, "secondary", formData("i2provider"), formData("i2policy_number"), formData("i2group_number"), formData("i2plan_name"), formData("i2subscriber_lname"), formData("i2subscriber_mname"), formData("i2subscriber_fname"), formData("form_i2subscriber_relationship"), formData("i2subscriber_ss"), $i2dob, formData("i2subscriber_street"), formData("i2subscriber_postal_code"), formData("i2subscriber_city"), formData("form_i2subscriber_state"), formData("form_i2subscriber_country"), formData("i2subscriber_phone"), formData("i2subscriber_employer"), formData("i2subscriber_employer_street"), formData("i2subscriber_employer_city"), formData("i2subscriber_employer_postal_code"), formData("form_i2subscriber_employer_state"), formData("form_i2subscriber_employer_country"), formData('i2copay'), formData('form_i2subscriber_sex'), $i2date, formData('i2accept_assignment'));
$i3dob = fixDate(formData("i3subscriber_DOB"));
$i3date = fixDate(formData("i3effective_date"));
newInsuranceData($pid, "tertiary", formData("i3provider"), formData("i3policy_number"), formData("i3group_number"), formData("i3plan_name"), formData("i3subscriber_lname"), formData("i3subscriber_mname"), formData("i3subscriber_fname"), formData("form_i3subscriber_relationship"), formData("i3subscriber_ss"), $i3dob, formData("i3subscriber_street"), formData("i3subscriber_postal_code"), formData("i3subscriber_city"), formData("form_i3subscriber_state"), formData("form_i3subscriber_country"), formData("i3subscriber_phone"), formData("i3subscriber_employer"), formData("i3subscriber_employer_street"), formData("i3subscriber_employer_city"), formData("i3subscriber_employer_postal_code"), formData("form_i3subscriber_employer_state"), formData("form_i3subscriber_employer_country"), formData('i3copay'), formData('form_i3subscriber_sex'), $i3date, formData('i3accept_assignment'));
?>
<html>
<body>
<script language="Javascript">
<?php 
if ($alertmsg) {
    echo "alert('{$alertmsg}');\n";
}
echo "window.location='{$rootdir}/patient_file/summary/demographics.php?" . "set_pid={$pid}&is_new=1';\n";
?>
</script>

</body>
</html>
Example #17
0
        echo "   Attach Biometric Fingerprint</a><br />\n";
    }
    echo "   <br />&nbsp;<br />\n";
}
// This stuff only applies to athletic team use of OpenEMR.  The client
// insisted on being able to quickly change fitness and return date here:
//
if (false && $GLOBALS['athletic_team']) {
    //                  blue      green     yellow    red       orange
    $fitcolors = array('#6677ff', '#00cc00', '#ffff00', '#ff3333', '#ff8800', '#ffeecc', '#ffccaa');
    if (!empty($GLOBALS['fitness_colors'])) {
        $fitcolors = $GLOBALS['fitness_colors'];
    }
    $fitcolor = $fitcolors[0];
    $form_fitness = $_POST['form_fitness'];
    $form_userdate1 = fixDate($_POST['form_userdate1'], '');
    $form_issue_id = $_POST['form_issue_id'];
    if ($form_submit) {
        $returndate = $form_userdate1 ? "'{$form_userdate1}'" : "NULL";
        sqlStatement("UPDATE patient_data SET fitness = ?, " . "userdate1 = ? WHERE pid = ?", array($form_fitness, $returndate, $pid));
        // Update return date in the designated issue, if requested.
        if ($form_issue_id) {
            sqlStatement("UPDATE lists SET returndate = ? WHERE " . "id = ?", array($returndate, $form_issue_id));
        }
    } else {
        $form_fitness = $result['fitness'];
        if (!$form_fitness) {
            $form_fitness = 1;
        }
        $form_userdate1 = $result['userdate1'];
    }
Example #18
0
// Consider this a step towards converting issue forms to layout-based.
// Faking it here makes things easier.
//
$issue_layout = array(array('field_id' => 'type', 'title' => 'Type', 'uor' => '2', 'data_type' => '17', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'title', 'title' => 'Title', 'uor' => '2', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'diagnosis', 'title' => 'Diagnosis', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'begdate', 'title' => 'Start Date', 'uor' => '2', 'data_type' => '4', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'enddate', 'title' => 'End Date', 'uor' => '1', 'data_type' => '4', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'occurrence', 'title' => 'Occurrence', 'uor' => '1', 'data_type' => '1', 'list_id' => 'occurrence', 'edit_options' => ''), array('field_id' => 'reaction', 'title' => 'Reaction', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'outcome', 'title' => 'Outcome', 'uor' => '1', 'data_type' => '1', 'list_id' => 'outcome', 'edit_options' => ''), array('field_id' => 'destination', 'title' => 'Destination', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'comments', 'title' => 'Comments', 'uor' => '1', 'data_type' => '3', 'list_id' => '', 'fld_length' => '50', 'fld_rows' => '3', 'edit_options' => ''));
$postid = intval($_REQUEST['postid']);
$issueid = empty($_REQUEST['issueid']) ? 0 : intval($_REQUEST['issueid']);
$form_type = empty($_REQUEST['form_type']) ? '' : $_REQUEST['form_type'];
if ($_POST['bn_save']) {
    $ptid = intval($_POST['ptid']);
    $sets = "date = NOW()";
    foreach ($issue_layout as $frow) {
        $key = $frow['field_id'];
        $value = get_layout_form_value($frow);
        if ($frow['data_type'] == 4) {
            // Dates require some special handling.
            $value = fixDate($value, '');
            if (empty($value)) {
                $value = "NULL";
            } else {
                $value = "'{$value}'";
            }
        } else {
            $value = "'" . add_escape_custom($value) . "'";
        }
        $sets .= ", `{$key}` = {$value}";
    }
    if (empty($issueid)) {
        $sql = "INSERT INTO lists SET " . "pid = '" . add_escape_custom($ptid) . "', activity = 1, " . "user = '******'authUser']) . "', " . "groupname = '" . add_escape_custom($_SESSION['authProvider']) . "', {$sets}";
        $issueid = sqlInsert($sql);
    } else {
        $sql = "UPDATE lists SET {$sets} WHERE id = '" . add_escape_custom($issueid) . "'";
 */
//SANITIZE ALL ESCAPES
$sanitize_all_escapes = true;
//STOP FAKE REGISTER GLOBALS
$fake_register_globals = false;
require_once '../globals.php';
require_once "{$srcdir}/formatting.inc.php";
require_once "{$srcdir}/patient.inc";
require_once "{$srcdir}/payment_jav.inc.php";
$DateFormat = DateFormatRead();
$curdate = date_create(date("Y-m-d"));
date_sub($curdate, date_interval_create_from_date_string("7 days"));
$sub_date = date_format($curdate, 'Y-m-d');
// Set the default dates for Lab document search
$form_from_doc_date = $_GET['form_from_doc_date'] ? $_GET['form_from_doc_date'] : oeFormatShortDate(fixDate($_GET['form_from_doc_date'], $sub_date));
$form_to_doc_date = $_GET['form_to_doc_date'] ? $_GET['form_to_doc_date'] : oeFormatShortDate(fixDate($_GET['form_to_doc_date'], date("Y-m-d")));
if ($GLOBALS['date_display_format'] == 1) {
    $title_tooltip = "MM/DD/YYYY";
} elseif ($GLOBALS['date_display_format'] == 2) {
    $title_tooltip = "DD/MM/YYYY";
} else {
    $title_tooltip = "YYYY-MM-DD";
}
$display_div = "style='display:block;'";
$display_expand_msg = "display:none;";
$display_collapse_msg = "display:inline;";
?>

<html>
<head>
Example #20
0
function add_encounter($medics, &$errors)
{
    $msg;
    $patient_pid = $medics->pid;
    $dos = fixDate($medics->fromdate);
    $encounter_id = $GLOBALS['adodb']['db']->GenID('sequences');
    $encounter_reason = form2db($medics->chiefcomplaint);
    addForm($encounter_id, "New Patient Encounter", sqlInsert("INSERT INTO form_encounter SET " . "date = '{$dos}', " . "onset_date = '{$dos}', " . "reason = '{$encounter_reason}', " . "facility = '{$patient_facility_name}', " . "facility_id = '{$patient_facility_id}', " . "sensitivity = 'normal', " . "pid = '{$patient_pid}', " . "encounter = '{$encounter_id}'"), "newpatient", $patient_pid, 1, $dos);
    $msg .= "Created new encounter for " . $medics->pubpid . ".<br>\n";
    // Custom Forms
    $msg .= add_ros_subj($patient_pid, $dos, $encounter_id, $medics, $errors);
    //ROS
    $msg .= add_phyexam_obj($patient_pid, $dos, $encounter_id, $medics, $errors);
    //PE
    $msg .= add_assessment_plan($patient_pid, $dos, $encounter_id, $medics, $errors);
    //Assessment/Plan
    $msg .= add_vitals($patient_pid, $dos, $encounter_id, $medics, $errors);
    //
    $msg .= add_other_dx($patient_pid, $dos, $encounter_id, $medics, $errors);
    //Other DX
    // Fee Sheet
    $msg .= add_billing_records($patient_pid, $dos, $encounter_id, $medics, $errors);
    return $msg;
}
Example #21
0
File: polls.php Project: lmcro/fcms
 /**
  * displayPolls 
  * 
  * @return void
  */
 function displayPolls()
 {
     $this->displayHeader();
     $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
     $pollsData = $this->fcmsPoll->getPolls($page);
     if ($pollsData === false) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $ids = $pollsData['ids'];
     unset($pollsData['ids']);
     $votesLkup = $this->fcmsPoll->getPollsTotalVotes($ids);
     if ($votesLkup === false) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $pollParams = array();
     foreach ($pollsData as $row) {
         $pollParams[] = array('url' => '?id=' . (int) $row['id'], 'question' => cleanOutput($row['question'], 'html'), 'date' => fixDate(T_('M. j, Y, g:i a'), $this->fcmsUser->tzOffset, $row['started']), 'vote' => $votesLkup[$row['id']]);
     }
     $templateParams = array('textPastPolls' => T_('Past Polls'), 'textQuestion' => T_('Question'), 'textDate' => T_('Date'), 'textVotes' => T_('Votes'), 'polls' => $pollParams);
     loadTemplate('poll', 'polls', $templateParams);
     $this->displayFooter();
 }
Example #22
0
     $form_type = "medication";
     if ($_REQUEST['form_eye_subtype']) {
         $subtype = "eye";
         //we always want a default begin date
         //if it is empty, fill it with today
         if ($_REQUEST['form_begin'] == '') {
             $_REQUEST['form_begin'] = date("Y-m-d");
         }
     }
     if ($_REQUEST['form_begin'] == '') {
         $_REQUEST['form_begin'] = $visit_date;
     }
 }
 $i = 0;
 $form_begin = fixDate($_REQUEST['form_begin'], '');
 $form_end = fixDate($_REQUEST['form_end'], '');
 /*
  *  When adding an issue, see if the issue is already here.
  *  If so we need to update it.  If not we are adding it.
  *  Check the PMSFH array first by title.
  *  If not present in PMSFH, check the DB to be sure.
  */
 foreach ($PMSFH[$form_type] as $item) {
     if ($item['title'] == $_REQUEST['form_title']) {
         $issue = $item['issue'];
     }
 }
 if (!$issue) {
     if ($subtype == '') {
         $query = "SELECT id,pid from lists where title=? and type=? and pid=?";
         $issue2 = sqlQuery($query, array($_REQUEST['form_title'], $form_type, $pid));
Example #23
0
function InsertEvent($args)
{
    return sqlInsert("INSERT INTO openemr_postcalendar_events ( " . "pc_catid, pc_multiple, pc_aid, pc_pid, pc_title, pc_time, pc_hometext, " . "pc_informant, pc_eventDate, pc_endDate, pc_duration, pc_recurrtype, " . "pc_recurrspec, pc_startTime, pc_endTime, pc_alldayevent, " . "pc_apptstatus, pc_prefcatid, pc_location, pc_eventstatus, pc_sharing, pc_facility,pc_billing_location " . ") VALUES ( " . "'" . $args['form_category'] . "', " . "'" . $args['new_multiple_value'] . "', " . "'" . $args['form_provider'] . "', " . "'" . $args['form_pid'] . "', " . "'" . formDataCore($args['form_title']) . "', " . "NOW(), " . "'" . formDataCore($args['form_comments']) . "', " . "'" . $_SESSION['authUserID'] . "', " . "'" . $args['event_date'] . "', " . "'" . fixDate($args['form_enddate']) . "', " . "'" . $args['duration'] . "', " . "'" . ($args['form_repeat'] ? '1' : '0') . "', " . "'" . serialize($args['recurrspec']) . "', " . "'" . $args['starttime'] . "', " . "'" . $args['endtime'] . "', " . "'" . $args['form_allday'] . "', " . "'" . $args['form_apptstatus'] . "', " . "'" . $args['form_prefcat'] . "', " . "'" . $args['locationspec'] . "', " . "1, " . "1, " . (int) $args['facility'] . "," . (int) $args['billing_facility'] . " )");
}
Example #24
0
 /**
  * displayExportSubmit 
  * 
  * @return void
  */
 function displayExportSubmit()
 {
     $sql = "SELECT `lname`, `fname`, `address`, `city`, `state`, `zip`, `email`, `home`, `work`, `cell` \n                FROM `fcms_address` AS a, `fcms_users` AS u \n                WHERE a.`user` = u.`id` \n                ORDER BY `lname`, `fname`";
     $rows = $this->fcmsDatabase->getRows($sql);
     if ($rows === false) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $csv = "lname, fname, address, city, state, zip, email, home, work, cell\r\n";
     foreach ($rows as $row) {
         $csv .= '"' . join('","', str_replace('"', '""', $row)) . "\"\r\n";
     }
     $date = fixDate('Y-m-d', $this->fcmsUser->tzOffset);
     header("Content-type: text/plain");
     header("Content-disposition: csv; filename=FCMS_Addresses_{$date}.csv; size=" . strlen($csv));
     echo $csv;
 }
Example #25
0
 if ($i) {
     $ffname = trim(substr($ffname, 0, $i));
 }
 if (!$ffname) {
     $ffname = $filebase;
 }
 $ffmod = '';
 $ffsuff = '.pdf';
 // If the target filename exists, modify it until it doesn't.
 $count = 0;
 while (is_file("{$docdir}/{$ffname}{$ffmod}{$ffsuff}")) {
     ++$count;
     $ffmod = "_{$count}";
 }
 $target = "{$docdir}/{$ffname}{$ffmod}{$ffsuff}";
 $docdate = fixDate($_POST['form_docdate']);
 // Create the target PDF.  Note that we are relying on the .tif files for
 // the individual pages to already exist in the faxcache directory.
 //
 $info_msg .= mergeTiffs();
 // The -j option here requires that libtiff is configured with libjpeg.
 // It could be omitted, but the output PDFs would then be quite large.
 $tmp0 = exec("tiff2pdf -j -p letter -o '{$target}' '{$faxcache}/temp.tif'", $tmp1, $tmp2);
 if ($tmp2) {
     $info_msg .= "tiff2pdf returned {$tmp2}: {$tmp0} ";
 } else {
     $newid = generate_id();
     $fsize = filesize($target);
     $catid = (int) $_POST['form_category'];
     // Update the database.
     $query = "INSERT INTO documents ( " . "id, type, size, date, url, mimetype, foreign_id, docdate" . " ) VALUES ( " . "'{$newid}', 'file_url', '{$fsize}', NOW(), 'file://{$target}', " . "'application/pdf', {$patient_id}, '{$docdate}' " . ")";
Example #26
0
                 $args['recurrspec'] = $recurrspec;
                 $args['starttime'] = $starttime;
                 $args['endtime'] = $endtime;
                 $args['locationspec'] = $locationspec;
                 InsertEvent($args);
             } else {
                 // perform a check to see if user changed event date
                 // this is important when editing an existing recurring event
                 // oct-08 JRM
                 if ($_POST['form_date'] == $_POST['selected_date']) {
                     // user has NOT changed the start date of the event
                     $event_date = fixDate($_POST['event_start_date']);
                 }
                 // mod the SINGLE event or ALL EVENTS in a repeating series
                 // simple provider case
                 sqlStatement("UPDATE openemr_postcalendar_events SET " . "pc_catid = '" . add_escape_custom($_POST['form_category']) . "', " . "pc_aid = '" . add_escape_custom($prov) . "', " . "pc_pid = '" . add_escape_custom($_POST['form_pid']) . "', " . "pc_title = '" . add_escape_custom($_POST['form_title']) . "', " . "pc_time = NOW(), " . "pc_hometext = '" . add_escape_custom($_POST['form_comments']) . "', " . "pc_room = '" . add_escape_custom($_POST['form_room']) . "', " . "pc_informant = '" . add_escape_custom($_SESSION['authUserID']) . "', " . "pc_eventDate = '" . add_escape_custom($event_date) . "', " . "pc_endDate = '" . add_escape_custom(fixDate($_POST['form_enddate'])) . "', " . "pc_duration = '" . add_escape_custom($duration * 60) . "', " . "pc_recurrtype = '" . add_escape_custom($my_recurrtype) . "', " . "pc_recurrspec = '" . add_escape_custom(serialize($recurrspec)) . "', " . "pc_startTime = '" . add_escape_custom($starttime) . "', " . "pc_endTime = '" . add_escape_custom($endtime) . "', " . "pc_alldayevent = '" . add_escape_custom($_POST['form_allday']) . "', " . "pc_apptstatus = '" . add_escape_custom($_POST['form_apptstatus']) . "', " . "pc_prefcatid = '" . add_escape_custom($_POST['form_prefcat']) . "' ," . "pc_facility = '" . add_escape_custom((int) $_POST['facility']) . "' ," . "pc_billing_location = '" . add_escape_custom((int) $_POST['billing_facility']) . "' " . "WHERE pc_eid = '" . add_escape_custom($eid) . "'");
             }
         }
     }
     // =======================================
     // end Update Multi providers case
     // =======================================
     // EVENTS TO FACILITIES
     $e2f = (int) $eid;
 } else {
     /* =======================================================
      *                    INSERT NEW EVENT(S)
      * ======================================================*/
     InsertEventFull();
 }
 // done with EVENT insert/update statements
Example #27
0
<?php 
        }
        // End not csv export
    }
    // end details
    $producttotal += $rowresult;
    $grandtotal += $rowresult;
    $productqty += $qty;
    $grandqty += $qty;
}
// end function
if (!acl_check('acct', 'rep')) {
    die(xl("Unauthorized access."));
}
$form_from_date = fixDate($_POST['form_from_date'], date('Y-m-d'));
$form_to_date = fixDate($_POST['form_to_date'], date('Y-m-d'));
$form_facility = $_POST['form_facility'];
if ($_POST['form_csvexport']) {
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/force-download");
    header("Content-Disposition: attachment; filename=ippf_cyp_report.csv");
    header("Content-Description: File Transfer");
    // CSV headers:
    if ($_POST['form_details']) {
        echo '"Item",';
        echo '"Date",';
        echo '"Invoice",';
        echo '"Qty",';
        echo '"CYP",';
Example #28
0
                 $thisadj = 0;
             }
         }
         if ($INTEGRATED_AR) {
             arPostAdjustment($patient_id, $encounter_id, $session_id, $thisadj, $code, $payer_type, $reason, $debug);
         } else {
             slPostAdjustment($trans_id, $thisadj, $thisdate, $thissrc, $code, $thisins, $reason, $debug);
         }
     }
 }
 // Maintain which insurances are marked as finished.
 if ($INTEGRATED_AR) {
     $form_done = 0 + $_POST['form_done'];
     sqlStatement("UPDATE form_encounter " . "SET last_level_closed = {$form_done} WHERE " . "pid = '{$patient_id}' AND encounter = '{$encounter_id}'");
 } else {
     $form_duedate = fixDate($_POST['form_duedate']);
     $form_notes = trim($_POST['form_notes']);
     // We use the "Ship Via" field of the invoice to hold these.
     $form_eobs = "";
     foreach (array('Ins1', 'Ins2', 'Ins3') as $value) {
         if ($_POST["form_done_{$value}"]) {
             if ($form_eobs) {
                 $form_eobs .= ",";
             } else {
                 $form_eobs = "Done: ";
             }
             $form_eobs .= $value;
         }
     }
     $query = "UPDATE ar SET duedate = '{$form_duedate}', notes = '{$form_notes}', " . "shipvia = '{$form_eobs}' WHERE id = {$trans_id}";
     if ($debug) {
Example #29
0
// Faking it here makes things easier.
// Also note that some fields like SSN and most of the subscriber employer
// items have been omitted because they are not relevant for claims.
//
$insurance_layout = array(array('field_id' => 'type', 'title' => 'Type', 'uor' => '2', 'data_type' => '1', 'list_id' => 'insurance_types', 'edit_options' => ''), array('field_id' => 'date', 'title' => 'Effective Date', 'uor' => '2', 'data_type' => '4', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'provider', 'title' => 'Provider', 'uor' => '2', 'data_type' => '16', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'plan_name', 'title' => 'Plan Name', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'policy_number', 'title' => 'Policy Number', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'group_number', 'title' => 'Group Number', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_employer', 'title' => 'Group Name', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_lname', 'title' => 'Subscriber Last Name', 'uor' => '2', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_fname', 'title' => 'Subscriber First Name', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_mname', 'title' => 'Subscriber Middle Name', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_DOB', 'title' => 'Subscriber DOB', 'uor' => '2', 'data_type' => '4', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_sex', 'title' => 'Subscriber Sex', 'uor' => '2', 'data_type' => '1', 'list_id' => 'sex', 'edit_options' => ''), array('field_id' => 'subscriber_relationship', 'title' => 'Subscriber Relationship', 'uor' => '2', 'data_type' => '1', 'list_id' => 'sub_relation', 'edit_options' => ''), array('field_id' => 'subscriber_street', 'title' => 'Subscriber Street', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_city', 'title' => 'Subscriber City', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_state', 'title' => 'Subscriber State', 'uor' => '1', 'data_type' => '1', 'list_id' => 'state', 'edit_options' => ''), array('field_id' => 'subscriber_postal_code', 'title' => 'Subscriber Zip', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''), array('field_id' => 'subscriber_phone', 'title' => 'Subscriber Phone', 'uor' => '1', 'data_type' => '2', 'list_id' => '', 'edit_options' => ''));
$postid = intval($_REQUEST['postid']);
if ($_POST['bn_save']) {
    $newdata = array();
    $ptid = intval($_POST['ptid']);
    foreach ($insurance_layout as $frow) {
        $data_type = $frow['data_type'];
        $field_id = $frow['field_id'];
        // newInsuranceData() does not escape for mysql so we have to do it here.
        $newdata[$field_id] = add_escape_custom(get_layout_form_value($frow));
    }
    newInsuranceData($ptid, $newdata['type'], $newdata['provider'], $newdata['policy_number'], $newdata['group_number'], $newdata['plan_name'], $newdata['subscriber_lname'], $newdata['subscriber_mname'], $newdata['subscriber_fname'], $newdata['subscriber_relationship'], '', fixDate($newdata['subscriber_DOB']), $newdata['subscriber_street'], $newdata['subscriber_postal_code'], $newdata['subscriber_city'], $newdata['subscriber_state'], '', $newdata['subscriber_phone'], $newdata['subscriber_employer'], '', '', '', '', '', '', $newdata['subscriber_sex'], fixDate($newdata['date']), 'TRUE', '');
    // Finally, delete the request from the portal.
    $result = cms_portal_call(array('action' => 'delpost', 'postid' => $postid));
    if ($result['errmsg']) {
        die(text($result['errmsg']));
    }
    echo "<html><body><script language='JavaScript'>\n";
    echo "if (top.restoreSession) top.restoreSession(); else opener.top.restoreSession();\n";
    echo "document.location.href = 'list_requests.php';\n";
    echo "</script></body></html>\n";
    exit;
}
// Get the portal request data.
if (!$postid) {
    die(xlt('Request ID is missing!'));
}
Example #30
0
function slPostAdjustment($trans_id, $thisadj, $thisdate, $thissrc, $code, $thisins, $reason, $debug)
{
    global $chart_id_income, $chart_id_ar;
    if ($GLOBALS['oer_config']['ws_accounting']['enabled'] === 2) {
        die("Internal error calling slPostAdjustment()");
    }
    // Post an adjustment: add negative invoice item, add to ar, subtract from income
    $adjdate = fixDate($thisdate);
    $description = "Adjustment {$adjdate} {$reason}";
    slAddLineItem($trans_id, $code, 0 - $thisadj, 1, $thisins, $description, $debug);
    if ($thisadj) {
        slAddTransaction($trans_id, $chart_id_ar, $thisadj, $thisdate, "InvAdj {$thissrc}", $code, $thisins, $debug);
        slAddTransaction($trans_id, $chart_id_income, 0 - $thisadj, $thisdate, "InvAdj {$thissrc}", $code, $thisins, $debug);
        slUpdateAR($trans_id, 0 - $thisadj, 0, '', $debug);
    }
}