FreeMED. Ledger

Summary
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by patient.
Determine if the selected patient is in collections status (>180 days unpaid).
Get a list of ledger items from the system
Moves a procedure to the next available coverage.
Determine if there is another coverage that this should be moved to, based on the current coverage, and whether it should be moved to the patient or is not able to be billed any further
Set a procedure to be rebilled at the next billing, moving it to be associated to the proper coverage.
Post an adjustment for the specified procedure.
Post a copay for the specified procedure.
Post a deductable for the specified procedure.
Post a fee adjustment for the specified procedure.
Posts payment record based on passed data.
Posts a cash payment.
Posts a check payment.
Posts a credit card payment.
Post a write-off of a particular type to the system for the specified procedure.
Adds an “unpostable” sum to the global claim log.
Write off an array of items
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.

This function is primarily used by the accounts receivable module, but could conceivably be used by other financial parts of FreeMED.

Parameters

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

Returns

Array of associative arrays containing aging information.

collection_warning

function collection_warning ($pid)

Determine if the selected patient is in collections status (>180 days unpaid).

Parameters

$pidPatient record id

Returns

Amount in collections, or a testing false value (0)?

get_list

function get_list ( )

Get a list of ledger items from the system

Returns

Array of associative arrays, containing ledger records.

move_to_next_coverage

function move_to_next_coverage ($proc,  
$disallow =  NULL)

Moves a procedure to the next available coverage.

Parameters

$procProcedure id key
$disallow(optional) Disallowment amount that cannot be passed to the patient if coverages run out.

Returns

Boolean, successful

See Also

next_coverage

next_coverage

function next_coverage ($proc)

Determine if there is another coverage that this should be moved to, based on the current coverage, and whether it should be moved to the patient or is not able to be billed any further

Parameters

$procProcedure id key

Returns

Coverage type for next round of coverage, 0 if the rest of the bill has to be handled by the patient, or -1 if the rest of the bill is unbillable.

queue_for_rebill

function queue_for_rebill ($proc,  
$type,  
$disallow =  NULL)

Set a procedure to be rebilled at the next billing, moving it to be associated to the proper coverage.

Parameters

$procProcedure id key
$typeCoverage number (0 - 4)
$disallow(optional) Disallowment amount that cannot be passed to the patient.

Returns

Boolean, successful

post_adjustment

function post_adjustment ($procedure,  
$amount,  
$comment =  '')

Post an adjustment for the specified procedure.

Parameters

$procedureProcedure id key
$amountAmount of the copay as a positive number
$comment(optional) Text comment for the record.  Defaults to a null string.

Returns

Boolean, if successful

post_copay

function post_copay ($procedure,  
$amount,  
$comment =  '')

Post a copay for the specified procedure.

Parameters

$procedureProcedure id key
$amountAmount of the copay as a positive number
$comment(optional) Text comment for the record.  Defaults to a null string.

Returns

Boolean, if successful

post_deductable

function post_deductable ($procedure,  
$amount,  
$comment =  '')

Post a deductable for the specified procedure.

Parameters

$procedureProcedure id key
$amountAmount of the deductable, as a positive number
$comment(optional) Text comment for the record.  Defaults to a null string.

Returns

Boolean, if successful

post_fee_adjustment

function post_fee_adjustment ($procedure,  
$coverage,  
$amount,  
$comment =  '')

Post a fee adjustment for the specified procedure.

Parameters

$procedureProcedure id key
$coverageCoverage id key
$amountAmount of the fee adjustment
$comment(optional) Text comment for the record.  Defaults to a null string.

Returns

Boolean, if successful

post_payment

function post_payment ($data)

Posts payment record based on passed data.

Parameters

$dataAssociative array containing information passed to the ledger.

Returns

Boolean, if successful.

See Also

post_payment_cash post_payment_check

post_payment_cash

function post_payment_cash ($procedure,
$coverage,
$amount,
$comment)

