Skip to content

Commit

Permalink
Patient Summary Screen Modifications:
Browse files Browse the repository at this point in the history
1)  Created mechanism (using ajax and specific user entries in the users table)
to make the expand/collapse selections in the patient summary persistent
(even when logout/login) for each user.
2)  Clarified buttons (edit buttons for each entry)
3)  Migrated prescription link (removed rx from top and put with the Presciption
entry on right)
4)  Removed modul from the document link (the modul for this specific screen is
currently not useful)
  • Loading branch information
bradymiller committed Aug 5, 2010
1 parent 5f1866c commit dcff0e1
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 40 deletions.
159 changes: 119 additions & 40 deletions interface/patient_file/summary/demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@
require_once("$srcdir/options.inc.php");
require_once("../history/history.inc.php");
require_once("$srcdir/formatting.inc.php");
require_once("$srcdir/user.inc");
if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) {
include_once("$srcdir/pid.inc");
setpid($_GET['set_pid']);
}

// COLLECT the user settings
// currently collects flags to keep track of
// which sections to persistently expand/collapse
$user_settings = getUserSettings($_SESSION['authUserID']);

function print_as_money($money) {
preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
$tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
Expand Down Expand Up @@ -141,9 +147,11 @@ function toggle( target, div ) {
if ( $mode == "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" ) {
$(target).find(".indicator").text( "<?php echo htmlspecialchars(xl('expand'),ENT_QUOTES); ?>" );
$(div).hide();
$.post( "../../../library/ajax/user_settings.php", { target: div, mode: 0 });
} else {
$(target).find(".indicator").text( "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" );
$(div).show();
$.post( "../../../library/ajax/user_settings.php", { target: div, mode: 1 });
}

}
Expand Down Expand Up @@ -171,7 +179,19 @@ function toggle( target, div ) {
});

// load divs
$("#stats_div").load("stats.php");
$("#stats_div").load("stats.php", { 'embeddedScreen' : true }, function() {
// special size for (note need to place here to get the dynamic link to work
$(".rx_modal").fancybox( {
'overlayOpacity' : 0.0,
'showCloseButton' : true,
'frameHeight' : 500,
'frameWidth' : 800,
'centerOnScroll' : false,
'callbackOnClose' : function() {
refreshme();
}
});
});
$("#notes_div").load("pnotes_fragment.php");
$("#disc_div").load("disc_fragment.php");

Expand All @@ -198,20 +218,6 @@ function toggle( target, div ) {
'centerOnScroll' : false
});


// special size for
$(".rx_modal").fancybox( {
'overlayOpacity' : 0.0,
'showCloseButton' : true,
'frameHeight' : 500,
'frameWidth' : 800,
'centerOnScroll' : false,
'callbackOnClose' : function() {
refreshme();
}
});


});
</script>

