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
>
48 <?php
html_header_show(); ?
>
49 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
50 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/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/dist/jquery.min.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 $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/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"/>
62 <script type
="text/javascript" language
="JavaScript">
64 function refreshme() {
68 function toggleIndicator(target
,div
) {
70 $mode = $
(target
).find(".indicator").text();
71 if ( $mode == "<?php echo xla('collapse'); ?>" ) {
72 $
(target
).find(".indicator").text( "<?php echo xla('expand'); ?>" );
75 $
(target
).find(".indicator").text( "<?php echo xla('collapse'); ?>" );
80 function show_date_fun(){
81 if(document
.getElementById('show_date').checked
== true){
82 document
.getElementById('date_div').style
.display
= '';
84 document
.getElementById('date_div').style
.display
= 'none';
89 $
(document
).ready(function(){
92 $
("#labtestresults_ps_expand").load("get_lab_results.php");
93 $
("#problemlist_ps_expand").load("get_problems.php");
94 $
("#medicationlist_ps_expand").load("get_medications.php");
95 $
("#medicationallergylist_ps_expand").load("get_allergies.php");
96 $
("#amendments_ps_expand").load("get_amendments.php");
97 $
("#appointments_ps_expand").load("get_appointments.php");
99 $
(".generateCCR").click(
101 if(document
.getElementById('show_date').checked
== true){
102 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
103 alert('<?php echo xls('Please select a start date
and end date
') ?>');
107 var ccrAction
= document
.getElementsByName('ccrAction');
108 ccrAction
[0].value
= 'generate';
109 var raw
= document
.getElementsByName('raw');
111 ccr_form
.setAttribute("target", "_blank");
112 $
("#ccr_form").submit();
113 ccr_form
.setAttribute("target", "");
115 $
(".generateCCR_raw").click(
117 var ccrAction
= document
.getElementsByName('ccrAction');
118 ccrAction
[0].value
= 'generate';
119 var raw
= document
.getElementsByName('raw');
120 raw
[0].value
= 'yes';
121 ccr_form
.setAttribute("target", "_blank");
122 $
("#ccr_form").submit();
123 ccr_form
.setAttribute("target", "");
125 $
(".generateCCR_download_h").click(
127 var ccrAction
= document
.getElementsByName('ccrAction');
128 ccrAction
[0].value
= 'generate';
129 var raw
= document
.getElementsByName('raw');
130 raw
[0].value
= 'hybrid';
131 $
("#ccr_form").submit();
133 $
(".generateCCR_download_p").click(
135 if(document
.getElementById('show_date').checked
== true){
136 if(document
.getElementById('Start').value
== '' || document
.getElementById('End').value
== ''){
137 alert('<?php echo xls('Please select a start date
and end date
') ?>');
141 var ccrAction
= document
.getElementsByName('ccrAction');
142 ccrAction
[0].value
= 'generate';
143 var raw
= document
.getElementsByName('raw');
144 raw
[0].value
= 'pure';
145 $
("#ccr_form").submit();
149 var ccrAction
= document
.getElementsByName('ccrAction');
150 ccrAction
[0].value
= 'viewccd';
151 var raw
= document
.getElementsByName('raw');
153 ccr_form
.setAttribute("target", "_blank");
154 $
("#ccr_form").submit();
155 ccr_form
.setAttribute("target", "");
157 $
(".viewCCD_raw").click(
159 var ccrAction
= document
.getElementsByName('ccrAction');
160 ccrAction
[0].value
= 'viewccd';
161 var raw
= document
.getElementsByName('raw');
162 raw
[0].value
= 'yes';
163 ccr_form
.setAttribute("target", "_blank");
164 $
("#ccr_form").submit();
165 ccr_form
.setAttribute("target", "");
167 $
(".viewCCD_download").click(
169 var ccrAction
= document
.getElementsByName('ccrAction');
170 ccrAction
[0].value
= 'viewccd';
171 var raw
= document
.getElementsByName('raw');
172 raw
[0].value
= 'pure';
173 $
("#ccr_form").submit();
175 $
(".generateDoc_download").click(
177 $
("#doc_form").submit();
179 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccr_enable']==true) { ?
>
180 $
(".viewCCR_send_dialog").click(
182 $
("#ccr_send_dialog").toggle();
184 $
(".viewCCR_transmit").click(
186 $
(".viewCCR_transmit").attr('disabled','disabled');
187 var ccrAction
= document
.getElementsByName('ccrAction');
188 ccrAction
[0].value
= 'generate';
189 var ccrRecipient
= $
("#ccr_send_to").val();
190 var raw
= document
.getElementsByName('raw');
191 raw
[0].value
= 'send '+ccrRecipient
;
192 if(ccrRecipient
=="") {
193 $
("#ccr_send_message").html("<?php
194 echo xla('Please enter a valid Direct Address above.');?>");
195 $
("#ccr_send_result").show();
197 $
(".viewCCR_transmit").attr('disabled','disabled');
198 $
("#ccr_send_message").html("<?php
199 echo xla('Working... this may take a minute.');?>");
200 $
("#ccr_send_result").show();
201 var action
=$
("#ccr_form").attr('action');
202 $
.post(action
, {ccrAction
:'generate',raw
:'send '+ccrRecipient
,requested_by
:'patient'},
204 if(data
=="SUCCESS") {
205 $
("#ccr_send_message").html("<?php
206 echo xla('Your message was submitted for delivery to');
208 $
("#ccr_send_to").val("");
210 $
("#ccr_send_message").html(data
);
212 $
(".viewCCR_transmit").removeAttr('disabled');
218 if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccd_enable']==true) { ?
>
219 $
(".viewCCD_send_dialog").click(
221 $
("#ccd_send_dialog").toggle();
223 $
(".viewCCD_transmit").click(
225 $
(".viewCCD_transmit").attr('disabled','disabled');
226 var ccrAction
= document
.getElementsByName('ccrAction');
227 ccrAction
[0].value
= 'viewccd';
228 var ccdRecipient
= $
("#ccd_send_to").val();
229 var raw
= document
.getElementsByName('raw');
230 raw
[0].value
= 'send '+ccdRecipient
;
231 if(ccdRecipient
=="") {
232 $
("#ccd_send_message").html("<?php
233 echo xla('Please enter a valid Direct Address above.');?>");
234 $
("#ccd_send_result").show();
236 $
(".viewCCD_transmit").attr('disabled','disabled');
237 $
("#ccd_send_message").html("<?php
238 echo xla('Working... this may take a minute.');?>");
239 $
("#ccd_send_result").show();
240 var action
=$
("#ccr_form").attr('action');
241 $
.post(action
, {ccrAction
:'viewccd',raw
:'send '+ccdRecipient
,requested_by
:'patient'},
243 if(data
=="SUCCESS") {
244 $
("#ccd_send_message").html("<?php
245 echo xla('Your message was submitted for delivery to');
247 $
("#ccd_send_to").val("");
249 $
("#ccd_send_message").html(data
);
251 $
(".viewCCD_transmit").removeAttr('disabled');
257 $
('.datepicker').datetimepicker({
258 <?php
$datetimepicker_timepicker = false; ?
>
259 <?php
$datetimepicker_showseconds = false; ?
>
260 <?php
$datetimepicker_formatInput = false; ?
>
261 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
262 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
270 <body
class="body_top">
272 <div id
="wrapper" class="lefttop" style
="width: 700px;">
273 <h2
class="heading"><?php
echo xlt("Patient Portal"); ?
></h2
>
276 $result = getPatientData($pid);
278 <?php
echo xlt('Welcome'); ?
> <b
><?php
echo text($result['fname']." ".$result['lname']); ?
></b
>
280 <div style
='margin-top:10px'> <!-- start main content div
-->
281 <table border
="0" cellspacing
="0" cellpadding
="0" width
="100%">
283 <td align
="left" valign
="top">
284 <!-- start left column div
-->
285 <div style
='float:left; margin-right:20px'>
286 <table cellspacing
=0 cellpadding
=0>
287 <?php
if ($GLOBALS['activate_ccr_ccd_report']) { // show CCR/CCD reporting options ?>
292 $widgetTitle = xl("Reports");
293 $widgetLabel = "reports";
294 $widgetButtonLabel = xl("");
295 $widgetButtonClass = "hidden";
296 $linkMethod = "html";
297 $bodyClass = "notab";
300 expand_collapse_widget(
313 <div style
='margin-left:3em; margin-right:3em; padding:1em; border:1px solid blue;' class='text'>
314 <div id
="ccr_report">
315 <form name
='ccr_form' id
='ccr_form' method
='post' action
='../ccr/createCCR.php?portal_auth=1'>
316 <span
class='text'><b
><?php
echo xlt('Continuity of Care Record (CCR)'); ?
></b
></span
> 
; 
;
318 <span
class='text'>(<?php
echo xlt('Pop ups need to be enabled to see these reports'); ?
>)</span
>
321 <input type
='hidden' name
='ccrAction'>
322 <input type
='hidden' name
='raw'>
323 <input type
="checkbox" name
="show_date" id
="show_date" onchange
="show_date_fun();" ><span
class='text'><?php
echo xlt('Use Date Range'); ?
>
325 <div id
="date_div" style
="display:none" >
327 <table border
="0" cellpadding
="0" cellspacing
="0" >
330 <span
class='bold'><?php
echo xlt('Start Date');?
>: </span
>
333 <input type
='text' size
='10' class='datepicker' name
='Start' id
='Start'
334 title
='<?php echo xla('yyyy
-mm
-dd
'); ?>' />
338 <span
class='bold'><?php
echo xlt('End Date');?
>: </span
>
341 <input type
='text' class='datepicker' size
='10' name
='End' id
='End'
342 title
='<?php echo xla('yyyy
-mm
-dd
'); ?>' />
348 <input type
="button" class="generateCCR" value
="<?php echo xla('View/Print'); ?>" />
349 <!-- <input type
="button" class="generateCCR_download_h" value
="<?php echo xla('Download'); ?>" /> -->
350 <input type
="button" class="generateCCR_download_p" value
="<?php echo xla('Download'); ?>" />
351 <!-- <input type
="button" class="generateCCR_raw" value
="<?php echo xla('Raw Report'); ?>" /> -->
352 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccr_enable']==true) { ?
>
353 <input type
="button" class="viewCCR_send_dialog" value
="<?php echo xla('Transmit'); ?>" />
355 <div id
="ccr_send_dialog" style
="display:none" >
357 <table border
="0" cellpadding
="0" cellspacing
="0" >
360 <span
class='bold'><?php
echo xlt('Enter Recipient\'s Direct Address');?
>: </span
>
361 <input type
="text" size
="64" name
="ccr_send_to" id
="ccr_send_to" value
="">
362 <input type
="button" class="viewCCR_transmit" value
="<?php echo xla('Send'); ?>" />
363 <div id
="ccr_send_result" style
="display:none" >
364 <span
class="text" id
="ccr_send_message"></span
>
372 <span
class='text'><b
><?php
echo xlt('Continuity of Care Document (CCD)'); ?
></b
></span
> 
; 
;
374 <span
class='text'>(<?php
echo xlt('Pop ups need to be enabled to see these reports'); ?
>)</span
>
377 <input type
="button" class="viewCCD" value
="<?php echo xla('View/Print'); ?>" />
378 <input type
="button" class="viewCCD_download" value
="<?php echo xla('Download'); ?>" />
379 <!-- <input type
="button" class="viewCCD_raw" value
="<?php echo xla('Raw Report'); ?>" /> -->
380 <?php
if ($GLOBALS['phimail_enable']==true && $GLOBALS['phimail_ccd_enable']==true) { ?
>
381 <input type
="button" class="viewCCD_send_dialog" value
="<?php echo xla('Transmit'); ?>" />
383 <div id
="ccd_send_dialog" style
="display:none" >
385 <table border
="0" cellpadding
="0" cellspacing
="0" >
388 <span
class='bold'><?php
echo xlt('Enter Recipient\'s Direct Address');?
>: </span
>
389 <input type
="text" size
="64" name
="ccd_send_to" id
="ccd_send_to" value
="">
390 <input type
="button" class="viewCCD_transmit" value
="<?php echo xla('Send'); ?>" />
391 <div id
="ccd_send_result" style
="display:none" >
392 <span
class="text" id
="ccd_send_message"></span
>
407 <?php
} // end CCR/CCD reporting options ?>
408 <?php
if ($GLOBALS['portal_onsite_document_download']) { ?
>
409 <?php
echo "<tr><td width='650px'>";
410 $widgetTitle = xl('Documents');
411 $widgetLabel = "documents";
412 $widgetButtonLabel = xl('Download');
413 $widgetButtonClass = "hidden";
414 $linkMethod = "html";
415 $bodyClass = "notab";
418 expand_collapse_widget(
430 <span
class="text"><?php
echo xlt('Download all patient documents');?
></span
>
432 <form name
='doc_form' id
='doc_form' action
='get_patient_documents.php' method
='post'>
433 <input type
="button" class="generateDoc_download" value
="<?php echo xla('Download'); ?>" />
439 <?php
echo "<tr><td width='650px'>";
440 // Lab tests results expand collapse widget
441 $widgetTitle = xl("Lab Test Results");
442 $widgetLabel = "labtestresults";
443 $widgetButtonLabel = xl("");
444 $widgetButtonClass = "hidden";
445 $linkMethod = "html";
446 $bodyClass = "notab";
449 expand_collapse_widget(
463 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
468 <?php
echo "<tr><td width='650px'>";
469 // problem list collapse widget
470 $widgetTitle = xl("Problem List");
471 $widgetLabel = "problemlist";
472 $widgetButtonLabel = xl("");
473 $widgetButtonClass = "hidden";
474 $linkMethod = "html";
475 $bodyClass = "notab";
478 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth); ?
>
489 // medication list expand collapse widget
490 $widgetTitle = xl("Medication List");
491 $widgetLabel = "medicationlist";
492 $widgetButtonLabel = xl("");
493 $widgetButtonClass = "hidden";
494 $linkMethod = "html";
495 $bodyClass = "notab";
498 expand_collapse_widget(
511 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
519 <?php
// medication allergy expand collapse widget
520 $widgetTitle = xl("Medication Allergy List");
521 $widgetLabel = "medicationallergylist";
522 $widgetButtonLabel = xl("");
523 $widgetButtonClass = "";
524 $linkMethod = "html";
525 $bodyClass = "notab";
528 expand_collapse_widget(
541 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
548 <?php
if ($GLOBALS['amendments']) { ?
>
552 $widgetTitle = xl("Amendments");
553 $widgetLabel = "amendments";
554 $widgetButtonLabel = xl("");
555 $widgetButtonClass = "hidden";
556 $linkMethod = "html";
557 $bodyClass = "notab";
560 expand_collapse_widget(
574 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
><br
/>
581 // Show current and upcoming appointments.
582 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
583 "e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname, " .
585 "FROM openemr_postcalendar_events AS e, users AS u, " .
586 "openemr_postcalendar_categories AS c WHERE " .
587 "e.pc_pid = ? AND e.pc_eventDate >= CURRENT_DATE AND " .
588 "u.id = e.pc_aid AND e.pc_catid = c.pc_catid " .
589 "ORDER BY e.pc_eventDate, e.pc_startTime";
591 $res = sqlStatement($query, array($pid));
593 // appointments expand collapse widget
594 $widgetTitle = xl("Appointments");
595 $widgetLabel = "appointments";
596 $widgetButtonLabel = xl("Add");
597 $widgetButtonLink = "add_edit_event_user.php?pid=".htmlspecialchars($pid, ENT_QUOTES
);
598 $widgetButtonClass = "edit_event iframe";
600 $bodyClass = "summary_item small";
601 if ($GLOBALS['portal_onsite_appt_modify']) {
608 expand_collapse_widget($widgetTitle, $widgetLabel, $widgetButtonLabel, $widgetButtonLink, $widgetButtonClass, $linkMethod, $bodyClass, $widgetAuth, $fixedWidth);
611 <div id
='stats_div' style
="display:none">
612 <div style
='margin-left:10px' class='text'><img src
='images/ajax-loader.gif'/></div
>
626 </div
> <!-- end main content div
-->
628 <div id
="portal-buttons-bottom"> <!-- buttons bottom div
-->
629 <input type
="button" style
="text-align: right;" value
="<?php echo xla('Log Out'); ?>" onclick
="window.location = 'logout.php'"/>
631 <input type
="button" style
="text-align: right;" value
="<?php echo xla('Change Password'); ?>" onclick
="window.location = '<?php echo $landingpage."&password_update
=1";?>'"/>
632 </div
><!-- end buttons bottom div
-->