Skip to content

Commit

Permalink
changes to allow additional Insurance information
Browse files Browse the repository at this point in the history
changes to allow additional Insurance information in the insurance
screen on patient demographics
  • Loading branch information
teryhill authored and bradymiller committed Feb 4, 2016
1 parent aaa2762 commit 76aad30
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
15 changes: 15 additions & 0 deletions library/globals.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,21 @@
xl('Special treatment for the Vitals form')
),

'insurance_information' => array(
xl('Show Additional Insurance Information'), // descriptive name
array(
'0' => xl('None'),
'1' => xl('Address Only'),
'2' => xl('Address and Postal Code'),
'3' => xl('Address and State'),
'4' => xl('Address, State and Postal Code'),
'5' => xl('Postal Code and Box Number'),
),
'0', // default = NONE
xl('Show Insurance Address Information in the Insurance Panel of Demographics.')

),

),

// Locale Tab
Expand Down
34 changes: 20 additions & 14 deletions library/patient.inc
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,37 @@ function getInsuranceProvider($ins_id) {
function getInsuranceProviders() {
$returnval = array();

if (true) {
$sql = "select name, id from insurance_companies order by name, id";
$rez = sqlStatement($sql);
for($iter=0; $row=sqlFetchArray($rez); $iter++) {
$returnval[$row['id']] = $row['name'];
}
}

// Please leave this here. I have a user who wants to see zip codes and PO
// box numbers listed along with the insurance company names, as many companies
// have different billing addresses for different plans. -- Rod Roark
//
else {
$sql = "select insurance_companies.name, insurance_companies.id, " .
"addresses.zip, addresses.line1 " .
"addresses.zip, addresses.line1, addresses.state " .
"from insurance_companies, addresses " .
"where addresses.foreign_id = insurance_companies.id " .
"order by insurance_companies.name, addresses.zip";

$rez = sqlStatement($sql);

for($iter=0; $row=sqlFetchArray($rez); $iter++) {
switch ($GLOBALS['insurance_information']) {
case $GLOBALS['insurance_information'] = '0':
$returnval[$row['id']] = $row['name'];
break;
case $GLOBALS['insurance_information'] = '1':
$returnval[$row['id']] = $row['name'] . " (" . $row['line1'] . ")";
break;
case $GLOBALS['insurance_information'] = '2':
$returnval[$row['id']] = $row['name'] . " (" . $row['line1'] . "," . $row['zip'] . ")";
break;
case $GLOBALS['insurance_information'] = '3':
$returnval[$row['id']] = $row['name'] . " (" . $row['line1'] . "," . $row['state'] . ")";
break;
case $GLOBALS['insurance_information'] = '4':
$returnval[$row['id']] = $row['name'] . " (" . $row['line1'] . "," . $row['state'] .
"," . $row['zip'] . ")";
break;
case $GLOBALS['insurance_information'] = '5':
preg_match("/\d+/", $row['line1'], $matches);
$returnval[$row['id']] = $row['name'] . " (" . $row['zip'] .
"," . $matches[0] . ")";
break;
}
}

Expand Down

0 comments on commit 76aad30

Please sign in to comment.