Skip to content

Commit

Permalink
Insurance/Add/Search now all modal and selections pass back up the ch…
Browse files Browse the repository at this point in the history
…ain either way.

View ID Card has a nicer look and an actual View Button
Title bar is twice as tall and Patient info and right side links are stacked to allow for clean look on smaller monitors (like the very popular netbooks).
  • Loading branch information
tmccormi committed Nov 12, 2010
1 parent c7ca267 commit c7e02da
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 50 deletions.
2 changes: 1 addition & 1 deletion interface/globals.php
Expand Up @@ -312,7 +312,7 @@ function undoMagicQuotes($array, $topLevel=true) {
// The height in pixels of the Navigation bar:
$GLOBALS['navBarHeight'] = 22;
// The height in pixels of the Title bar:
$GLOBALS['titleBarHeight'] = 20;
$GLOBALS['titleBarHeight'] = 40;

// The assistant word, MORE printed next to titles that can be clicked:
// Note this label gets translated here via the xl function
Expand Down
2 changes: 1 addition & 1 deletion interface/main/left_nav.php
Expand Up @@ -549,7 +549,7 @@ function reloadEncounter(frname) {
// of the frame that the call came from, so we know to only reload content
// from the *other* frame if it is patient-specific.
function setPatient(pname, pid, pubpid, frname, str_dob) {
var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')</b></a>';
var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
setDivContent('current_patient', str);
setTitleContent('current_patient', str + str_dob);
if (pid == active_pid) return;
Expand Down
15 changes: 7 additions & 8 deletions interface/main/main_title.php
Expand Up @@ -61,7 +61,7 @@ function toencounter(rawdata) {
</td>
<td valign="middle">
<div style='margin-left:10px; float:left; display:none' id="past_encounter_block">
<span class='title_bar_top' id="past_encounter"><b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b></span></td>
<span class='title_bar_top' id="past_encounter"><b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b></span></td>
</div>
</td>
<td valign="middle">
Expand All @@ -72,19 +72,18 @@ function toencounter(rawdata) {

<td valign="middle">
<div style='float:right; margin-left:5px'>

<div style='float:left; margin-top:3px' class = 'text'>
<a href="javascript:;" onclick="javascript:parent.left_nav.goHome();" ><?php xl('Home','e'); ?></a>
&nbsp;|&nbsp;
<a href="../../Documentation/User_Guide/" target="RTop" id="help_link" onclick="top.restoreSession()"> <?php xl('Manual','e'); ?></a>
&nbsp;|&nbsp;
<br>
<span class='text'><?php xl('Logged in','e'); ?></span>:&nbsp;<span class="title_bar_top"><?php echo $res{"fname"}.' '.$res{"lname"};?></span>
<span style="font-size:0.7em;"> (<?php echo $_SESSION['authGroup']?>)</span>
</div>

<div style='float:left'>
<span class='text'><?php xl('Logged in','e'); ?></span>:&nbsp;<span class="title_bar_top"><?php echo $res{"fname"}.' '.$res{"lname"};?></span>
<span style="font-size:0.7em;"> (<?php echo $_SESSION['authGroup']?>)</span>
<div style='float:right;margin-left:5px'>
<a href="../logout.php?auth=logout" target="_top" class="css_button_small" id="logout_link" onclick="top.restoreSession()" >
<span><?php xl('Logout', 'e'); ?></span></a>
</div>
<div style='float:left;margin-left:5px'><a href="../logout.php?auth=logout" target="_top" class="css_button_small" id="logout_link"><span><?php xl('Logout', 'e'); ?></span></a></div>
</div>
</td>

Expand Down
30 changes: 24 additions & 6 deletions interface/patient_file/summary/demographics.php
Expand Up @@ -196,7 +196,7 @@ function toggleIndicator(target,div) {
});

// special size for
$(".image_view_modal").fancybox( {
$("#image_view_modal").fancybox( {
'overlayOpacity' : 0.0,
'showCloseButton' : true,
'centerOnScroll' : false,
Expand All @@ -221,6 +221,12 @@ function toggleIndicator(target,div) {
<?php
$result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
$result2 = getEmployerData($pid);
$result3 = getInsuranceData($pid, "primary", "copay, provider, DATE_FORMAT(`date`,'%Y-%m-%d') as effdate");
$insco_name = "";

if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
$insco_name = getInsuranceProvider($result3['provider']);
}

$thisauth = acl_check('patients', 'demo');
if ($thisauth) {
Expand Down Expand Up @@ -251,7 +257,15 @@ function toggleIndicator(target,div) {
echo "<td>&nbsp;&nbsp;&nbsp;<span class='bold'><font color='#ee6600'>" .
htmlspecialchars(xl('Balance Due'),ENT_NOQUOTES) .
": " . htmlspecialchars(oeFormatMoney(get_patient_balance($pid)),ENT_NOQUOTES) .
"</font><br />";
"</font>";
if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
echo '&nbsp; ' . htmlspecialchars(xl('Primary Ins'),ENT_NOQUOTES) . ':&nbsp;' . htmlspecialchars($insco_name,ENT_QUOTES);
if ($result3['copay'] > 0) {
echo '&nbsp; ' . htmlspecialchars(xl('Copay'),ENT_NOQUOTES) . ':&nbsp;' . htmlspecialchars($result3['copay'],ENT_QUOTES);
}
echo '&nbsp; ' . htmlspecialchars(xl('Eff Date'),ENT_NOQUOTES) . ':&nbsp;' . htmlspecialchars(oeFormatShortDate($result3['effdate'],ENT_QUOTES));
}
echo "<br />";
if ($result['genericname2'] == 'Billing') {
htmlspecialchars(xl('Billing Note'),ENT_NOQUOTES) . ":";
echo "<span class='bold'><font color='red'>" .
Expand Down Expand Up @@ -616,14 +630,18 @@ function toggleIndicator(target,div) {
if (preg_match('/\.pdf$/i',$image_file)) {
echo "<a href='" . $web_root . "/controller.php?document&retrieve" .
"&patient_id=$pid&document_id=$document_id'" .
" onclick='top.restoreSession()'>" .
xl("Click for ID card") . "</a><br />";
" onclick='top.restoreSession()' class='css_button_small'>" .
"<span>" .
htmlspecialchars( xl("View"), ENT_QUOTES )."</a> &nbsp;" . htmlspecialchars( xl("PDF of Patient ID Card"), ENT_QUOTES ) .
"</span> <br /><hr>";
} else {
// image file type(s) std list png, jpg, etc...
echo "<a href='" . $web_root . "/sites/" . $_SESSION['site_id'] .
"/documents/$pid/$image_file'" .
" onclick='top.restoreSession()' class='iframe image_view_modal'>" .
xl("Click to View ID card") . "</a><br />";
" onclick='top.restoreSession()' class='css_button_small' id='image_view_modal'>" .
"<span>" .
htmlspecialchars( xl("View"), ENT_QUOTES )."</a> &nbsp;" . htmlspecialchars( xl("Patient ID Card"), ENT_QUOTES ) .
"</span> <br /><hr>";
}
}

Expand Down
43 changes: 24 additions & 19 deletions interface/patient_file/summary/demographics_full.php
Expand Up @@ -65,16 +65,23 @@
<script type="text/javascript" src="../../../library/js/common.js"></script>

<script type="text/javascript" src="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>

<link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />

<script type="text/javascript">
$(document).ready(function(){
tabbify();
enable_modals();
});
</script>

<SCRIPT LANGUAGE="JavaScript"><!--
// special size for
$(".medium_modal").fancybox( {
'overlayOpacity' : 0.0,
'showCloseButton' : true,
'frameHeight' : 460,
'frameWidth' : 650
});

});

var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';

Expand Down Expand Up @@ -103,7 +110,8 @@ function upperFirst(string,text) {
<?php for ($i=1;$i<=3;$i++) { ?>
function auto_populate_employer_address<?php echo $i ?>(){
var f = document.demographics_form;
if (f.form_i<?php echo $i?>subscriber_relationship.options[f.form_i<?php echo $i?>subscriber_relationship.selectedIndex].value == "self") {
if (f.form_i<?php echo $i?>subscriber_relationship.options[f.form_i<?php echo $i?>subscriber_relationship.selectedIndex].value == "self")
{
f.i<?php echo $i?>subscriber_fname.value=f.form_fname.value;
f.i<?php echo $i?>subscriber_mname.value=f.form_mname.value;
f.i<?php echo $i?>subscriber_lname.value=f.form_lname.value;
Expand Down Expand Up @@ -153,7 +161,6 @@ function checkNum () {
// The OnClick handler for searching/adding the insurance company.
function ins_search(ins) {
insurance_index = ins;
dlgopen('../../practice/ins_search.php', '_blank', 550, 400);
return false;
}

Expand Down Expand Up @@ -290,8 +297,6 @@ function policykeyup(e) {

});

//-->

</script>
</head>

Expand Down Expand Up @@ -412,7 +417,7 @@ function end_group() {
$result3 = $insurance_info[$i];
?>

<div class="tab <?php echo $i == 1 ? 'current': '' ?>" style='height:auto;width:950px'> <!---ie 6 fix-->
<div class="tab <?php echo $i == 1 ? 'current': '' ?>" style='height:auto;width:auto'> <!---display icky, fix to auto-->

<table border="0">

Expand All @@ -426,9 +431,9 @@ function end_group() {
</td>
<td class='required'>:</td>
<td>
<a class="css_button" onclick="ins_search(<?php echo $i?>)" href="../../practice/ins_search.php">
<span><?php echo xl('Search/Add') ?></span>
</a>
<a href="../../practice/ins_search.php" class="iframe medium_modal css_button" onclick="ins_search(<?php echo $i?>)">
<span><?php echo xl('Search/Add') ?></span>
</a>
<select name="i<?php echo $i?>provider">
<option value=""><?php xl('Unassigned','e'); ?></option>
<?php
Expand Down Expand Up @@ -535,14 +540,6 @@ function end_group() {

<td valign=top>
<table border="0">
<tr>
<td width=120><span class=required><?php xl('Subscriber','e'); ?> </span></td>
<td class=required>:</td>
<td colspan=3><input type=entry size=10 name=i<?php echo $i?>subscriber_fname value="<?php echo $result3{"subscriber_fname"}?>" onchange="capitalizeMe(this);" />
<input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>" onchange="capitalizeMe(this);" />
<input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>" onchange="capitalizeMe(this);" /></td>
<td></td><td></td><td></td><td></td>
</tr>
<tr>
<td><span class=required><?php xl('Relationship','e'); ?></span></td>
<td class=required>:</td>
Expand All @@ -554,6 +551,14 @@ function end_group() {
<a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a></td>
<td></td><td></td><td></td><td></td>
</tr>
<tr>
<td width=120><span class=required><?php xl('Subscriber','e'); ?> </span></td>
<td class=required>:</td>
<td colspan=3><input type=entry size=10 name=i<?php echo $i?>subscriber_fname value="<?php echo $result3{"subscriber_fname"}?>" onchange="capitalizeMe(this);" />
<input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>" onchange="capitalizeMe(this);" />
<input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>" onchange="capitalizeMe(this);" /></td>
<td></td><td></td><td></td><td></td>
</tr>
<tr>
<td><span class=bold><?php xl('D.O.B.','e'); ?> </span></td>
<td class=required>:</td>
Expand Down
9 changes: 3 additions & 6 deletions interface/practice/ins_list.php
Expand Up @@ -75,12 +75,9 @@ function addwhere($where, $colname, $value) {

// This is invoked when an insurance company name is clicked.
function setins(ins_id, ins_name) {
if (opener.closed || ! opener.set_insurance)
alert('The parent window was closed; I cannot apply your selection.');
else
opener.set_insurance(ins_id, ins_name);
window.close();
return false;
parent.set_insurance(ins_id, ins_name);
parent.$.fn.fancybox.close();
return false;
}

</script>
Expand Down
40 changes: 32 additions & 8 deletions interface/practice/ins_search.php
Expand Up @@ -63,10 +63,20 @@
<style>
td { font-size:10pt; }
.search { background-color:#aaffaa }

#form_entry {
display:block;
}

#form_list {
display:none;
}

</style>

<script type="text/javascript" src="../../library/topdialog.js"></script>
<script type="text/javascript" src="../../library/dialog.js"></script>
<script type="text/javascript" src="../../library/js/jquery.1.3.2.js"></script>

<script language="JavaScript">

Expand All @@ -80,8 +90,10 @@ function doescape(value) {

// This is invoked when our Search button is clicked.
function dosearch() {
var f = document.forms[0];
dlgopen('ins_list.php' +

$("#form_entry").hide();
var f = document.forms[0];
var search_list = 'ins_list.php' +
'?form_name=' + doescape(f.form_name.value ) +
'&form_attn=' + doescape(f.form_attn.value ) +
'&form_addr1=' + doescape(f.form_addr1.value ) +
Expand All @@ -90,8 +102,10 @@ function dosearch() {
'&form_state=' + doescape(f.form_state.value ) +
'&form_zip=' + doescape(f.form_zip.value ) +
'&form_phone=' + doescape(f.form_phone.value ) +
'&form_cms_id=' + doescape(f.form_cms_id.value) +
'', '_blank', 780, 500);
'&form_cms_id=' + doescape(f.form_cms_id.value);

top.restoreSession();
$("#form_list").load( search_list ).show();

return false;
}
Expand All @@ -102,7 +116,9 @@ function set_insurance(ins_id, ins_name) {
alert('The target form was closed; I cannot apply your selection.');
else
opener.set_insurance(ins_id, ins_name);
window.close();
parent.$.fn.fancybox.close();
parent.location.reload();
top.restoreSession();
}

// This is set to true on a mousedown of the Save button. The
Expand Down Expand Up @@ -197,8 +213,9 @@ function validate(f) {
//
echo "<script language='JavaScript'>\n";
if ($info_msg) echo " alert('$info_msg');\n";
echo " window.close();\n";
echo " if (opener.set_insurance) opener.set_insurance($ins_id,'$ins_name');\n";
echo " parent.$.fn.fancybox.close();\n";
echo " top.restoreSession();\n";
echo " if (parent.set_insurance) parent.set_insurance($ins_id,'$ins_name');\n";
echo "</script></body></html>\n";
exit();
}
Expand All @@ -208,6 +225,8 @@ function validate(f) {
"SELECT id, name FROM x12_partners ORDER BY name"
);
?>
<div id="form_entry">

<form method='post' name='theform' action='ins_search.php'
onsubmit='return validate(this)'>
<center>
Expand Down Expand Up @@ -341,10 +360,15 @@ class='search' title='Identifier assigned by CMS' />
&nbsp;
<input type='submit' value='<?php xl('Save as New','e'); ?>' name='form_save' onmousedown='save_clicked=true' />
&nbsp;
<input type='button' value='<?php xl('Cancel','e'); ?>' onclick='window.close()' />
<input type='button' value='<?php xl('Cancel','e'); ?>' onclick='parent.$.fn.fancybox.close();'/>
</p>

</center>
</form>
</div>

<div id="form_list">
</div>

</body>
</html>
2 changes: 1 addition & 1 deletion interface/themes/style_default.css
Expand Up @@ -177,7 +177,7 @@ a:hover {
.bottom_line { background: url('../pic/aquabg.gif') repeat; } /* $GLOBALS['style']['BOTTOM_BG_LINE'] */
.logobar { background-color: #24262c; height: 110px; } /* $GLOBALS['logoBarHeight'] */
.navbar { height: 22px; } /* $GLOBALS['navBarHeight'] */
.titlebar { height: 20px; } /* $GLOBALS['titleBarHeight'] */
.titlebar { height: 40px; } /* $GLOBALS['titleBarHeight'] */


/* style taken out of the addressbook code and put here instead */
Expand Down
8 changes: 8 additions & 0 deletions library/patient.inc
Expand Up @@ -37,6 +37,14 @@ function getLanguages() {
return $returnval;
}

function getInsuranceProvider($ins_id) {

$sql = "select name from insurance_companies where id=?";
$row = sqlQuery($sql,array($ins_id));
return $row['name'];

}

function getInsuranceProviders() {
$returnval = array();

Expand Down

0 comments on commit c7e02da

Please sign in to comment.