当前位置: 首页>>代码示例>>PHP>>正文


PHP arGetPayerID函数代码示例

本文整理汇总了PHP中arGetPayerID函数的典型用法代码示例。如果您正苦于以下问题:PHP arGetPayerID函数的具体用法?PHP arGetPayerID怎么用?PHP arGetPayerID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了arGetPayerID函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: while

 if ($INTEGRATED_AR) {
     while ($row = sqlFetchArray($t_res)) {
         $balance = sprintf("%.2f", $row['charges'] + $row['copays'] - $row['payments'] - $row['adjustments']);
         if ($_POST['form_category'] != 'All' && $eracount == 0 && $balance == 0) {
             continue;
         }
         // $duncount was originally supposed to be the number of times that
         // the patient was sent a statement for this invoice.
         //
         $duncount = $row['stmt_count'];
         // But if we have not yet billed the patient, then compute $duncount as a
         // negative count of the number of insurance plans for which we have not
         // yet closed out insurance.
         //
         if (!$duncount) {
             for ($i = 1; $i <= 3 && arGetPayerID($row['pid'], $row['date'], $i); ++$i) {
             }
             $duncount = $row['last_level_closed'] + 1 - $i;
         }
         $isdueany = $balance > 0;
         // An invoice is now due from the patient if money is owed and we are
         // not waiting for insurance to pay.
         //
         $isduept = $duncount >= 0 && $isdueany ? " checked" : "";
         // Skip invoices not in the desired "Due..." category.
         //
         if (substr($_POST['form_category'], 0, 3) == 'Due' && !$isdueany) {
             continue;
         }
         if ($_POST['form_category'] == 'Due Ins' && ($duncount >= 0 || !$isdueany)) {
             continue;
开发者ID:katopenzz,项目名称:openemr,代码行数:31,代码来源:sl_eob_search.php

示例2: ar_responsible_party

function ar_responsible_party($patient_id, $encounter_id)
{
    $row = sqlQuery("SELECT date, last_level_billed, last_level_closed " . "FROM form_encounter WHERE " . "pid = '{$patient_id}' AND encounter = '{$encounter_id}' " . "ORDER BY id DESC LIMIT 1");
    if (empty($row)) {
        return -1;
    }
    $next_level = $row['last_level_closed'] + 1;
    if ($next_level <= $row['last_level_billed']) {
        return $next_level;
    }
    if (arGetPayerID($patient_id, substr($row['date'], 0, 10), $payer_type)) {
        return $next_level;
    }
    // There is no unclosed insurance, so see if there is an unpaid balance.
    // Currently hoping that form_encounter.balance_due can be discarded.
    $balance = 0;
    $codes = ar_get_invoice_summary($patient_id, $encounter_id);
    foreach ($codes as $cdata) {
        $balance += $cdata['bal'];
    }
    if ($balance > 0) {
        return 0;
    }
    return -1;
}
开发者ID:robonology,项目名称:openemr,代码行数:25,代码来源:invoice_summary.inc.php

示例3: arSetupSecondary

function arSetupSecondary($patient_id, $encounter_id, $debug)
{
    // Determine the next insurance level to be billed.
    $ferow = sqlQuery("SELECT date, last_level_billed " . "FROM form_encounter WHERE " . "pid = '{$patient_id}' AND encounter = '{$encounter_id}'");
    $date_of_service = substr($ferow['date'], 0, 10);
    $new_payer_type = 0 + $ferow['last_level_billed'];
    if ($new_payer_type < 3 && !empty($ferow['last_level_billed']) || $new_payer_type == 0) {
        ++$new_payer_type;
    }
    $new_payer_id = arGetPayerID($patient_id, $date_of_service, $new_payer_type);
    if ($new_payer_id) {
        // Queue up the claim.
        if (!$debug) {
            updateClaim(true, $patient_id, $encounter_id, $new_payer_id, $new_payer_type, 1, 5, '', 'hcfa');
        }
    } else {
        // Just reopen the claim.
        if (!$debug) {
            updateClaim(true, $patient_id, $encounter_id, -1, -1, 1, 0, '');
        }
    }
    return xl("Encounter ") . $encounter . xl(" is ready for re-billing.");
}
开发者ID:hompothgyorgy,项目名称:openemr,代码行数:23,代码来源:sl_eob.inc.php

示例4: era_callback


//.........这里部分代码省略.........
        if ($csc == '4') {
            //Denial case, code is stored in the claims table for display in the billing manager screen with reason explained.
            $inverror = true;
            if (!$debug) {
                if ($pid && $encounter) {
                    $code_value = '';
                    foreach ($out['svc'] as $svc) {
                        foreach ($svc['adj'] as $adj) {
                            //Per code and modifier the reason will be showed in the billing manager.
                            $code_value .= $svc['code'] . '_' . $svc['mod'] . '_' . $adj['group_code'] . '_' . $adj['reason_code'] . ',';
                        }
                    }
                    $code_value = substr($code_value, 0, -1);
                    //We store the reason code to display it with description in the billing manager screen.
                    //process_file is used as for the denial case file name will not be there, and extra field(to store reason) can be avoided.
                    updateClaim(true, $pid, $encounter, $_REQUEST['InsId'], substr($inslabel, 3), 7, 0, $code_value);
                }
            }
            writeMessageLine($bgcolor, 'errdetail', "Not posting adjustments for denied claims, please follow up manually!");
        } else {
            if ($csc == '22') {
                $inverror = true;
                writeMessageLine($bgcolor, 'errdetail', "Payment reversals are not automated, please enter manually!");
            }
        }
        if ($out['warnings']) {
            writeMessageLine($bgcolor, 'infdetail', nl2br(rtrim($out['warnings'])));
        }
        // Simplify some claim attributes for cleaner code.
        $service_date = parse_date($out['dos']);
        $check_date = $paydate ? $paydate : parse_date($out['check_date']);
        $production_date = $paydate ? $paydate : parse_date($out['production_date']);
        if ($INTEGRATED_AR) {
            $insurance_id = arGetPayerID($pid, $service_date, substr($inslabel, 3));
            if (empty($ferow['lname'])) {
                $patient_name = $out['patient_fname'] . ' ' . $out['patient_lname'];
            } else {
                $patient_name = $ferow['fname'] . ' ' . $ferow['lname'];
            }
        } else {
            $insurance_id = 0;
            foreach ($codes as $cdata) {
                if ($cdata['ins']) {
                    $insurance_id = $cdata['ins'];
                    break;
                }
            }
            $patient_name = $arrow['name'] ? $arrow['name'] : $out['patient_fname'] . ' ' . $out['patient_lname'];
        }
        $error = $inverror;
        // This loops once for each service item in this claim.
        foreach ($out['svc'] as $svc) {
            // Treat a modifier in the remit data as part of the procedure key.
            // This key will then make its way into SQL-Ledger.
            $codekey = $svc['code'];
            if ($svc['mod']) {
                $codekey .= ':' . $svc['mod'];
            }
            $prev = $codes[$codekey];
            $codetype = '';
            //will hold code type, if exists
            // This reports detail lines already on file for this service item.
            if ($prev) {
                $codetype = $codes[$codekey]['code_type'];
                //store code type
                writeOldDetail($prev, $patient_name, $invnumber, $service_date, $codekey, $bgcolor);
开发者ID:rreddy70,项目名称:openemr,代码行数:67,代码来源:sl_eob_process.php

示例5: xl

<?php 
echo $svcdate;
?>
  </td>
  <td colspan="2">
   <?php 
xl('Done with:', 'e', '', "&nbsp");
?>
;
<?php 
// Write a checkbox for each insurance.  It is to be checked when
// we no longer expect any payments from that company for the claim.
if ($INTEGRATED_AR) {
    $last_level_closed = 0 + $ferow['last_level_closed'];
    foreach (array(0 => 'None', 1 => 'Ins1', 2 => 'Ins2', 3 => 'Ins3') as $key => $value) {
        if ($key && !arGetPayerID($patient_id, $svcdate, $key)) {
            continue;
        }
        $checked = $last_level_closed == $key ? " checked" : "";
        echo "   <input type='radio' name='form_done' value='{$key}'{$checked} />{$value}&nbsp;\n";
    }
} else {
    // The information is stored in the 'shipvia' field of the invoice.
    $insgot = strtolower($arrow['notes']);
    $insdone = strtolower($arrow['shipvia']);
    foreach (array('Ins1', 'Ins2', 'Ins3') as $value) {
        $lcvalue = strtolower($value);
        $checked = strpos($insdone, $lcvalue) === false ? "" : " checked";
        if (strpos($insgot, $lcvalue) !== false) {
            echo "   <input type='checkbox' name='form_done_{$value}' value='1'{$checked} />{$value}&nbsp;\n";
        }
开发者ID:robonology,项目名称:openemr,代码行数:31,代码来源:sl_eob_invoice.php

示例6: DistributionInsert

function DistributionInsert($CountRow, $created_time, $user_id)
{
    //Function inserts the distribution.Payment,Adjustment,Deductable,Takeback & Follow up reasons are inserted as seperate rows.
    //It automatically pushes to next insurance for billing.
    //In the screen a drop down of Ins1,Ins2,Ins3,Pat are given.The posting can be done for any level.
    $Affected = 'no';
    if (isset($_POST["Payment{$CountRow}"]) && $_POST["Payment{$CountRow}"] * 1 > 0) {
        if (trim(formData('type_name')) == 'insurance') {
            if (trim(formData("HiddenIns{$CountRow}")) == 1) {
                $AccountCode = "IPP";
            }
            if (trim(formData("HiddenIns{$CountRow}")) == 2) {
                $AccountCode = "ISP";
            }
            if (trim(formData("HiddenIns{$CountRow}")) == 3) {
                $AccountCode = "ITP";
            }
        } elseif (trim(formData('type_name')) == 'patient') {
            $AccountCode = "PP";
        }
        sqlStatement("insert into ar_activity set " . "pid = '" . trim(formData('hidden_patient_code')) . "', encounter = '" . trim(formData("HiddenEncounter{$CountRow}")) . "', code = '" . trim(formData("HiddenCode{$CountRow}")) . "', modifier = '" . trim(formData("HiddenModifier{$CountRow}")) . "', payer_type = '" . trim(formData("HiddenIns{$CountRow}")) . "', post_time = '" . trim($created_time) . "', post_user = '" . trim($user_id) . "', session_id = '" . trim(formData('payment_id')) . "', modified_time = '" . trim($created_time) . "', pay_amount = '" . trim(formData("Payment{$CountRow}")) . "', adj_amount = '" . 0 . "', account_code = '" . "{$AccountCode}" . "'");
        $Affected = 'yes';
    }
    if (isset($_POST["AdjAmount{$CountRow}"]) && $_POST["AdjAmount{$CountRow}"] * 1 != 0) {
        if (trim(formData('type_name')) == 'insurance') {
            $AdjustString = "Ins adjust Ins" . trim(formData("HiddenIns{$CountRow}"));
            $AccountCode = "IA";
        } elseif (trim(formData('type_name')) == 'patient') {
            $AdjustString = "Pt adjust";
            $AccountCode = "PA";
        }
        idSqlStatement("insert into ar_activity set " . "pid = '" . trim(formData('hidden_patient_code')) . "', encounter = '" . trim(formData("HiddenEncounter{$CountRow}")) . "', code = '" . trim(formData("HiddenCode{$CountRow}")) . "', modifier = '" . trim(formData("HiddenModifier{$CountRow}")) . "', payer_type = '" . trim(formData("HiddenIns{$CountRow}")) . "', post_time = '" . trim($created_time) . "', post_user = '" . trim($user_id) . "', session_id = '" . trim(formData('payment_id')) . "', modified_time = '" . trim($created_time) . "', pay_amount = '" . 0 . "', adj_amount = '" . trim(formData("AdjAmount{$CountRow}")) . "', memo = '" . "{$AdjustString}" . "', account_code = '" . "{$AccountCode}" . "'");
        $Affected = 'yes';
    }
    if (isset($_POST["Deductible{$CountRow}"]) && $_POST["Deductible{$CountRow}"] * 1 > 0) {
        idSqlStatement("insert into ar_activity set " . "pid = '" . trim(formData('hidden_patient_code')) . "', encounter = '" . trim(formData("HiddenEncounter{$CountRow}")) . "', code = '" . trim(formData("HiddenCode{$CountRow}")) . "', modifier = '" . trim(formData("HiddenModifier{$CountRow}")) . "', payer_type = '" . trim(formData("HiddenIns{$CountRow}")) . "', post_time = '" . trim($created_time) . "', post_user = '" . trim($user_id) . "', session_id = '" . trim(formData('payment_id')) . "', modified_time = '" . trim($created_time) . "', pay_amount = '" . 0 . "', adj_amount = '" . 0 . "', memo = '" . "Deductable \$" . trim(formData("Deductible{$CountRow}")) . "', account_code = '" . "Deduct" . "'");
        $Affected = 'yes';
    }
    if (isset($_POST["Takeback{$CountRow}"]) && $_POST["Takeback{$CountRow}"] * 1 > 0) {
        idSqlStatement("insert into ar_activity set " . "pid = '" . trim(formData('hidden_patient_code')) . "', encounter = '" . trim(formData("HiddenEncounter{$CountRow}")) . "', code = '" . trim(formData("HiddenCode{$CountRow}")) . "', modifier = '" . trim(formData("HiddenModifier{$CountRow}")) . "', payer_type = '" . trim(formData("HiddenIns{$CountRow}")) . "', post_time = '" . trim($created_time) . "', post_user = '" . trim($user_id) . "', session_id = '" . trim(formData('payment_id')) . "', modified_time = '" . trim($created_time) . "', pay_amount = '" . trim(formData("Takeback{$CountRow}")) * -1 . "', adj_amount = '" . 0 . "', account_code = '" . "Takeback" . "'");
        $Affected = 'yes';
    }
    if (isset($_POST["FollowUp{$CountRow}"]) && $_POST["FollowUp{$CountRow}"] == 'y') {
        idSqlStatement("insert into ar_activity set " . "pid = '" . trim(formData('hidden_patient_code')) . "', encounter = '" . trim(formData("HiddenEncounter{$CountRow}")) . "', code = '" . trim(formData("HiddenCode{$CountRow}")) . "', modifier = '" . trim(formData("HiddenModifier{$CountRow}")) . "', payer_type = '" . trim(formData("HiddenIns{$CountRow}")) . "', post_time = '" . trim($created_time) . "', post_user = '" . trim($user_id) . "', session_id = '" . trim(formData('payment_id')) . "', modified_time = '" . trim($created_time) . "', pay_amount = '" . 0 . "', adj_amount = '" . 0 . "', follow_up = '" . "y" . "', follow_up_note = '" . trim(formData("FollowUpReason{$CountRow}")) . "'");
        $Affected = 'yes';
    }
    if ($Affected == 'yes') {
        if (trim(formData('type_name')) != 'patient') {
            $ferow = sqlQuery("select last_level_closed from form_encounter  where \n\t\tpid ='" . trim(formData('hidden_patient_code')) . "' and encounter='" . trim(formData("HiddenEncounter{$CountRow}")) . "'");
            //multiple charges can come.
            if ($ferow['last_level_closed'] < trim(formData("HiddenIns{$CountRow}"))) {
                sqlStatement("update form_encounter set last_level_closed='" . trim(formData("HiddenIns{$CountRow}")) . "' where \n\t\t\tpid ='" . trim(formData('hidden_patient_code')) . "' and encounter='" . trim(formData("HiddenEncounter{$CountRow}")) . "'");
                //last_level_closed gets increased.
                //-----------------------------------
                // Determine the next insurance level to be billed.
                $ferow = sqlQuery("SELECT date, last_level_closed " . "FROM form_encounter WHERE " . "pid = '" . trim(formData('hidden_patient_code')) . "' AND encounter = '" . trim(formData("HiddenEncounter{$CountRow}")) . "'");
                $date_of_service = substr($ferow['date'], 0, 10);
                $new_payer_type = 0 + $ferow['last_level_closed'];
                if ($new_payer_type <= 3 && !empty($ferow['last_level_closed']) || $new_payer_type == 0) {
                    ++$new_payer_type;
                }
                $new_payer_id = arGetPayerID(trim(formData('hidden_patient_code')), $date_of_service, $new_payer_type);
                if ($new_payer_id > 0) {
                    arSetupSecondary(trim(formData('hidden_patient_code')), trim(formData("HiddenEncounter{$CountRow}")), 0);
                }
                //-----------------------------------
            }
        }
    }
}
开发者ID:stephen-smith,项目名称:openemr,代码行数:70,代码来源:payment.inc.php

示例7: sqlQuery

    ?>
</td>
			  </tr>
			  <?php 
    do {
        $CountIndex++;
        $CountIndexBelow++;
        $Ins = 0;
        // Determine the next insurance level to be billed.
        $ferow = sqlQuery("SELECT date, last_level_closed " . "FROM form_encounter WHERE " . "pid = '{$hidden_patient_code}' AND encounter = '" . $RowSearch['encounter'] . "'");
        $date_of_service = substr($ferow['date'], 0, 10);
        $new_payer_type = 0 + $ferow['last_level_closed'];
        if ($new_payer_type <= 3 && !empty($ferow['last_level_closed']) || $new_payer_type == 0) {
            ++$new_payer_type;
        }
        $new_payer_id = arGetPayerID($hidden_patient_code, $date_of_service, $new_payer_type);
        if ($new_payer_id == 0) {
            $Ins = 0;
        } elseif ($new_payer_id > 0) {
            $Ins = $new_payer_type;
        }
        $ServiceDateArray = explode(' ', $RowSearch['date']);
        $ServiceDate = oeFormatShortDate($ServiceDateArray[0]);
        $Codetype = $RowSearch['code_type'];
        $Code = $RowSearch['code'];
        $Modifier = $RowSearch['modifier'];
        if ($Modifier != '') {
            $ModifierString = ", {$Modifier}";
        } else {
            $ModifierString = "";
        }
开发者ID:juggernautsei,项目名称:openemr,代码行数:31,代码来源:payment_pat_sel.inc.php

示例8: arGetPayerID

 $row['phone'] = $erow['phone_home'];
 $row['duncount'] = $duncount;
 $row['dos'] = $svcdate;
 $row['ss'] = $erow['ss'];
 $row['DOB'] = $erow['DOB'];
 $row['pubpid'] = $erow['pubpid'];
 $row['billnote'] = $erow['genericname2'] == 'Billing' ? $erow['genericval2'] : '';
 $row['referrer'] = $erow['referrer'];
 $row['irnumber'] = $erow['invoice_refno'];
 // Also get the primary insurance company name whenever there is one.
 $row['ins1'] = '';
 if ($insposition == 1) {
     $row['ins1'] = $insname;
 } else {
     if (empty($payerids)) {
         $tmp = arGetPayerID($patient_id, $svcdate, 1);
         if (!empty($tmp)) {
             $payerids[] = $tmp;
         }
     }
     if (!empty($payerids)) {
         $row['ins1'] = getInsName($payerids[0]);
     }
 }
 // This computes the invoice's total original charges and adjustments,
 // date of last activity, and determines if insurance has responded to
 // all billing items.
 $invlines = ar_get_invoice_summary($patient_id, $encounter_id, true);
 // if ($encounter_id == 185) { // debugging
 //   echo "\n<!--\n";
 //   print_r($invlines);
开发者ID:robonology,项目名称:openemr,代码行数:31,代码来源:collections_report.php

示例9: arSetupSecondary

  function arSetupSecondary($patient_id, $encounter_id, $debug,$crossover=0) {
    if ($crossover==1) {
    //if claim forwarded setting a new status 
    $status=6;
    
    } else {
    
    $status=1;
    
    }
    // Determine the next insurance level to be billed.
    $ferow = sqlQuery("SELECT date, last_level_billed " .
      "FROM form_encounter WHERE " .
      "pid = '$patient_id' AND encounter = '$encounter_id'");
    $date_of_service = substr($ferow['date'], 0, 10);
    $new_payer_type = 0 + $ferow['last_level_billed'];
    if ($new_payer_type < 3 && !empty($ferow['last_level_billed']) || $new_payer_type == 0)
      ++$new_payer_type;

    $new_payer_id = arGetPayerID($patient_id, $date_of_service, $new_payer_type);

    if ($new_payer_id) {
      // Queue up the claim.
      if (!$debug)
        updateClaim(true, $patient_id, $encounter_id, $new_payer_id, $new_payer_type,$status, 5, '', 'hcfa','',$crossover);
    }
    else {
      // Just reopen the claim.
      if (!$debug)
        updateClaim(true, $patient_id, $encounter_id, -1, -1, $status, 0, '','','',$crossover);
    }

    return xl("Encounter ") . $encounter . xl(" is ready for re-billing.");
  }
开发者ID:robertdown,项目名称:openemr,代码行数:34,代码来源:sl_eob.inc.php


注:本文中的arGetPayerID函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。