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 )
19 //landing page definition -- where to go if something goes wrong
20 $landingpage = "index.php";
23 // kick out if patient not authenticated
25 if ( isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite']) ) {
26 $pid = $_SESSION['pid'];
30 header('Location: '.$landingpage.'?w');
38 require_once("../interface/globals.php");
39 require_once("$srcdir/patient.inc");
40 require_once("$srcdir/acl.inc");
41 require_once("$srcdir/classes/Address.class.php");
42 require_once("$srcdir/classes/InsuranceCompany.class.php");
43 require_once("$srcdir/classes/Document.class.php");
44 require_once("$srcdir/options.inc.php");
45 require_once("../interface/patient_file/history/history.inc.php");
46 require_once("$srcdir/formatting.inc.php");
47 require_once("$srcdir/edi.inc");
48 include_once("$srcdir/lists.inc");
54 <?php
html_header_show(); ?
>
55 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
56 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
57 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/dynarch_calendar.css">
58 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/textformat.js"></script
>
59 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dynarch_calendar.js"></script
>
60 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
61 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dynarch_calendar_setup.js"></script
>
62 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dialog.js"></script
>
63 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/jquery.1.3.2.js"></script
>
64 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/common.js"></script
>
65 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
66 <link rel
="stylesheet" href
="css/base.css" type
="text/css"/>
67 <link rel
="stylesheet" href
="css/tables.css" type
="text/css"/>
68 <script type
="text/javascript" language
="JavaScript">
70 function refreshme() {
74 function toggleIndicator(target
,div
) {
76 $mode = $
(target
).find(".indicator").text();
77 if ( $mode == "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" ) {
78 $
(target
).find(".indicator").text( "<?php echo htmlspecialchars(xl('expand'),ENT_QUOTES); ?>" );
81 $
(target
).find(".indicator").text( "<?php echo htmlspecialchars(xl('collapse'),ENT_QUOTES); ?>" );
86 function refreshAppointments() {
87 $
("#appointments_ps_expand").load("get_appointments.php", { 'embeddedScreen' : true }, function() {
88 $
(".edit_event").fancybox({
89 'overlayOpacity' : 0.0,
90 'showCloseButton' : true,
91 'centerOnScroll' : false,
93 'hihdeOnContentClick' : false,
94 'callbackOnClose' : function() {
95 refreshAppointments();
101 function show_date_fun(){
102 if(document
.getElementById('show_date').checked
== true){
103 document
.getElementById('date_div').style
.display
= '';
105 document
.getElementById('date_div').style
.display
= 'none';
110 $
(document
).ready(function(){
113 $
("#labtestresults_ps_expand").load("get_lab_results.php", { 'embeddedScreen' : true }, function() {
114 // (note need to place javascript code here also to get the dynamic link to work)
115 $
(".medium_modal").fancybox( {
116 'overlayOpacity' : 0.0,
117 'showCloseButton' : true,
120 'centerOnScroll' : false,
121 'callbackOnClose' : function() {
126 $
("#problemlist_ps_expand").load("get_problems.php", { 'embeddedScreen' : true }, function() {
127 // (note need to place javascript code here also to get the dynamic link to work)
128 $
(".medium_modal").fancybox( {
129 'overlayOpacity' : 0.0,
130 'showCloseButton' : true,
133 'centerOnScroll' : false,
134 'callbackOnClose' : function() {
139 $
("#medicationlist_ps_expand").load("get_medications.php", { 'embeddedScreen' : true }, function() {
140 // (note need to place javascript code here also to get the dynamic link to work)
141 $
(".medium_modal").fancybox( {
142 'overlayOpacity' : 0.0,
143 'showCloseButton' : true,
146 'centerOnScroll' : false,
147 'callbackOnClose' : function() {
152 $
("#medicationallergylist_ps_expand").load("get_allergies.php", { 'embeddedScreen' : true }, function() {
153 // (note need to place javascript code here also to get the dynamic link to work)
154 $
(".medium_modal").fancybox( {
155 'overlayOpacity' : 0.0,
156 'showCloseButton' : true,
159 'centerOnScroll' : false,
160 'callbackOnClose' : function() {
166 refreshAppointments();
171 // modal for dialog boxes
172 $
(".large_modal").fancybox( {
173 'overlayOpacity' : 0.0,
174 'showCloseButton' : true,
177 'centerOnScroll' : false
180 // modal for image viewer
181 $
(".image_modal").fancybox( {
182 'overlayOpacity' : 0.0,
183 'showCloseButton' : true,
184 'centerOnScroll' : false,
188 $
(".add_event").fancybox( {
189 'overlayOpacity' : 0.0,
190 'showCloseButton' : true,
191 'centerOnScroll' : false,
193 'hideOnContentClick' : false,
194 'onClose' : function() {
199 $
(".generateCCR").click(
201 if(document
.getElementById('show_date').checked
== true){
202 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
203 alert('<?php echo addslashes( xl('Please select a start date
and end date
')) ?>');
207 var ccrAction
= document
.getElementsByName('ccrAction');
208 ccrAction
[0].value
= 'generate';
209 var raw
= document
.getElementsByName('raw');
211 ccr_form
.setAttribute("target", "_blank");
212 $
("#ccr_form").submit();
213 ccr_form
.setAttribute("target", "");
215 $
(".generateCCR_raw").click(
217 var ccrAction
= document
.getElementsByName('ccrAction');
218 ccrAction
[0].value
= 'generate';
219 var raw
= document
.getElementsByName('raw');
220 raw
[0].value
= 'yes';
221 ccr_form
.setAttribute("target", "_blank");
222 $
("#ccr_form").submit();
223 ccr_form
.setAttribute("target", "");
225 $
(".generateCCR_download_h").click(
227 var ccrAction
= document
.getElementsByName('ccrAction');
228 ccrAction
[0].value
= 'generate';
229 var raw
= document
.getElementsByName('raw');
230 raw
[0].value
= 'hybrid';
231 $
("#ccr_form").submit();
233 $
(".generateCCR_download_p").click(
235 if(document
.getElementById('show_date').checked
== true){
236 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
237 alert('<?php echo addslashes( xl('Please select a start date
and end date
')) ?>');
241 var ccrAction
= document
.getElementsByName('ccrAction');
242 ccrAction
[0].value
= 'generate';
243 var raw
= document
.getElementsByName('raw');
244 raw
[0].value
= 'pure';
245 $
("#ccr_form").submit();
249 var ccrAction
= document
.getElementsByName('ccrAction');
250 ccrAction
[0].value
= 'viewccd';
251 var raw
= document
.getElementsByName('raw');
253 ccr_form
.setAttribute("target", "_blank");
254 $
("#ccr_form").submit();
255 ccr_form
.setAttribute("target", "");
257 $
(".viewCCD_raw").click(
259 var ccrAction
= document
.getElementsByName('ccrAction');
260 ccrAction
[0].value
= 'viewccd';
261 var raw
= document
.getElementsByName('raw');
262 raw
[0].value
= 'yes';
263 ccr_form
.setAttribute("target", "_blank");
264 $
("#ccr_form").submit();
265 ccr_form
.setAttribute("target", "");
274 <body
class="body_top">
276 <div id
="wrapper" class="lefttop" style
="width: 700px;">
277 <h2
class="heading"><?php
echo htmlspecialchars( xl('Patient Portal'), ENT_NOQUOTES
); ?
></h2
>
280 $result = getPatientData($pid);
282 <?php
echo htmlspecialchars( xl('Welcome'), ENT_NOQUOTES
); ?
> <b
><?php
echo htmlspecialchars($result['fname']." ".$result['lname'],ENT_NOQUOTES
); ?
></b
>
284 <div style
='margin-top:10px'> <!-- start main content div
-->
285 <table border
="0" cellspacing
="0" cellpadding
="0" width
="100%">
287 <td align
="left" valign
="top">
288 <!-- start left column div
-->
289 <div style
='float:left; margin-right:20px'>
290 <table cellspacing
=0 cellpadding
=0>
291 <?php
if ( $GLOBALS['activate_ccr_ccd_report'] ) { // show CCR/CCD reporting options ?>
296 $widgetTitle = xl("Reports");
297 $widgetLabel = "reports";
298 $widgetButtonLabel = xl("");
299 $widgetButtonClass = "hidden";
300 $linkMethod = "html";
301 $bodyClass = "notab";
304 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
305 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
306 $widgetAuth, $fixedWidth);
309 <div style
='margin-left:3em; margin-right:3em; padding:1em; border:1px solid blue;' class='text'>
310 <div id
="ccr_report">
311 <form name
='ccr_form' id
='ccr_form' method
='post' action
='../ccr/createCCR.php?portal_auth=1'>
312 <span
class='text'><b
><?php
echo htmlspecialchars( xl('Continuity of Care Record (CCR)'), ENT_NOQUOTES
); ?
></b
></span
> 
; 
;
314 <span
class='text'>(<?php
echo htmlspecialchars( xl('Pop ups need to be enabled to see these reports'), ENT_NOQUOTES
); ?
>)</span
>
317 <input type
='hidden' name
='ccrAction'>
318 <input type
='hidden' name
='raw'>
319 <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
); ?
>
321 <div id
="date_div" style
="display:none" >
323 <table border
="0" cellpadding
="0" cellspacing
="0" >
326 <span
class='bold'><?php
echo htmlspecialchars( xl('Start Date'), ENT_NOQUOTES
);?
>: </span
>
329 <input type
='text' size
='10' name
='Start' id
='Start'
330 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
331 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>' />
332 <img src
='../interface/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
333 id
='img_start' border
='0' alt
='[?]' style
='cursor:pointer'
334 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>' >
335 <script LANGUAGE
="JavaScript">
336 Calendar
.setup({inputField
:"Start", ifFormat
:"%Y-%m-%d", button
:"img_start"});
341 <span
class='bold'><?php
echo htmlspecialchars( xl('End Date'), ENT_NOQUOTES
);?
>: </span
>
344 <input type
='text' size
='10' name
='End' id
='End'
345 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
346 title
='<?php echo htmlspecialchars( xl('yyyy
-mm
-dd
'), ENT_QUOTES); ?>' />
347 <img src
='../interface/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
348 id
='img_end' border
='0' alt
='[?]' style
='cursor:pointer'
349 title
='<?php echo htmlspecialchars( xl('Click here to choose a date
'), ENT_QUOTES); ?>' >
350 <script LANGUAGE
="JavaScript">
351 Calendar
.setup({inputField
:"End", ifFormat
:"%Y-%m-%d", button
:"img_end"});
358 <input type
="button" class="generateCCR" value
="<?php echo htmlspecialchars( xl('View/Print'), ENT_QUOTES); ?>" />
359 <!-- <input type
="button" class="generateCCR_download_h" value
="<?php echo htmlspecialchars( xl('Download'), ENT_QUOTES); ?>" /> -->
360 <input type
="button" class="generateCCR_download_p" value
="<?php echo htmlspecialchars( xl('Download'), ENT_QUOTES); ?>" />
361 <!-- <input type
="button" class="generateCCR_raw" value
="<?php echo htmlspecialchars( xl('Raw Report'), ENT_QUOTES); ?>" /> -->
363 <span
class='text'><b
><?php
echo htmlspecialchars( xl('Continuity of Care Document (CCD)'), ENT_NOQUOTES
); ?
></b
></span
> 
; 
;
365 <span
class='text'>(<?php
echo htmlspecialchars( xl('Pop ups need to be enabled to see these reports'), ENT_NOQUOTES
); ?
>)</span
>
368 <input type
="button" class="viewCCD" value
="<?php echo htmlspecialchars( xl('View/Print', ENT_QUOTES)); ?>" />
369 <!-- <input type
="button" class="viewCCD_raw" value
="<?php echo htmlspecialchars( xl('Raw Report', ENT_QUOTES)); ?>" /> -->
377 <?php
} // end CCR/CCD reporting options ?>
379 <?php
echo "<tr><td width='650px'>";
380 // Lab tests results expand collapse widget
381 $widgetTitle = xl("Lab Test Results");
382 $widgetLabel = "labtestresults";
383 $widgetButtonLabel = xl("");
384 $widgetButtonClass = "hidden";
385 $linkMethod = "html";
386 $bodyClass = "notab";
389 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
390 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
391 $widgetAuth, $fixedWidth);
395 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
399 <?php
echo "<tr><td width='650px'>";
400 // problem list collapse widget
401 $widgetTitle = xl("Problem List");
402 $widgetLabel = "problemlist";
403 $widgetButtonLabel = xl("");
404 $widgetButtonClass = "hidden";
405 $linkMethod = "html";
406 $bodyClass = "notab";
409 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?
>
418 // medication list expand collapse widget
419 $widgetTitle = xl("Medication List");
420 $widgetLabel = "medicationlist";
421 $widgetButtonLabel = xl("");
422 $widgetButtonClass = "hidden";
423 $linkMethod = "html";
424 $bodyClass = "notab";
427 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
428 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
429 $widgetAuth, $fixedWidth);
432 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
439 <?php
// medication allergy expand collapse widget
440 $widgetTitle = xl("Medication Allergy List");
441 $widgetLabel = "medicationallergylist";
442 $widgetButtonLabel = xl("");
443 $widgetButtonClass = "";
444 $linkMethod = "html";
445 $bodyClass = "notab";
448 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel,
449 $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass,
450 $widgetAuth, $fixedWidth);
453 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
461 // Show current and upcoming appointments.
462 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
463 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
465 "FROM openemr_postcalendar_events AS e, users AS u, " .
466 "openemr_postcalendar_categories AS c WHERE " .
467 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
468 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
469 "ORDER BY e.pc_eventDate, e.pc_startTime";
471 $res = sqlStatement($query, array($pid) );
473 // appointments expand collapse widget
474 $widgetTitle = xl("Appointments");
475 $widgetLabel = "appointments";
476 $widgetButtonLabel = xl("Add");
477 $widgetButtonLink = "add_edit_event_user.php?pid=".htmlspecialchars($pid, ENT_QUOTES
);
478 $widgetButtonClass = "edit_event iframe";
480 $bodyClass = "summary_item small";
481 if ($GLOBALS['portal_onsite_appt_modify']) {
489 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel , $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
494 <div id
='stats_div' style
="display:none">
495 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
>
509 </div
> <!-- end main content div
-->
511 <input type
="button" style
="text-align: right;" value
="<? echo xl('Log Out'); ?>" onclick
="window.location = 'logout.php'">