3 // Copyright (C) 2011 by following authors:
4 // - Cassian LUP <cassi.lup@gmail.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 //SANITIZE ALL ESCAPES
12 // (note this is already completed by the script that includes this
13 // get_patient_info.php )
15 //STOP FAKE REGISTER GLOBALS
16 // (note this is already completed by the script that includes this
17 // get_patient_info.php )
22 //landing page definition -- where to go if something goes wrong
23 $landingpage = "index.php?site=".$_SESSION['site_id'];
26 // kick out if patient not authenticated
27 if ( isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite']) ) {
28 $pid = $_SESSION['pid'];
32 header('Location: '.$landingpage.'&w');
40 require_once("../interface/globals.php");
41 require_once("$srcdir/patient.inc");
42 require_once("$srcdir/acl.inc");
43 require_once("$srcdir/classes/Address.class.php");
44 require_once("$srcdir/classes/InsuranceCompany.class.php");
45 require_once("$srcdir/classes/Document.class.php");
46 require_once("$srcdir/options.inc.php");
47 require_once("../interface/patient_file/history/history.inc.php");
48 require_once("$srcdir/formatting.inc.php");
49 require_once("$srcdir/edi.inc");
50 include_once("$srcdir/lists.inc");
56 <?php
html_header_show(); ?
>
57 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
58 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
59 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/dynarch_calendar.css">
60 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/textformat.js"></script
>
61 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dynarch_calendar.js"></script
>
62 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
63 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dynarch_calendar_setup.js"></script
>
64 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dialog.js"></script
>
65 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/jquery.1.3.2.js"></script
>
66 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/common.js"></script
>
67 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
68 <link rel
="stylesheet" href
="css/base.css" type
="text/css"/>
69 <link rel
="stylesheet" href
="css/tables.css" type
="text/css"/>
70 <script type
="text/javascript" language
="JavaScript">
72 function refreshme() {
76 function toggleIndicator(target
,div
) {
78 $mode = $
(target
).find(".indicator").text();
79 if ( $mode == "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" ) {
80 $
(target
).find(".indicator").text( "<?php echo htmlspecialchars(xl('expand'),ENT_QUOTES); ?>" );
83 $
(target
).find(".indicator").text( "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" );
88 function refreshAppointments() {
89 $
("#appointments_ps_expand").load("get_appointments.php", { 'embeddedScreen' : true }, function() {
90 $
(".edit_event").fancybox({
91 'overlayOpacity' : 0.0,
92 'showCloseButton' : true,
93 'centerOnScroll' : false,
95 'hihdeOnContentClick' : false,
96 'callbackOnClose' : function() {
97 refreshAppointments();
103 function show_date_fun(){
104 if(document
.getElementById('show_date').checked
== true){
105 document
.getElementById('date_div').style
.display
= '';
107 document
.getElementById('date_div').style
.display
= 'none';
112 $
(document
).ready(function(){
115 $
("#labtestresults_ps_expand").load("get_lab_results.php", { 'embeddedScreen' : true }, function() {
116 // (note need to place javascript code here also to get the dynamic link to work)
117 $
(".medium_modal").fancybox( {
118 'overlayOpacity' : 0.0,
119 'showCloseButton' : true,
122 'centerOnScroll' : false,
123 'callbackOnClose' : function() {
128 $
("#problemlist_ps_expand").load("get_problems.php", { 'embeddedScreen' : true }, function() {
129 // (note need to place javascript code here also to get the dynamic link to work)
130 $
(".medium_modal").fancybox( {
131 'overlayOpacity' : 0.0,
132 'showCloseButton' : true,
135 'centerOnScroll' : false,
136 'callbackOnClose' : function() {
141 $
("#medicationlist_ps_expand").load("get_medications.php", { 'embeddedScreen' : true }, function() {
142 // (note need to place javascript code here also to get the dynamic link to work)
143 $
(".medium_modal").fancybox( {
144 'overlayOpacity' : 0.0,
145 'showCloseButton' : true,
148 'centerOnScroll' : false,
149 'callbackOnClose' : function() {
154 $
("#medicationallergylist_ps_expand").load("get_allergies.php", { 'embeddedScreen' : true }, function() {
155 // (note need to place javascript code here also to get the dynamic link to work)
156 $
(".medium_modal").fancybox( {
157 'overlayOpacity' : 0.0,
158 'showCloseButton' : true,
161 'centerOnScroll' : false,
162 'callbackOnClose' : function() {
168 refreshAppointments();
173 // modal for dialog boxes
174 $
(".large_modal").fancybox( {
175 'overlayOpacity' : 0.0,
176 'showCloseButton' : true,
179 'centerOnScroll' : false
182 // modal for image viewer
183 $
(".image_modal").fancybox( {
184 'overlayOpacity' : 0.0,
185 'showCloseButton' : true,
186 'centerOnScroll' : false,
190 $
(".add_event").fancybox( {
191 'overlayOpacity' : 0.0,
192 'showCloseButton' : true,
193 'centerOnScroll' : false,
195 'hideOnContentClick' : false,
196 'onClose' : function() {
201 $
(".generateCCR").click(
203 if(document
.getElementById('show_date').checked
== true){
204 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
205 alert('<?php echo addslashes( xl('Please select a start date
and end date
')) ?>');
209 var ccrAction
= document
.getElementsByName('ccrAction');
210 ccrAction
[0].value
= 'generate';
211 var raw
= document
.getElementsByName('raw');
213 ccr_form
.setAttribute("target", "_blank");
214 $
("#ccr_form").submit();
215 ccr_form
.setAttribute("target", "");
217 $
(".generateCCR_raw").click(
219 var ccrAction
= document
.getElementsByName('ccrAction');
220 ccrAction
[0].value
= 'generate';
221 var raw
= document
.getElementsByName('raw');
222 raw
[0].value
= 'yes';
223 ccr_form
.setAttribute("target", "_blank");
224 $
("#ccr_form").submit();
225 ccr_form
.setAttribute("target", "");
227 $
(".generateCCR_download_h").click(
229 var ccrAction
= document
.getElementsByName('ccrAction');
230 ccrAction
[0].value
= 'generate';
231 var raw
= document
.getElementsByName('raw');
232 raw
[0].value
= 'hybrid';
233 $
("#ccr_form").submit();
235 $
(".generateCCR_download_p").click(
237 if(document
.getElementById('show_date').checked
== true){
238 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
239 alert('<?php echo addslashes( xl('Please select a start date
and end date
')) ?>');
243 var ccrAction
= document
.getElementsByName('ccrAction');
244 ccrAction
[0].value
= 'generate';
245 var raw
= document
.getElementsByName('raw');
246 raw
[0].value
= 'pure';
247 $
("#ccr_form").submit();
251 var ccrAction
= document
.getElementsByName('ccrAction');
252 ccrAction
[0].value
= 'viewccd';
253 var raw
= document
.getElementsByName('raw');
255 ccr_form
.setAttribute("target", "_blank");
256 $
("#ccr_form").submit();
257 ccr_form
.setAttribute("target", "");
259 $
(".viewCCD_raw").click(
261 var ccrAction
= document
.getElementsByName('ccrAction');
262 ccrAction
[0].value
= 'viewccd';
263 var raw
= document
.getElementsByName('raw');
264 raw
[0].value
= 'yes';
265 ccr_form
.setAttribute("target", "_blank");
266 $
("#ccr_form").submit();
267 ccr_form
.setAttribute("target", "");
276 <body
class="body_top">
278 <div id
="wrapper" class="lefttop" style
="width: 700px;">
279 <h2
class="heading"><?php
echo htmlspecialchars( xl('Patient Portal'), ENT_NOQUOTES
); ?
></h2
>
282 $result = getPatientData($pid);
284 <?php
echo htmlspecialchars( xl('Welcome'), ENT_NOQUOTES
); ?
> <b
><?php
echo htmlspecialchars($result['fname']." ".$result['lname'],ENT_NOQUOTES
); ?
></b
>
286 <div style
='margin-top:10px'> <!-- start main content div
-->
287 <table border
="0" cellspacing
="0" cellpadding
="0" width
="100%">
289 <td align
="left" valign
="top">
290 <!-- start left column div
-->
291 <div style
='float:left; margin-right:20px'>
292 <table cellspacing
=0 cellpadding
=0>
293 <?php
if ( $GLOBALS['activate_ccr_ccd_report'] ) { // show CCR/CCD reporting options ?>
298 $widgetTitle = xl("Reports");
299 $widgetLabel = "reports";
300 $widgetButtonLabel = xl("");
301 $widgetButtonClass = "hidden";
302 $linkMethod = "html";
303 $bodyClass = "notab";
306 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
307 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
308 $widgetAuth, $fixedWidth);
311 <div style
='margin-left:3em; margin-right:3em; padding:1em; border:1px solid blue;' class='text'>
312 <div id
="ccr_report">
313 <form name
='ccr_form' id
='ccr_form' method
='post' action
='../ccr/createCCR.php?portal_auth=1'>
314 <span
class='text'><b
><?php
echo htmlspecialchars( xl('Continuity of Care Record (CCR)'), ENT_NOQUOTES
); ?
></b
></span
> 
; 
;
316 <span
class='text'>(<?php
echo htmlspecialchars( xl('Pop ups need to be enabled to see these reports'), ENT_NOQUOTES
); ?
>)</span
>
319 <input type
='hidden' name
='ccrAction'>
320 <input type
='hidden' name
='raw'>
321 <input type
="checkbox" name
="show_date" id
="show_date" onchange
="show_date_fun();" ><span
class='text'><?php
echo htmlspecialchars( xl('Use Date Range'), ENT_NOQUOTES
); ?
>
323 <div id
="date_div" style
="display:none" >
325 <table border
="0" cellpadding
="0" cellspacing
="0" >
328 <span
class='bold'><?php
echo htmlspecialchars( xl('Start Date'), ENT_NOQUOTES
);?
>: </span
>
331 <input type
='text' size
='10' name
='Start' id
='Start'
332 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
333 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>' />
334 <img src
='../interface/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
335 id
='img_start' border
='0' alt
='[?]' style
='cursor:pointer'
336 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>' >
337 <script LANGUAGE
="JavaScript">
338 Calendar
.setup({inputField
:"Start", ifFormat
:"%Y-%m-%d", button
:"img_start"});
343 <span
class='bold'><?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
);?
>: </span
>
346 <input type
='text' size
='10' name
='End' id
='End'
347 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
348 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>' />
349 <img src
='../interface/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
350 id
='img_end' border
='0' alt
='[?]' style
='cursor:pointer'
351 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>' >
352 <script LANGUAGE
="JavaScript">
353 Calendar
.setup({inputField
:"End", ifFormat
:"%Y-%m-%d", button
:"img_end"});
360 <input type
="button" class="generateCCR" value
="<?php echo htmlspecialchars( xl('View/Print'), ENT_QUOTES); ?>" />
361 <!-- <input type
="button" class="generateCCR_download_h" value
="<?php echo htmlspecialchars( xl('Download'), ENT_QUOTES); ?>" /> -->
362 <input type
="button" class="generateCCR_download_p" value
="<?php echo htmlspecialchars( xl('Download'), ENT_QUOTES); ?>" />
363 <!-- <input type
="button" class="generateCCR_raw" value
="<?php echo htmlspecialchars( xl('Raw Report'), ENT_QUOTES); ?>" /> -->
365 <span
class='text'><b
><?php
echo htmlspecialchars( xl('Continuity of Care Document (CCD)'), ENT_NOQUOTES
); ?
></b
></span
> 
; 
;
367 <span
class='text'>(<?php
echo htmlspecialchars( xl('Pop ups need to be enabled to see these reports'), ENT_NOQUOTES
); ?
>)</span
>
370 <input type
="button" class="viewCCD" value
="<?php echo htmlspecialchars( xl('View/Print', ENT_QUOTES)); ?>" />
371 <!-- <input type
="button" class="viewCCD_raw" value
="<?php echo htmlspecialchars( xl('Raw Report', ENT_QUOTES)); ?>" /> -->
379 <?php
} // end CCR/CCD reporting options ?>
381 <?php
echo "<tr><td width='650px'>";
382 // Lab tests results expand collapse widget
383 $widgetTitle = xl("Lab Test Results");
384 $widgetLabel = "labtestresults";
385 $widgetButtonLabel = xl("");
386 $widgetButtonClass = "hidden";
387 $linkMethod = "html";
388 $bodyClass = "notab";
391 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
392 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
393 $widgetAuth, $fixedWidth);
397 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
401 <?php
echo "<tr><td width='650px'>";
402 // problem list collapse widget
403 $widgetTitle = xl("Problem List");
404 $widgetLabel = "problemlist";
405 $widgetButtonLabel = xl("");
406 $widgetButtonClass = "hidden";
407 $linkMethod = "html";
408 $bodyClass = "notab";
411 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?
>
420 // medication list expand collapse widget
421 $widgetTitle = xl("Medication List");
422 $widgetLabel = "medicationlist";
423 $widgetButtonLabel = xl("");
424 $widgetButtonClass = "hidden";
425 $linkMethod = "html";
426 $bodyClass = "notab";
429 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
430 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
431 $widgetAuth, $fixedWidth);
434 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
441 <?php
// medication allergy expand collapse widget
442 $widgetTitle = xl("Medication Allergy List");
443 $widgetLabel = "medicationallergylist";
444 $widgetButtonLabel = xl("");
445 $widgetButtonClass = "";
446 $linkMethod = "html";
447 $bodyClass = "notab";
450 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
451 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
452 $widgetAuth, $fixedWidth);
455 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
463 // Show current and upcoming appointments.
464 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
465 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
467 "FROM openemr_postcalendar_events AS e, users AS u, " .
468 "openemr_postcalendar_categories AS c WHERE " .
469 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
470 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
471 "ORDER BY e.pc_eventDate, e.pc_startTime";
473 $res = sqlStatement($query, array($pid) );
475 // appointments expand collapse widget
476 $widgetTitle = xl("Appointments");
477 $widgetLabel = "appointments";
478 $widgetButtonLabel = xl("Add");
479 $widgetButtonLink = "add_edit_event_user.php?pid=".htmlspecialchars($pid, ENT_QUOTES
);
480 $widgetButtonClass = "edit_event iframe";
482 $bodyClass = "summary_item small";
483 if ($GLOBALS['portal_onsite_appt_modify']) {
491 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
496 <div id
='stats_div' style
="display:none">
497 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
>
511 </div
> <!-- end main content div
-->
513 <input type
="button" style
="text-align: right;" value
="<?php echo xl('Log Out'); ?>" onclick
="window.location = 'logout.php'">