6 * @link http://www.open-emr.org
7 * @author Cassian LUP <cassi.lup@gmail.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2011 Cassian LUP <cassi.lup@gmail.com>
10 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
17 //landing page definition -- where to go if something goes wrong
18 $landingpage = "index.php?site=".$_SESSION['site_id'];
21 // kick out if patient not authenticated
22 if (isset($_SESSION['pid']) && isset($_SESSION['patient_portal_onsite'])) {
23 $pid = $_SESSION['pid'];
26 header('Location: '.$landingpage.'&w');
35 require_once("../interface/globals.php");
36 require_once("$srcdir/patient.inc");
37 require_once("$srcdir/acl.inc");
38 require_once("$srcdir/options.inc.php");
39 require_once("../interface/patient_file/history/history.inc.php");
40 require_once("$srcdir/edi.inc");
41 require_once("$srcdir/lists.inc");
46 <title
><?php
echo xlt('Patient Information'); ?
></title
>
47 <?php
html_header_show(); ?
>
48 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
49 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
50 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
52 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
53 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
54 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-7-2/index.js"></script
>
55 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/common.js?v=<?php echo $v_js_includes; ?>"></script
>
56 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
57 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
59 <link rel
="stylesheet" href
="css/base.css" type
="text/css"/>
60 <link rel
="stylesheet" href
="css/tables.css" type
="text/css"/>
61 <script type
="text/javascript" language
="JavaScript">
63 function refreshme() {
67 function toggleIndicator(target
,div
) {
69 $mode = $
(target
).find(".indicator").text();
70 if ( $mode == "<?php echo xla('collapse'); ?>" ) {
71 $
(target
).find(".indicator").text( "<?php echo xla('expand'); ?>" );
74 $
(target
).find(".indicator").text( "<?php echo xla('collapse'); ?>" );
79 function refreshAppointments() {
80 $
("#appointments_ps_expand").load("get_appointments.php", { 'embeddedScreen' : true }, function() {
81 $
(".edit_event").fancybox({
82 'overlayOpacity' : 0.0,
83 'showCloseButton' : true,
84 'centerOnScroll' : false,
86 'hihdeOnContentClick' : false,
87 'callbackOnClose' : function() {
88 refreshAppointments();
94 function show_date_fun(){
95 if(document
.getElementById('show_date').checked
== true){
96 document
.getElementById('date_div').style
.display
= '';
98 document
.getElementById('date_div').style
.display
= 'none';
103 $
(document
).ready(function(){
106 $
("#labtestresults_ps_expand").load("get_lab_results.php", { 'embeddedScreen' : true }, function() {
107 // (note need to place javascript code here also to get the dynamic link to work)
108 $
(".medium_modal").fancybox( {
109 'overlayOpacity' : 0.0,
110 'showCloseButton' : true,
113 'centerOnScroll' : false,
114 'callbackOnClose' : function() {
119 $
("#problemlist_ps_expand").load("get_problems.php", { 'embeddedScreen' : true }, function() {
120 // (note need to place javascript code here also to get the dynamic link to work)
121 $
(".medium_modal").fancybox( {
122 'overlayOpacity' : 0.0,
123 'showCloseButton' : true,
126 'centerOnScroll' : false,
127 'callbackOnClose' : function() {
132 $
("#medicationlist_ps_expand").load("get_medications.php", { 'embeddedScreen' : true }, function() {
133 // (note need to place javascript code here also to get the dynamic link to work)
134 $
(".medium_modal").fancybox( {
135 'overlayOpacity' : 0.0,
136 'showCloseButton' : true,
139 'centerOnScroll' : false,
140 'callbackOnClose' : function() {
145 $
("#medicationallergylist_ps_expand").load("get_allergies.php", { 'embeddedScreen' : true }, function() {
146 // (note need to place javascript code here also to get the dynamic link to work)
147 $
(".medium_modal").fancybox( {
148 'overlayOpacity' : 0.0,
149 'showCloseButton' : true,
152 'centerOnScroll' : false,
153 'callbackOnClose' : function() {
158 $
("#amendments_ps_expand").load("get_amendments.php", { 'embeddedScreen' : true }, function() {
159 // (note need to place javascript code here also to get the dynamic link to work)
160 $
(".medium_modal").fancybox( {
161 'overlayOpacity' : 0.0,
162 'showCloseButton' : true,
165 'centerOnScroll' : false,
166 'callbackOnClose' : function() {
173 refreshAppointments();
178 // modal for dialog boxes
179 $
(".large_modal").fancybox( {
180 'overlayOpacity' : 0.0,
181 'showCloseButton' : true,
184 'centerOnScroll' : false
187 // modal for image viewer
188 $
(".image_modal").fancybox( {
189 'overlayOpacity' : 0.0,
190 'showCloseButton' : true,
191 'centerOnScroll' : false,
195 $
(".add_event").fancybox( {
196 'overlayOpacity' : 0.0,
197 'showCloseButton' : true,
198 'centerOnScroll' : false,
200 'hideOnContentClick' : false,
201 'onClose' : function() {
206 $
(".generateCCR").click(
208 if(document
.getElementById('show_date').checked
== true){
209 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
210 alert('<?php echo xls('Please select a start date
and end date
') ?>');
214 var ccrAction
= document
.getElementsByName('ccrAction');
215 ccrAction
[0].value
= 'generate';
216 var raw
= document
.getElementsByName('raw');
218 ccr_form
.setAttribute("target", "_blank");
219 $
("#ccr_form").submit();
220 ccr_form
.setAttribute("target", "");
222 $
(".generateCCR_raw").click(
224 var ccrAction
= document
.getElementsByName('ccrAction');
225 ccrAction
[0].value
= 'generate';
226 var raw
= document
.getElementsByName('raw');
227 raw
[0].value
= 'yes';
228 ccr_form
.setAttribute("target", "_blank");
229 $
("#ccr_form").submit();
230 ccr_form
.setAttribute("target", "");
232 $
(".generateCCR_download_h").click(
234 var ccrAction
= document
.getElementsByName('ccrAction');
235 ccrAction
[0].value
= 'generate';
236 var raw
= document
.getElementsByName('raw');
237 raw
[0].value
= 'hybrid';
238 $
("#ccr_form").submit();
240 $
(".generateCCR_download_p").click(
242 if(document
.getElementById('show_date').checked
== true){
243 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
244 alert('<?php echo xls('Please select a start date
and end date
') ?>');
248 var ccrAction
= document
.getElementsByName('ccrAction');
249 ccrAction
[0].value
= 'generate';
250 var raw
= document
.getElementsByName('raw');
251 raw
[0].value
= 'pure';
252 $
("#ccr_form").submit();
256 var ccrAction
= document
.getElementsByName('ccrAction');
257 ccrAction
[0].value
= 'viewccd';
258 var raw
= document
.getElementsByName('raw');
260 ccr_form
.setAttribute("target", "_blank");
261 $
("#ccr_form").submit();
262 ccr_form
.setAttribute("target", "");
264 $
(".viewCCD_raw").click(
266 var ccrAction
= document
.getElementsByName('ccrAction');
267 ccrAction
[0].value
= 'viewccd';
268 var raw
= document
.getElementsByName('raw');
269 raw
[0].value
= 'yes';
270 ccr_form
.setAttribute("target", "_blank");
271 $
("#ccr_form").submit();
272 ccr_form
.setAttribute("target", "");
274 $
(".viewCCD_download").click(
276 var ccrAction
= document
.getElementsByName('ccrAction');
277 ccrAction
[0].value
= 'viewccd';
278 var raw
= document
.getElementsByName('raw');
279 raw
[0].value
= 'pure';
280 $
("#ccr_form").submit();
282 $
(".generateDoc_download").click(
284 $
("#doc_form").submit();
286 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccr_enable']==true) { ?
>
287 $
(".viewCCR_send_dialog").click(
289 $
("#ccr_send_dialog").toggle();
291 $
(".viewCCR_transmit").click(
293 $
(".viewCCR_transmit").attr('disabled','disabled');
294 var ccrAction
= document
.getElementsByName('ccrAction');
295 ccrAction
[0].value
= 'generate';
296 var ccrRecipient
= $
("#ccr_send_to").val();
297 var raw
= document
.getElementsByName('raw');
298 raw
[0].value
= 'send '+ccrRecipient
;
299 if(ccrRecipient
=="") {
300 $
("#ccr_send_message").html("<?php
301 echo xla('Please enter a valid Direct Address above.');?>");
302 $
("#ccr_send_result").show();
304 $
(".viewCCR_transmit").attr('disabled','disabled');
305 $
("#ccr_send_message").html("<?php
306 echo xla('Working... this may take a minute.');?>");
307 $
("#ccr_send_result").show();
308 var action
=$
("#ccr_form").attr('action');
309 $
.post(action
, {ccrAction
:'generate',raw
:'send '+ccrRecipient
,requested_by
:'patient'},
311 if(data
=="SUCCESS") {
312 $
("#ccr_send_message").html("<?php
313 echo xla('Your message was submitted for delivery to');
315 $
("#ccr_send_to").val("");
317 $
("#ccr_send_message").html(data
);
319 $
(".viewCCR_transmit").removeAttr('disabled');
325 if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccd_enable']==true) { ?
>
326 $
(".viewCCD_send_dialog").click(
328 $
("#ccd_send_dialog").toggle();
330 $
(".viewCCD_transmit").click(
332 $
(".viewCCD_transmit").attr('disabled','disabled');
333 var ccrAction
= document
.getElementsByName('ccrAction');
334 ccrAction
[0].value
= 'viewccd';
335 var ccdRecipient
= $
("#ccd_send_to").val();
336 var raw
= document
.getElementsByName('raw');
337 raw
[0].value
= 'send '+ccdRecipient
;
338 if(ccdRecipient
=="") {
339 $
("#ccd_send_message").html("<?php
340 echo xla('Please enter a valid Direct Address above.');?>");
341 $
("#ccd_send_result").show();
343 $
(".viewCCD_transmit").attr('disabled','disabled');
344 $
("#ccd_send_message").html("<?php
345 echo xla('Working... this may take a minute.');?>");
346 $
("#ccd_send_result").show();
347 var action
=$
("#ccr_form").attr('action');
348 $
.post(action
, {ccrAction
:'viewccd',raw
:'send '+ccdRecipient
,requested_by
:'patient'},
350 if(data
=="SUCCESS") {
351 $
("#ccd_send_message").html("<?php
352 echo xla('Your message was submitted for delivery to');
354 $
("#ccd_send_to").val("");
356 $
("#ccd_send_message").html(data
);
358 $
(".viewCCD_transmit").removeAttr('disabled');
364 $
('.datepicker').datetimepicker({
365 <?php
$datetimepicker_timepicker = false; ?
>
366 <?php
$datetimepicker_showseconds = false; ?
>
367 <?php
$datetimepicker_formatInput = false; ?
>
368 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
369 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
377 <body
class="body_top">
379 <div id
="wrapper" class="lefttop" style
="width: 700px;">
380 <h2
class="heading"><?php
echo xlt("Patient Portal"); ?
></h2
>
383 $result = getPatientData($pid);
385 <?php
echo xlt('Welcome'); ?
> <b
><?php
echo text($result['fname']." ".$result['lname']); ?
></b
>
387 <div style
='margin-top:10px'> <!-- start main content div
-->
388 <table border
="0" cellspacing
="0" cellpadding
="0" width
="100%">
390 <td align
="left" valign
="top">
391 <!-- start left column div
-->
392 <div style
='float:left; margin-right:20px'>
393 <table cellspacing
=0 cellpadding
=0>
394 <?php
if ($GLOBALS['activate_ccr_ccd_report']) { // show CCR/CCD reporting options ?>
399 $widgetTitle = xl("Reports");
400 $widgetLabel = "reports";
401 $widgetButtonLabel = xl("");
402 $widgetButtonClass = "hidden";
403 $linkMethod = "html";
404 $bodyClass = "notab";
407 expand_collapse_widget(
420 <div style
='margin-left:3em; margin-right:3em; padding:1em; border:1px solid blue;' class='text'>
421 <div id
="ccr_report">
422 <form name
='ccr_form' id
='ccr_form' method
='post' action
='../ccr/createCCR.php?portal_auth=1'>
423 <span
class='text'><b
><?php
echo xlt('Continuity of Care Record (CCR)'); ?
></b
></span
> 
; 
;
425 <span
class='text'>(<?php
echo xlt('Pop ups need to be enabled to see these reports'); ?
>)</span
>
428 <input type
='hidden' name
='ccrAction'>
429 <input type
='hidden' name
='raw'>
430 <input type
="checkbox" name
="show_date" id
="show_date" onchange
="show_date_fun();" ><span
class='text'><?php
echo xlt('Use Date Range'); ?
>
432 <div id
="date_div" style
="display:none" >
434 <table border
="0" cellpadding
="0" cellspacing
="0" >
437 <span
class='bold'><?php
echo xlt('Start Date');?
>: </span
>
440 <input type
='text' size
='10' class='datepicker' name
='Start' id
='Start'
441 title
='<?php echo xla('yyyy
-mm
-dd
'); ?>' />
445 <span
class='bold'><?php
echo xlt('End Date');?
>: </span
>
448 <input type
='text' class='datepicker' size
='10' name
='End' id
='End'
449 title
='<?php echo xla('yyyy
-mm
-dd
'); ?>' />
455 <input type
="button" class="generateCCR" value
="<?php echo xla('View/Print'); ?>" />
456 <!-- <input type
="button" class="generateCCR_download_h" value
="<?php echo xla('Download'); ?>" /> -->
457 <input type
="button" class="generateCCR_download_p" value
="<?php echo xla('Download'); ?>" />
458 <!-- <input type
="button" class="generateCCR_raw" value
="<?php echo xla('Raw Report'); ?>" /> -->
459 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccr_enable']==true) { ?
>
460 <input type
="button" class="viewCCR_send_dialog" value
="<?php echo xla('Transmit'); ?>" />
462 <div id
="ccr_send_dialog" style
="display:none" >
464 <table border
="0" cellpadding
="0" cellspacing
="0" >
467 <span
class='bold'><?php
echo xlt('Enter Recipient\'s Direct Address');?
>: </span
>
468 <input type
="text" size
="64" name
="ccr_send_to" id
="ccr_send_to" value
="">
469 <input type
="button" class="viewCCR_transmit" value
="<?php echo xla('Send'); ?>" />
470 <div id
="ccr_send_result" style
="display:none" >
471 <span
class="text" id
="ccr_send_message"></span
>
479 <span
class='text'><b
><?php
echo xlt('Continuity of Care Document (CCD)'); ?
></b
></span
> 
; 
;
481 <span
class='text'>(<?php
echo xlt('Pop ups need to be enabled to see these reports'); ?
>)</span
>
484 <input type
="button" class="viewCCD" value
="<?php echo xla('View/Print'); ?>" />
485 <input type
="button" class="viewCCD_download" value
="<?php echo xla('Download'); ?>" />
486 <!-- <input type
="button" class="viewCCD_raw" value
="<?php echo xla('Raw Report'); ?>" /> -->
487 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccd_enable']==true) { ?
>
488 <input type
="button" class="viewCCD_send_dialog" value
="<?php echo xla('Transmit'); ?>" />
490 <div id
="ccd_send_dialog" style
="display:none" >
492 <table border
="0" cellpadding
="0" cellspacing
="0" >
495 <span
class='bold'><?php
echo xlt('Enter Recipient\'s Direct Address');?
>: </span
>
496 <input type
="text" size
="64" name
="ccd_send_to" id
="ccd_send_to" value
="">
497 <input type
="button" class="viewCCD_transmit" value
="<?php echo xla('Send'); ?>" />
498 <div id
="ccd_send_result" style
="display:none" >
499 <span
class="text" id
="ccd_send_message"></span
>
514 <?php
} // end CCR/CCD reporting options ?>
515 <?php
if ($GLOBALS['portal_onsite_document_download']) { ?
>
516 <?php
echo "<tr><td width='650px'>";
517 $widgetTitle = xl('Documents');
518 $widgetLabel = "documents";
519 $widgetButtonLabel = xl('Download');
520 $widgetButtonClass = "hidden";
521 $linkMethod = "html";
522 $bodyClass = "notab";
525 expand_collapse_widget(
537 <span
class="text"><?php
echo xlt('Download all patient documents');?
></span
>
539 <form name
='doc_form' id
='doc_form' action
='get_patient_documents.php' method
='post'>
540 <input type
="button" class="generateDoc_download" value
="<?php echo xla('Download'); ?>" />
546 <?php
echo "<tr><td width='650px'>";
547 // Lab tests results expand collapse widget
548 $widgetTitle = xl("Lab Test Results");
549 $widgetLabel = "labtestresults";
550 $widgetButtonLabel = xl("");
551 $widgetButtonClass = "hidden";
552 $linkMethod = "html";
553 $bodyClass = "notab";
556 expand_collapse_widget(
570 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
575 <?php
echo "<tr><td width='650px'>";
576 // problem list collapse widget
577 $widgetTitle = xl("Problem List");
578 $widgetLabel = "problemlist";
579 $widgetButtonLabel = xl("");
580 $widgetButtonClass = "hidden";
581 $linkMethod = "html";
582 $bodyClass = "notab";
585 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?
>
596 // medication list expand collapse widget
597 $widgetTitle = xl("Medication List");
598 $widgetLabel = "medicationlist";
599 $widgetButtonLabel = xl("");
600 $widgetButtonClass = "hidden";
601 $linkMethod = "html";
602 $bodyClass = "notab";
605 expand_collapse_widget(
618 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
626 <?php
// medication allergy expand collapse widget
627 $widgetTitle = xl("Medication Allergy List");
628 $widgetLabel = "medicationallergylist";
629 $widgetButtonLabel = xl("");
630 $widgetButtonClass = "";
631 $linkMethod = "html";
632 $bodyClass = "notab";
635 expand_collapse_widget(
648 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
655 <?php
if ($GLOBALS['amendments']) { ?
>
659 $widgetTitle = xl("Amendments");
660 $widgetLabel = "amendments";
661 $widgetButtonLabel = xl("");
662 $widgetButtonClass = "hidden";
663 $linkMethod = "html";
664 $bodyClass = "notab";
667 expand_collapse_widget(
681 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
688 // Show current and upcoming appointments.
689 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
690 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
692 "FROM openemr_postcalendar_events AS e, users AS u, " .
693 "openemr_postcalendar_categories AS c WHERE " .
694 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
695 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
696 "ORDER BY e.pc_eventDate, e.pc_startTime";
698 $res = sqlStatement($query, array($pid));
700 // appointments expand collapse widget
701 $widgetTitle = xl("Appointments");
702 $widgetLabel = "appointments";
703 $widgetButtonLabel = xl("Add");
704 $widgetButtonLink = "add_edit_event_user.php?pid=".htmlspecialchars($pid, ENT_QUOTES
);
705 $widgetButtonClass = "edit_event iframe";
707 $bodyClass = "summary_item small";
708 if ($GLOBALS['portal_onsite_appt_modify']) {
715 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
718 <div id
='stats_div' style
="display:none">
719 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
>
733 </div
> <!-- end main content div
-->
735 <div id
="portal-buttons-bottom"> <!-- buttons bottom div
-->
736 <input type
="button" style
="text-align: right;" value
="<?php echo xla('Log Out'); ?>" onclick
="window.location = 'logout.php'"/>
738 <input type
="button" style
="text-align: right;" value
="<?php echo xla('Change Password'); ?>" onclick
="window.location = '<?php echo $landingpage."&password_update
=1";?>'"/>
739 </div
><!-- end buttons bottom div
-->