Expand Down Expand Up @@ -245,16 +251,9 @@ function toggle( target, div ) {

if ($thisauth == 'write') {
foreach (pic_array() as $var) {print $var;}
echo "<td><a href='demographics_full.php'";
if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
echo " onclick='top.restoreSession()'><span class='title'>" .
echo "<td><span class='title'>" .
htmlspecialchars(getPatientName($pid),ENT_NOQUOTES) .
"</span></a>&nbsp;&nbsp;</td>";

echo "<td><a class='css_button' href='demographics_full.php'";
if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
echo " onclick='top.restoreSession()'><span>" .
htmlspecialchars(xl("Edit" ),ENT_NOQUOTES). "</span></a></td>";
"</span>&nbsp;&nbsp;</td>";

if (acl_check('admin', 'super')) {
echo "<td><a class='css_button iframe' href='../deleter.php?patient=" .
Expand Down Expand Up @@ -296,16 +295,14 @@ function toggle( target, div ) {

<tr>
<td class="small" colspan='4'>
<a href="rx_frameset.php" class='iframe rx_modal' onclick='top.restoreSession()'>
<?php echo htmlspecialchars(xl('Rx'),ENT_NOQUOTES); ?></a>
|
<a href="../history/history.php" onclick='top.restoreSession()'>
<?php echo htmlspecialchars(xl('History'),ENT_NOQUOTES); ?></a>
|
<a href="../report/patient_report.php" class='iframe medium_modal' onclick='top.restoreSession()'>
<?php echo htmlspecialchars(xl('Report'),ENT_NOQUOTES); ?></a>
|
<a href="../../../controller.php?document&list&patient_id=<?php echo $pid;?>" class='iframe medium_modal' onclick='top.restoreSession()'>
<?php //note that we have temporarily removed document screen from the modul view ?>
<a href="../../../controller.php?document&list&patient_id=<?php echo $pid;?>" onclick='top.restoreSession()'>
<?php echo htmlspecialchars(xl('Documents'),ENT_NOQUOTES); ?></a>
|
<a href="../transaction/transactions.php" class='iframe large_modal' onclick='top.restoreSession()'>
Expand All @@ -324,12 +321,33 @@ function toggle( target, div ) {
<tr>
<td>
<div class="section-header">
<a href='javascript:;' class='small' id='dem_view'><span class='text'><b>
<?php echo htmlspecialchars(xl("Demographics"),ENT_NOQUOTES); ?></b></span> (<span class="indicator"><?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?></span>)</a>
<table><tr>
<?php if ($thisauth == 'write') {
echo "<td><a class='css_button_small' href='demographics_full.php'";
if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
echo " onclick='top.restoreSession()'><span>" .
htmlspecialchars(xl("Edit" ),ENT_NOQUOTES). "</span></a></td>";
} ?>
<td><a href='javascript:;' class='small' id='dem_view'><span class='text'><b>
<?php echo htmlspecialchars(xl("Demographics"),ENT_NOQUOTES); ?></b></span>
<?php if ($user_settings['dem_expand']) {
$label = xl('collapse');
}
else {
$label = xl('expand');
} ?>
(<span class="indicator"><?php echo htmlspecialchars($label, ENT_QUOTES); ?></span>)</a></td>
</tr></table>
</div>

<!-- Demographics -->
<div id="DEM">
<?php if ($user_settings['dem_expand']) {
$styling = "";
}
else {
$styling = "style='display:none'";
} ?>
<div id="DEM" <?php echo $styling; ?>>
<ul class="tabNav">
<?php display_layout_tabs('DEM', $result, $result2); ?>
</ul>
Expand Down Expand Up @@ -361,11 +379,32 @@ function toggle( target, div ) {

?>
<div class="section-header">
<a href='javascript:;' class='small' id='ins_view'><span class='text'><b>
<?php echo htmlspecialchars(xl("Insurance"),ENT_NOQUOTES); ?></b></span> (<span class="indicator"><?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?></span>)</a>
<table><tr>
<?php if ($thisauth == 'write') {
echo "<td><a class='css_button_small' href='demographics_full.php'";
if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
echo " onclick='top.restoreSession()'><span>" .
htmlspecialchars(xl("Edit" ),ENT_NOQUOTES). "</span></a></td>";
} ?>
<td><a href='javascript:;' class='small' id='ins_view'><span class='text'><b>
<?php echo htmlspecialchars(xl("Insurance"),ENT_NOQUOTES); ?></b></span>
<?php if ($user_settings['ins_expand']) {
$label = xl('collapse');
}
else {
$label = xl('expand');
} ?>
(<span class="indicator"><?php echo htmlspecialchars($label, ENT_QUOTES); ?></span>)</a></td>
</tr></table>
</div>

<div id="INSURANCE">
<?php if ($user_settings['ins_expand']) {
$styling = "";
}
else {
$styling = "style='display:none'";
} ?>
<div id="INSURANCE" <?php echo $styling; ?>>

<?php
if ( $insurance_count > 1 ) {
Expand Down Expand Up @@ -532,10 +571,30 @@ function toggle( target, div ) {
<tr>
<td width='650px'>
<div class="section-header">
<a href='javascript:;' class='small' id='notes_view'><span class='text'><b><?php echo htmlspecialchars(xl("Notes"),ENT_NOQUOTES);?></b></span> (<span class="indicator"><?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?></span>)</a>
<table><tr>
<?php echo "<td><a class='css_button_small' href='pnotes_full.php'";
if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
echo " onclick='top.restoreSession()'><span>" .
htmlspecialchars(xl("Edit" ),ENT_NOQUOTES). "</span></a></td>";
?>
<td><a href='javascript:;' class='small' id='notes_view'><span class='text'><b><?php echo htmlspecialchars(xl("Notes"),ENT_NOQUOTES);?></b></span>
<?php if ($user_settings['not_expand']) {
$label = xl('collapse');
}
else {
$label = xl('expand');
} ?>
(<span class="indicator"><?php echo htmlspecialchars($label, ENT_QUOTES); ?></span>)</a></td>
</tr></table>
</div>
<!-- Demographics -->
<div id='notes_div' class='tab current' style='height:auto; width:100%' >
<?php if ($user_settings['not_expand']) {
$styling = "style='height:auto; width:100%;'";
}
else {
$styling = "style='height:auto; width:100%; display:none;'";
} ?>
<div id='notes_div' class='tab current' <?php echo $styling; ?>>

<br/>
<div style='margin-left:10px' class='text'><image src='../../pic/ajax-loader.gif'/></div><br/>
</div>
Expand All @@ -544,10 +603,30 @@ function toggle( target, div ) {
<tr>
<td width='650px'>
<div class="section-header">
<a href='javascript:;' class='small' id='disc_view'><span class='text'><b><?php echo htmlspecialchars(xl("Disclosures"),ENT_NOQUOTES);?></b></span> (<span class="indicator"><?php echo htmlspecialchars(xl('collapse'),ENT_NOQUOTES); ?></span>)</a>
<table><tr>
<?php echo "<td><a class='css_button_small' href='disclosure_full.php'";
if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
echo " onclick='top.restoreSession()'><span>" .
htmlspecialchars(xl("Edit" ),ENT_NOQUOTES). "</span></a></td>";
?>
<td><a href='javascript:;' class='small' id='disc_view'><span class='text'><b><?php echo htmlspecialchars(xl("Disclosures"),ENT_NOQUOTES);?></b></span>
<?php if ($user_settings['dis_expand']) {
$label = xl('collapse');
}
else {
$label = xl('expand');
} ?>
(<span class="indicator"><?php echo htmlspecialchars($label, ENT_QUOTES); ?></span>)</a></td>
</tr></table>
</div>
<!-- Demographics -->
<div id='disc_div' class='tab current' style='height:auto; width:100%' >
<?php if ($user_settings['dis_expand']) {
$styling = "style='height:auto; width:100%;'";
}
else {
$styling = "style='height:auto; width:100%; display:none;'";
} ?>
<div id='disc_div' class='tab current' <?php echo $styling; ?>>

<br/>
<div style='margin-left:10px' class='text'><image src='../../pic/ajax-loader.gif'/></div><br/>
</div>
Expand Down
4 changes: 4 additions & 0 deletions interface/patient_file/summary/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ function load_location( location ) {
<table id="patient_stats_prescriptions">
<tr><td colspan='<?php echo $numcols ?>' class='issuetitle'>
<span class='text'><b><?php echo htmlspecialchars(xl('Prescriptions'),ENT_NOQUOTES); ?></b></span>
<?php if ($_POST['embeddedScreen']) { ?>
<a href="rx_frameset.php" class='iframe rx_modal small' onclick='top.restoreSession()'>
(<b><?php echo htmlspecialchars(xl('Manage'),ENT_NOQUOTES); ?>)</b></a>
<?php } ?>
</td></tr>
</tr><td>
<?php
Expand Down
49 changes: 49 additions & 0 deletions library/ajax/user_settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
// Copyright (C) 2010 Brady Miller <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
//
// This file contains functions that manage custom user
// settings
//

//SANITIZE ALL ESCAPES
$sanitize_all_escapes=true;
//

//STOP FAKE REGISTER GLOBALS
$fake_register_globals=false;
//

require_once(dirname(__FILE__) . "/../../interface/globals.php");
require_once(dirname(__FILE__) . "/../user.inc");

//If 'mode' is either a 1 or 0 and 'target' is set
// Then will update the appropriate user flag
if (($_POST['mode'] == 1 || $_POST['mode'] == 0) && isset($_POST['target'])) {

//Set the demographics expand setting in the patient summary screen
if ($_POST['target'] == "#DEM") {
setUserSetting("dem_expand", $_POST['mode'], $_SESSION['authUserID']);
}

//Set the insurance expand setting in the patient summary screen
if ($_POST['target'] == "#INSURANCE") {
setUserSetting("ins_expand", $_POST['mode'], $_SESSION['authUserID']);
}

//Set the patient notes expand setting in the patient summary screen
if ($_POST['target'] == "#notes_div") {
setUserSetting("not_expand", $_POST['mode'], $_SESSION['authUserID']);
}

//Set the disclosures expand setting in the patient summary screen
if ($_POST['target'] == "#disc_div") {
setUserSetting("dis_expand", $_POST['mode'], $_SESSION['authUserID']);
}
}
?>
27 changes: 27 additions & 0 deletions library/user.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.

require_once(dirname(__FILE__) . "/sql.inc");
require_once(dirname(__FILE__) . "/formdata.inc.php");

//This will return the user settings from the 'users' table.
// $id is the user id number in the 'users' table
function getUserSettings($id) {
$row = sqlQuery("SELECT dem_expand, ins_expand, not_expand, " .
"dis_expand FROM users WHERE id=?", array($id) );
return $row;
}

//This will set a user setting
// $name is the setting name in the 'users' table
// $value is the setting value to be set in the 'users' table
// $id is the user id number in the 'users' table
function setUserSetting($name, $value, $id) {
sqlStatement("UPDATE users SET " . add_escape_custom($name) .
"=? WHERE id=?", array($value, $id) );
}

?>
9 changes: 9 additions & 0 deletions sql/3_2_0-to-4_0_0_upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -745,3 +745,12 @@ INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES (
INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('disclosure_type', 'disclosure-payment', 'Payment', 20, 0);
INSERT INTO list_options ( list_id, option_id, title, seq, is_default ) VALUES ('disclosure_type', 'disclosure-healthcareoperations', 'Health Care Operations', 30, 0);
#EndIf

#IfMissingColumn users dem_expand
ALTER TABLE users
ADD `dem_expand` tinyint(1) NOT NULL default '1' COMMENT 'patient summary demographics expand flag',
ADD `ins_expand` tinyint(1) NOT NULL default '0' COMMENT 'patient summary insurance expand flag',
ADD `not_expand` tinyint(1) NOT NULL default '0' COMMENT 'patient summary notes expand flag',
ADD `dis_expand` tinyint(1) NOT NULL default '0' COMMENT 'patient summary disclosures expand flag';
#EndIf

4 changes: 4 additions & 0 deletions sql/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3060,6 +3060,10 @@ CREATE TABLE `users` (
`pwd_history2` longtext default NULL,
`default_warehouse` varchar(31) NOT NULL DEFAULT '',
`irnpool` varchar(31) NOT NULL DEFAULT '',
`dem_expand` tinyint(1) NOT NULL default '1' COMMENT 'patient summary demographics expand flag',
`ins_expand` tinyint(1) NOT NULL default '0' COMMENT 'patient summary insurance expand flag',
`not_expand` tinyint(1) NOT NULL default '0' COMMENT 'patient summary notes expand flag',
`dis_expand` tinyint(1) NOT NULL default '0' COMMENT 'patient summary disclosures expand flag',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;

Expand Down

0 comments on commit dcff0e1

Please sign in to comment.