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'];
31 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/options.inc.php");
44 require_once("../interface/patient_file/history/history.inc.php");
45 require_once("$srcdir/edi.inc");
46 include_once("$srcdir/lists.inc");
51 <title
><?php
echo xlt('Patient Information'); ?
></title
>
52 <?php
html_header_show(); ?
>
53 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
54 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
55 <link rel
="stylesheet" type
="text/css" href
="<?php echo $web_root; ?>/library/dynarch_calendar.css">
56 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/textformat.js"></script
>
57 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dynarch_calendar.js"></script
>
58 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
59 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dynarch_calendar_setup.js"></script
>
60 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
61 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-3-2/index.js"></script
>
62 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/common.js"></script
>
63 <script type
="text/javascript" src
="<?php echo $web_root; ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
64 <link rel
="stylesheet" href
="css/base.css" type
="text/css"/>
65 <link rel
="stylesheet" href
="css/tables.css" type
="text/css"/>
66 <script type
="text/javascript" language
="JavaScript">
68 function refreshme() {
72 function toggleIndicator(target
,div
) {
74 $mode = $
(target
).find(".indicator").text();
75 if ( $mode == "<?php echo xla('collapse'); ?>" ) {
76 $
(target
).find(".indicator").text( "<?php echo xla('expand'); ?>" );
79 $
(target
).find(".indicator").text( "<?php echo xla('collapse'); ?>" );
84 function refreshAppointments() {
85 $
("#appointments_ps_expand").load("get_appointments.php", { 'embeddedScreen' : true }, function() {
86 $
(".edit_event").fancybox({
87 'overlayOpacity' : 0.0,
88 'showCloseButton' : true,
89 'centerOnScroll' : false,
91 'hihdeOnContentClick' : false,
92 'callbackOnClose' : function() {
93 refreshAppointments();
99 function show_date_fun(){
100 if(document
.getElementById('show_date').checked
== true){
101 document
.getElementById('date_div').style
.display
= '';
103 document
.getElementById('date_div').style
.display
= 'none';
108 $
(document
).ready(function(){
111 $
("#labtestresults_ps_expand").load("get_lab_results.php", { 'embeddedScreen' : true }, function() {
112 // (note need to place javascript code here also to get the dynamic link to work)
113 $
(".medium_modal").fancybox( {
114 'overlayOpacity' : 0.0,
115 'showCloseButton' : true,
118 'centerOnScroll' : false,
119 'callbackOnClose' : function() {
124 $
("#problemlist_ps_expand").load("get_problems.php", { 'embeddedScreen' : true }, function() {
125 // (note need to place javascript code here also to get the dynamic link to work)
126 $
(".medium_modal").fancybox( {
127 'overlayOpacity' : 0.0,
128 'showCloseButton' : true,
131 'centerOnScroll' : false,
132 'callbackOnClose' : function() {
137 $
("#medicationlist_ps_expand").load("get_medications.php", { 'embeddedScreen' : true }, function() {
138 // (note need to place javascript code here also to get the dynamic link to work)
139 $
(".medium_modal").fancybox( {
140 'overlayOpacity' : 0.0,
141 'showCloseButton' : true,
144 'centerOnScroll' : false,
145 'callbackOnClose' : function() {
150 $
("#medicationallergylist_ps_expand").load("get_allergies.php", { 'embeddedScreen' : true }, function() {
151 // (note need to place javascript code here also to get the dynamic link to work)
152 $
(".medium_modal").fancybox( {
153 'overlayOpacity' : 0.0,
154 'showCloseButton' : true,
157 'centerOnScroll' : false,
158 'callbackOnClose' : function() {
163 $
("#amendments_ps_expand").load("get_amendments.php", { 'embeddedScreen' : true }, function() {
164 // (note need to place javascript code here also to get the dynamic link to work)
165 $
(".medium_modal").fancybox( {
166 'overlayOpacity' : 0.0,
167 'showCloseButton' : true,
170 'centerOnScroll' : false,
171 'callbackOnClose' : function() {
178 refreshAppointments();
183 // modal for dialog boxes
184 $
(".large_modal").fancybox( {
185 'overlayOpacity' : 0.0,
186 'showCloseButton' : true,
189 'centerOnScroll' : false
192 // modal for image viewer
193 $
(".image_modal").fancybox( {
194 'overlayOpacity' : 0.0,
195 'showCloseButton' : true,
196 'centerOnScroll' : false,
200 $
(".add_event").fancybox( {
201 'overlayOpacity' : 0.0,
202 'showCloseButton' : true,
203 'centerOnScroll' : false,
205 'hideOnContentClick' : false,
206 'onClose' : function() {
211 $
(".generateCCR").click(
213 if(document
.getElementById('show_date').checked
== true){
214 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
215 alert('<?php echo xls('Please select a start date
and end date
') ?>');
219 var ccrAction
= document
.getElementsByName('ccrAction');
220 ccrAction
[0].value
= 'generate';
221 var raw
= document
.getElementsByName('raw');
223 ccr_form
.setAttribute("target", "_blank");
224 $
("#ccr_form").submit();
225 ccr_form
.setAttribute("target", "");
227 $
(".generateCCR_raw").click(
229 var ccrAction
= document
.getElementsByName('ccrAction');
230 ccrAction
[0].value
= 'generate';
231 var raw
= document
.getElementsByName('raw');
232 raw
[0].value
= 'yes';
233 ccr_form
.setAttribute("target", "_blank");
234 $
("#ccr_form").submit();
235 ccr_form
.setAttribute("target", "");
237 $
(".generateCCR_download_h").click(
239 var ccrAction
= document
.getElementsByName('ccrAction');
240 ccrAction
[0].value
= 'generate';
241 var raw
= document
.getElementsByName('raw');
242 raw
[0].value
= 'hybrid';
243 $
("#ccr_form").submit();
245 $
(".generateCCR_download_p").click(
247 if(document
.getElementById('show_date').checked
== true){
248 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
249 alert('<?php echo xls('Please select a start date
and end date
') ?>');
253 var ccrAction
= document
.getElementsByName('ccrAction');
254 ccrAction
[0].value
= 'generate';
255 var raw
= document
.getElementsByName('raw');
256 raw
[0].value
= 'pure';
257 $
("#ccr_form").submit();
261 var ccrAction
= document
.getElementsByName('ccrAction');
262 ccrAction
[0].value
= 'viewccd';
263 var raw
= document
.getElementsByName('raw');
265 ccr_form
.setAttribute("target", "_blank");
266 $
("#ccr_form").submit();
267 ccr_form
.setAttribute("target", "");
269 $
(".viewCCD_raw").click(
271 var ccrAction
= document
.getElementsByName('ccrAction');
272 ccrAction
[0].value
= 'viewccd';
273 var raw
= document
.getElementsByName('raw');
274 raw
[0].value
= 'yes';
275 ccr_form
.setAttribute("target", "_blank");
276 $
("#ccr_form").submit();
277 ccr_form
.setAttribute("target", "");
279 $
(".viewCCD_download").click(
281 var ccrAction
= document
.getElementsByName('ccrAction');
282 ccrAction
[0].value
= 'viewccd';
283 var raw
= document
.getElementsByName('raw');
284 raw
[0].value
= 'pure';
285 $
("#ccr_form").submit();
287 $
(".generateDoc_download").click(
289 $
("#doc_form").submit();
291 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccr_enable']==true) { ?
>
292 $
(".viewCCR_send_dialog").click(
294 $
("#ccr_send_dialog").toggle();
296 $
(".viewCCR_transmit").click(
298 $
(".viewCCR_transmit").attr('disabled','disabled');
299 var ccrAction
= document
.getElementsByName('ccrAction');
300 ccrAction
[0].value
= 'generate';
301 var ccrRecipient
= $
("#ccr_send_to").val();
302 var raw
= document
.getElementsByName('raw');
303 raw
[0].value
= 'send '+ccrRecipient
;
304 if(ccrRecipient
=="") {
305 $
("#ccr_send_message").html("<?php
306 echo xla('Please enter a valid Direct Address above.');?>");
307 $
("#ccr_send_result").show();
309 $
(".viewCCR_transmit").attr('disabled','disabled');
310 $
("#ccr_send_message").html("<?php
311 echo xla('Working... this may take a minute.');?>");
312 $
("#ccr_send_result").show();
313 var action
=$
("#ccr_form").attr('action');
314 $
.post(action
, {ccrAction
:'generate',raw
:'send '+ccrRecipient
,requested_by
:'patient'},
316 if(data
=="SUCCESS") {
317 $
("#ccr_send_message").html("<?php
318 echo xla('Your message was submitted for delivery to');
320 $
("#ccr_send_to").val("");
322 $
("#ccr_send_message").html(data
);
324 $
(".viewCCR_transmit").removeAttr('disabled');
330 if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccd_enable']==true) { ?
>
331 $
(".viewCCD_send_dialog").click(
333 $
("#ccd_send_dialog").toggle();
335 $
(".viewCCD_transmit").click(
337 $
(".viewCCD_transmit").attr('disabled','disabled');
338 var ccrAction
= document
.getElementsByName('ccrAction');
339 ccrAction
[0].value
= 'viewccd';
340 var ccdRecipient
= $
("#ccd_send_to").val();
341 var raw
= document
.getElementsByName('raw');
342 raw
[0].value
= 'send '+ccdRecipient
;
343 if(ccdRecipient
=="") {
344 $
("#ccd_send_message").html("<?php
345 echo xla('Please enter a valid Direct Address above.');?>");
346 $
("#ccd_send_result").show();
348 $
(".viewCCD_transmit").attr('disabled','disabled');
349 $
("#ccd_send_message").html("<?php
350 echo xla('Working... this may take a minute.');?>");
351 $
("#ccd_send_result").show();
352 var action
=$
("#ccr_form").attr('action');
353 $
.post(action
, {ccrAction
:'viewccd',raw
:'send '+ccdRecipient
,requested_by
:'patient'},
355 if(data
=="SUCCESS") {
356 $
("#ccd_send_message").html("<?php
357 echo xla('Your message was submitted for delivery to');
359 $
("#ccd_send_to").val("");
361 $
("#ccd_send_message").html(data
);
363 $
(".viewCCD_transmit").removeAttr('disabled');
375 <body
class="body_top">
377 <div id
="wrapper" class="lefttop" style
="width: 700px;">
378 <h2
class="heading"><?php
echo xlt("Patient Portal"); ?
></h2
>
381 $result = getPatientData($pid);
383 <?php
echo xlt('Welcome'); ?
> <b
><?php
echo text($result['fname']." ".$result['lname']); ?
></b
>
385 <div style
='margin-top:10px'> <!-- start main content div
-->
386 <table border
="0" cellspacing
="0" cellpadding
="0" width
="100%">
388 <td align
="left" valign
="top">
389 <!-- start left column div
-->
390 <div style
='float:left; margin-right:20px'>
391 <table cellspacing
=0 cellpadding
=0>
392 <?php
if ($GLOBALS['activate_ccr_ccd_report']) { // show CCR/CCD reporting options ?>
397 $widgetTitle = xl("Reports");
398 $widgetLabel = "reports";
399 $widgetButtonLabel = xl("");
400 $widgetButtonClass = "hidden";
401 $linkMethod = "html";
402 $bodyClass = "notab";
405 expand_collapse_widget(
418 <div style
='margin-left:3em; margin-right:3em; padding:1em; border:1px solid blue;' class='text'>
419 <div id
="ccr_report">
420 <form name
='ccr_form' id
='ccr_form' method
='post' action
='../ccr/createCCR.php?portal_auth=1'>
421 <span
class='text'><b
><?php
echo xlt('Continuity of Care Record (CCR)'); ?
></b
></span
> 
; 
;
423 <span
class='text'>(<?php
echo xlt('Pop ups need to be enabled to see these reports'); ?
>)</span
>
426 <input type
='hidden' name
='ccrAction'>
427 <input type
='hidden' name
='raw'>
428 <input type
="checkbox" name
="show_date" id
="show_date" onchange
="show_date_fun();" ><span
class='text'><?php
echo xlt('Use Date Range'); ?
>
430 <div id
="date_div" style
="display:none" >
432 <table border
="0" cellpadding
="0" cellspacing
="0" >
435 <span
class='bold'><?php
echo xlt('Start Date');?
>: </span
>
438 <input type
='text' size
='10' name
='Start' id
='Start'
439 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
440 title
='<?php echo xla('yyyy
-mm
-dd
'); ?>' />
441 <img src
='../interface/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
442 id
='img_start' border
='0' alt
='[?]' style
='cursor:pointer'
443 title
='<?php echo xla('Click here to choose a date
'); ?>' >
444 <script LANGUAGE
="JavaScript">
445 Calendar
.setup({inputField
:"Start", ifFormat
:"%Y-%m-%d", button
:"img_start"});
450 <span
class='bold'><?php
echo xlt('End Date');?
>: </span
>
453 <input type
='text' size
='10' name
='End' id
='End'
454 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
455 title
='<?php echo xla('yyyy
-mm
-dd
'); ?>' />
456 <img src
='../interface/pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
457 id
='img_end' border
='0' alt
='[?]' style
='cursor:pointer'
458 title
='<?php echo xla('Click here to choose a date
'); ?>' >
459 <script LANGUAGE
="JavaScript">
460 Calendar
.setup({inputField
:"End", ifFormat
:"%Y-%m-%d", button
:"img_end"});
467 <input type
="button" class="generateCCR" value
="<?php echo xla('View/Print'); ?>" />
468 <!-- <input type
="button" class="generateCCR_download_h" value
="<?php echo xla('Download'); ?>" /> -->
469 <input type
="button" class="generateCCR_download_p" value
="<?php echo xla('Download'); ?>" />
470 <!-- <input type
="button" class="generateCCR_raw" value
="<?php echo xla('Raw Report'); ?>" /> -->
471 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccr_enable']==true) { ?
>
472 <input type
="button" class="viewCCR_send_dialog" value
="<?php echo xla('Transmit'); ?>" />
474 <div id
="ccr_send_dialog" style
="display:none" >
476 <table border
="0" cellpadding
="0" cellspacing
="0" >
479 <span
class='bold'><?php
echo xlt('Enter Recipient\'s Direct Address');?
>: </span
>
480 <input type
="text" size
="64" name
="ccr_send_to" id
="ccr_send_to" value
="">
481 <input type
="button" class="viewCCR_transmit" value
="<?php echo xla('Send'); ?>" />
482 <div id
="ccr_send_result" style
="display:none" >
483 <span
class="text" id
="ccr_send_message"></span
>
491 <span
class='text'><b
><?php
echo xlt('Continuity of Care Document (CCD)'); ?
></b
></span
> 
; 
;
493 <span
class='text'>(<?php
echo xlt('Pop ups need to be enabled to see these reports'); ?
>)</span
>
496 <input type
="button" class="viewCCD" value
="<?php echo xla('View/Print'); ?>" />
497 <input type
="button" class="viewCCD_download" value
="<?php echo xla('Download'); ?>" />
498 <!-- <input type
="button" class="viewCCD_raw" value
="<?php echo xla('Raw Report'); ?>" /> -->
499 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccd_enable']==true) { ?
>
500 <input type
="button" class="viewCCD_send_dialog" value
="<?php echo xla('Transmit'); ?>" />
502 <div id
="ccd_send_dialog" style
="display:none" >
504 <table border
="0" cellpadding
="0" cellspacing
="0" >
507 <span
class='bold'><?php
echo xlt('Enter Recipient\'s Direct Address');?
>: </span
>
508 <input type
="text" size
="64" name
="ccd_send_to" id
="ccd_send_to" value
="">
509 <input type
="button" class="viewCCD_transmit" value
="<?php echo xla('Send'); ?>" />
510 <div id
="ccd_send_result" style
="display:none" >
511 <span
class="text" id
="ccd_send_message"></span
>
526 <?php
} // end CCR/CCD reporting options ?>
527 <?php
if ($GLOBALS['portal_onsite_document_download']) { ?
>
528 <?php
echo "<tr><td width='650px'>";
529 $widgetTitle = xl('Documents');
530 $widgetLabel = "documents";
531 $widgetButtonLabel = xl('Download');
532 $widgetButtonClass = "hidden";
533 $linkMethod = "html";
534 $bodyClass = "notab";
537 expand_collapse_widget(
549 <span
class="text"><?php
echo xlt('Download all patient documents');?
></span
>
551 <form name
='doc_form' id
='doc_form' action
='get_patient_documents.php' method
='post'>
552 <input type
="button" class="generateDoc_download" value
="<?php echo xla('Download'); ?>" />
558 <?php
echo "<tr><td width='650px'>";
559 // Lab tests results expand collapse widget
560 $widgetTitle = xl("Lab Test Results");
561 $widgetLabel = "labtestresults";
562 $widgetButtonLabel = xl("");
563 $widgetButtonClass = "hidden";
564 $linkMethod = "html";
565 $bodyClass = "notab";
568 expand_collapse_widget(
582 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
587 <?php
echo "<tr><td width='650px'>";
588 // problem list collapse widget
589 $widgetTitle = xl("Problem List");
590 $widgetLabel = "problemlist";
591 $widgetButtonLabel = xl("");
592 $widgetButtonClass = "hidden";
593 $linkMethod = "html";
594 $bodyClass = "notab";
597 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?
>
608 // medication list expand collapse widget
609 $widgetTitle = xl("Medication List");
610 $widgetLabel = "medicationlist";
611 $widgetButtonLabel = xl("");
612 $widgetButtonClass = "hidden";
613 $linkMethod = "html";
614 $bodyClass = "notab";
617 expand_collapse_widget(
630 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
638 <?php
// medication allergy expand collapse widget
639 $widgetTitle = xl("Medication Allergy List");
640 $widgetLabel = "medicationallergylist";
641 $widgetButtonLabel = xl("");
642 $widgetButtonClass = "";
643 $linkMethod = "html";
644 $bodyClass = "notab";
647 expand_collapse_widget(
660 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
667 <?php
if ($GLOBALS['amendments']) { ?
>
671 $widgetTitle = xl("Amendments");
672 $widgetLabel = "amendments";
673 $widgetButtonLabel = xl("");
674 $widgetButtonClass = "hidden";
675 $linkMethod = "html";
676 $bodyClass = "notab";
679 expand_collapse_widget(
693 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
700 // Show current and upcoming appointments.
701 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
702 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
704 "FROM openemr_postcalendar_events AS e, users AS u, " .
705 "openemr_postcalendar_categories AS c WHERE " .
706 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
707 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
708 "ORDER BY e.pc_eventDate, e.pc_startTime";
710 $res = sqlStatement($query, array($pid));
712 // appointments expand collapse widget
713 $widgetTitle = xl("Appointments");
714 $widgetLabel = "appointments";
715 $widgetButtonLabel = xl("Add");
716 $widgetButtonLink = "add_edit_event_user.php?pid=".htmlspecialchars($pid, ENT_QUOTES
);
717 $widgetButtonClass = "edit_event iframe";
719 $bodyClass = "summary_item small";
720 if ($GLOBALS['portal_onsite_appt_modify']) {
727 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
730 <div id
='stats_div' style
="display:none">
731 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
>
745 </div
> <!-- end main content div
-->
747 <div id
="portal-buttons-bottom"> <!-- buttons bottom div
-->
748 <input type
="button" style
="text-align: right;" value
="<?php echo xla('Log Out'); ?>" onclick
="window.location = 'logout.php'"/>
750 <input type
="button" style
="text-align: right;" value
="<?php echo xla('Change Password'); ?>" onclick
="window.location = '<?php echo $landingpage."&password_update
=1";?>'"/>
751 </div
><!-- end buttons bottom div
-->