Skip to content

Commit

Permalink
added function for testing if an encounter is billed
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Mar 14, 2009
1 parent a9ad6e0 commit 4d0e12f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion library/billing.inc
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,19 @@ function updateClaim($newversion, $patient_id, $encounter_id, $payer_id=-1, $pay

return 1;
}
?>

// Determine if anything in a visit has been billed.
//
function isEncounterBilled($pid, $encounter) {
$row = sqlQuery("SELECT count(*) AS count FROM billing WHERE " .
"pid = '$pid' AND encounter = '$encounter' AND activity = 1 AND " .
"billed = 1");
$count = $row['count'];
if (!$count) {
$row = sqlQuery("SELECT count(*) AS count FROM drug_sales WHERE " .
"pid = '$pid' AND encounter = '$encounter' AND billed = 1");
$count = $row['count'];
}
return $count ? true : false;
}
?>

0 comments on commit 4d0e12f

Please sign in to comment.