lib/ class. ClaimLog.php

Summary
It is a helper function which sorts by an embedded array.
Allows access to functions involving the internal FreeMED claim log, which is used by the system to track billing, rebilling, bill keys, et cetera.
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by patient.
Provide aging summary grouped by payer, for the common age ranges (0-30, 31-60, 61-90, 91-120, 120+)
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by payer.
Get a picklist of all insurance companies which have outstanding balances in the system.
Get a picklist of all insurance plans which have outstanding balances in the system.
Get associative array of information related to a particular claim item (procedure).
Get an associative array with information containing events related to a particular procedure.
Recursively log all procedures from a particular billkey as being billed NOW.
Add an event to the claim log
Mark all procedures in a billkey as being billed.
Mark all procedures in an array as being billed.
Get list of all procedure statuses in the system that are currently being used.
Add a rebill to the claim log.
Look up a patient by a procedure id
Internal helper function to convert SQL queries into arrays of associative arrays.

Functions

___sort_aging

function ___sort_aging ($a,
$b)

It is a helper function which sorts by an embedded array.  It should only be used in <ClaimLog::aging_summary_full>, and should not have ever been written; it makes up for a language shortcoming.  It is called by uasort().

Parameters

$aParameter 1
$bParameter 2

Returns

Sorted array

FreeMED. ClaimLog

Allows access to functions involving the internal FreeMED claim log, which is used by the system to track billing, rebilling, bill keys, et cetera.

Summary
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by patient.
Provide aging summary grouped by payer, for the common age ranges (0-30, 31-60, 61-90, 91-120, 120+)
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by payer.
Get a picklist of all insurance companies which have outstanding balances in the system.
Get a picklist of all insurance plans which have outstanding balances in the system.
Get associative array of information related to a particular claim item (procedure).
Get an associative array with information containing events related to a particular procedure.
Recursively log all procedures from a particular billkey as being billed NOW.
Add an event to the claim log
Mark all procedures in a billkey as being billed.
Mark all procedures in an array as being billed.
Get list of all procedure statuses in the system that are currently being used.
Add a rebill to the claim log.
Look up a patient by a procedure id
Internal helper function to convert SQL queries into arrays of associative arrays.

Functions

aging_report_qualified

function aging_report_qualified ($criteria)

Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by patient.  Can be restricted by payer.

Parameters

$criteriaAssociative array of criteria types as keys and parameters as values.

Returns

Array of associative arrays containing aging information.

aging_summary_payer_full

function aging_summary_payer_full ($provider =  0)

Provide aging summary grouped by payer, for the common age ranges (0-30, 31-60, 61-90, 91-120, 120+)

Parameters

$provider(optional) Provider id key if the search is to be restricted by provider.  Defaults to disable.

Return

Multidimensional array containing aging information.

See Also

aging_summary_payer_range

aging_summary_payer_range

function aging_summary_payer_range ($lower,  
$upper =  false,
$provider =  0)

Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by payer.  Can be restricted by provider.

Parameters

$lowerLower aging range in days.
$upper(optional) Upper aging range in days.  Defaults to false.
$provider(optional) Provider to restrict search by.  Defaults to disabled.

Returns

Array of associative arrays containing aging information.

See Also

aging_summary_payer_full

aging_insurance_companies

function aging_insurance_companies ($provider =  NULL)

Get a picklist of all insurance companies which have outstanding balances in the system.  Can be limited by provider, if optional parameter is given.

Parameters

$provider(optional) Provider/physician id key to limit the search.  Defaults to disabled.

Returns

Associative array of payers.

aging_insurance_plans

function aging_insurance_plans ($payer =  NULL)

Get a picklist of all insurance plans which have outstanding balances in the system.  Can be narrowed to only search by one payer.

Parameters

$payer(optional) Insurance company id key to limit the search.  Defaults to disabled.

Returns

Associative array of plan names.

claim_information

function claim_information ($proc,  
$payrec =  NULL)

Get associative array of information related to a particular claim item (procedure).

Parameters

$procProcedure id key
$payrec(optional) Payment record id key.  Gives information regarding only that payment record.