Posts a cash payment.  This is a wrapper for post_payment.

Parameters

$procedureProcedure id number
$coverageCoverage that check is related to
$amountNumeric amount of the check
$commentText comment to be attached to the ledger

Returns

Boolean, successful

See Also

post_payment

post_payment_check

function post_payment_check ($procedure,
$coverage,
$check_number,
$amount,
$comment)

Posts a check payment.  This is a wrapper for post_payment.

Parameters

$procedureProcedure id number
$coverageCoverage that check is related to
$check_numberNumber appearing on the check
$amountNumeric amount of the check
$commentText comment to be attached to the ledger

Returns

Boolean, successful

See Also

post_payment

post_payment_credit_card

function post_payment_credit_card ($procedure,
$coverage,
$cc_number,
$exp_m,
$exp_y,
$amount,
$comment)

Posts a credit card payment.  This is a wrapper for post_payment.

Parameters

$procedureProcedure id number
$coverageCoverage that check is related to
$cc_numberCredit card number
$exp_mMonth expiration
$exp_yYear expiration
$amountNumeric amount of the check
$commentText comment to be attached to the ledger

Returns

Boolean, successful

See Also

post_payment

post_writeoff

function post_writeoff ($procedure,  
$comment =  '' ,
$category =  WRITEOFF)

Post a write-off of a particular type to the system for the specified procedure.

Parameters

$procedureProcedure id key
$comment(optional) Text comment for the record.  Defaults to a null string.
$category(optional) Category of writeoff.  Defaults to WRITEOFF.  Possible values are:
  • DENIAL
  • WRITEOFF

Returns

Boolean, if successful

unpostable

function unpostable ($amount,
$comment)

Adds an “unpostable” sum to the global claim log.  Currently updates the “global” event log (where procedure = 0).

Parameters

$amountUnpostable amount
$commentText comment (with check number, etc)

Returns

Boolean, successful

writeoff_array

function writeoff_array ($a)

Write off an array of items

Parameters

$aArray of items

Returns

Boolean, 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 aging_report_qualified ($criteria)
Provide an “aging summary” (with number of claims and amount due) for a range of agings, grouped by patient.
function collection_warning ($pid)
Determine if the selected patient is in collections status (>180 days unpaid).
function get_list ( )
Get a list of ledger items from the system
function move_to_next_coverage ($proc,  
$disallow =  NULL)
Moves a procedure to the next available coverage.
function next_coverage ($proc)
Determine if there is another coverage that this should be moved to, based on the current coverage, and whether it should be moved to the patient or is not able to be billed any further
function queue_for_rebill ($proc,  
$type,  
$disallow =  NULL)
Set a procedure to be rebilled at the next billing, moving it to be associated to the proper coverage.
function post_adjustment ($procedure,  
$amount,  
$comment =  '')
Post an adjustment for the specified procedure.
function post_copay ($procedure,  
$amount,  
$comment =  '')
Post a copay for the specified procedure.
function post_deductable ($procedure,  
$amount,  
$comment =  '')
Post a deductable for the specified procedure.
function post_fee_adjustment ($procedure,  
$coverage,  
$amount,  
$comment =  '')
Post a fee adjustment for the specified procedure.
function post_payment ($data)
Posts payment record based on passed data.
function post_payment_cash ($procedure,
$coverage,
$amount,
$comment)
Posts a cash payment.
function post_payment_check ($procedure,
$coverage,
$check_number,
$amount,
$comment)
Posts a check payment.
function post_payment_credit_card ($procedure,
$coverage,
$cc_number,
$exp_m,
$exp_y,
$amount,
$comment)
Posts a credit card payment.
function post_writeoff ($procedure,  
$comment =  '' ,
$category =  WRITEOFF)
Post a write-off of a particular type to the system for the specified procedure.
function unpostable ($amount,
$comment)
Adds an “unpostable” sum to the global claim log.
function writeoff_array ($a)
Write off an array of items
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.