Returns

Associative array of information about the specified procedure

events_for_procedure

function events_for_procedure ($proc,  
$payrec =  NULL)

Get an associative array with information containing events related to a particular procedure.

Parameters

$procProcedure id key
$payrec(optional) Payment record id key.  Gives only information regarding that particular payment record.

Returns

Array of associative arrays containing billing event data from the claimlog table.

log_billing

function log_billing ($billkey,  
$format,  
$target,  
$comment =  '')

Recursively log all procedures from a particular billkey as being billed NOW.

Parameters

$billkeyBillkey id key
$formatText name of the format used to send
$targetText name of the target used to send
$comment(optional) Optional text comment to be attached to the claim record.

Returns

Boolean, if successful.

log_event

function log_event ($procedure,
$param)

Add an event to the claim log

Parameters

$procedureProcedure id key
$paramAdditional parameters in an associative array.
  • item - Payment record id (optional)
  • billkey - Billkey id for billing runs
  • action - Textual action description
  • format - Billing engine related
  • target - Billing engine related
  • comment - What else?

Returns

Record id key of new claim log record, or false if failed.

mark_billed

function mark_billed ($billkeys)

Mark all procedures in a billkey as being billed.  The billing interface should use this function.

Parameters

$billkeyBillkey id

Returns

Boolean, if successful.

mark_billed_array

function mark_billed_array ($procs)

Mark all procedures in an array as being billed.  The billing interface should use this function.

Parameters

$procsArray of procedures

Returns

Boolean, if successful.

procedure_status_list

function procedure_status_list ( )

Get list of all procedure statuses in the system that are currently being used.

Returns

Array of distinct procedure statuses.

set_rebill

function set_rebill ($procedure,  
$comment,  
$date =  '')

Add a rebill to the claim log.

Parameters

$procedureProcedure key
$commentText comment
$date(optional) SQL date format describing the date of the rebill.  If not passed, the default is today.

Returns

Boolean, if successful.

_procedure_to_patient

function _procedure_to_patient ($procedure)

Look up a patient by a procedure id

Parameters

$procedureProcedure id

Returns

Patient id

_query_to_result_array

function _query_to_result_array ($query,  
$sequential =  false)

Internal helper function to convert SQL queries into arrays of associative arrays.

Parameters

$querySQL query text
$sequential(optional) Number sequentially instead of indexing by identifier.  Defaults to false.

Returns

Array of associative arrays.

function ___sort_aging ($a,
$b)
It is a helper function which sorts by an embedded array.
function aging_report_qualified ($criteria)
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by patient.
function aging_summary_payer_full ($provider =  0)
Provide aging summary grouped by payer, for the common age ranges (0-30, 31-60, 61-90, 91-120, 120+)
function aging_summary_payer_range ($lower,  
$upper =  false,
$provider =  0)
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by payer.
function aging_insurance_companies ($provider =  NULL)
Get a picklist of all insurance companies which have outstanding balances in the system.
function aging_insurance_plans ($payer =  NULL)
Get a picklist of all insurance plans which have outstanding balances in the system.
function claim_information ($proc,  
$payrec =  NULL)
Get associative array of information related to a particular claim item (procedure).
function events_for_procedure ($proc,  
$payrec =  NULL)
Get an associative array with information containing events related to a particular procedure.
function log_billing ($billkey,  
$format,  
$target,  
$comment =  '')
Recursively log all procedures from a particular billkey as being billed NOW.
function log_event ($procedure,
$param)
Add an event to the claim log
function mark_billed ($billkeys)
Mark all procedures in a billkey as being billed.
function mark_billed_array ($procs)
Mark all procedures in an array as being billed.
function procedure_status_list ( )
Get list of all procedure statuses in the system that are currently being used.
function set_rebill ($procedure,  
$comment,  
$date =  '')
Add a rebill to the claim log.
function _procedure_to_patient ($procedure)
Look up a patient by a procedure id
function _query_to_result_array ($query,  
$sequential =  false)
Internal helper function to convert SQL queries into arrays of associative arrays.