4 * Copyright (C) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
6 * LICENSE: This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * @author Jerry Padgett <sjpadgett@gmail.com>
21 * @link http://www.open-emr.org
23 require_once("verify_session.php");
24 require_once("$srcdir/patient.inc");
25 require_once ("lib/portal_mail.inc");
27 if(!isset($_SESSION['portal_init'])) $_SESSION['portal_init'] = true;
28 $whereto = 'profilepanel';
29 if( isset($_SESSION['whereto'])){
30 $whereto = $_SESSION['whereto'];
32 $user = isset($_SESSION['sessionUser']) ?
$_SESSION['sessionUser'] : 'portal user';
33 $result = getPatientData($pid);
35 $msgs = getPortalPatientNotes($_SESSION['portal_username']);
36 $msgcnt = count($msgs);
38 foreach ( $msgs as $i ) {
39 if($i['message_status']=='New') $newcnt +
= 1;
41 require_once '_header.php';
42 echo "<script>var cpid='" . attr($pid) . "';var cuser='" . attr($user) . "';var webRoot='" . $GLOBALS['web_root'] . "';var ptName='" . attr($_SESSION['ptName']) . "';</script>";
44 <script type
="text/javascript">
45 $
(document
).ready(function(){
46 $
("#profilereport").load("./get_profile.php", { 'embeddedScreen' : true }, function() {
47 $
( "table" ).addClass( "table table-responsive" );
48 $
( ".demographics td" ).removeClass( "label" );
49 $
( ".demographics td" ).addClass( "bold" );
50 $
( ".insurance table" ).addClass( "table-sm table-striped" );
51 $
("#editDems").click( function() {
55 $
("#appointmentslist").load("./get_appointments.php", { 'embeddedScreen' : true }, function() {
56 $
("#reports").load("./report/portal_patient_report.php?pid='<?php echo attr($pid) ?>'", { 'embeddedScreen' : true }, function() {
57 /* $("#payment").load("./portal_payment.php", { 'embeddedScreen' : true }, function() {
61 $
("#medicationlist").load("./get_medications.php", { 'embeddedScreen' : true }, function() {
62 $
("#allergylist").load("./get_allergies.php", { 'embeddedScreen' : true }, function() {
63 $
("#problemslist").load("./get_problems.php", { 'embeddedScreen' : true }, function() {
64 $
("#amendmentslist").load("./get_amendments.php", { 'embeddedScreen' : true }, function() {
65 $
("#labresults").load("./get_lab_results.php", { 'embeddedScreen' : true }, function() {
73 $
('.sigPad').signaturePad({ drawOnly
: true });
74 $
(".generateDoc_download").click( function() {
75 $
("#doc_form").submit();
77 function showProfileModal(){
78 var title
= '<?php echo xla('Demographics Legend Red
: Charted Values
. Blue
: Patient Edits
'); ?> ';
81 { text
: '<?php echo xla('Help
'); ?>', close
: false, style
: 'info',id
: 'formHelp'},
82 { text
: '<?php echo xla('Cancel
'); ?>', close
: true, style
: 'default'},
83 { text
: '<?php echo xla('Revert Edits
'); ?>', close
: false, style
: 'danger',id
: 'replaceAllButton'},
84 { text
: '<?php echo xla('Send
for Review
'); ?>', close
: false, style
: 'success', id
: 'donePatientButton'}],
86 subtitle
: '<?php echo xla('Changes take effect after provider review
.'); ?>',
89 url
: webRoot+
'/portal/patient/patientdata?pid='+cpid+
'&user='+cuser
91 return eModal
.ajax(params
)
92 .then(function () { });
94 function saveProfile(){
97 /* $(document.body).on('hidden.bs.modal', function (){
98 window.location.href = './home.php';
100 var gowhere
= '#<?php echo $whereto?>';
101 $
(gowhere
).collapse('show');
103 var $doHides = $
('#panelgroup');
104 $doHides.on('show.bs.collapse','.collapse', function() {
105 $doHides.find('.collapse.in').collapse('hide');
107 //Enable sidebar toggle
108 $
("[data-toggle='offcanvas']").click(function(e
) {
110 //If window is small enough, enable sidebar push menu
111 if ($
(window
).width() <= 992) {
112 $
('.row-offcanvas').toggleClass('active');
113 $
('.left-side').removeClass("collapse-left");
114 $
(".right-side").removeClass("strech");
115 $
('.row-offcanvas').toggleClass("relative");
117 //Else, enable content streching
118 $
('.left-side').toggleClass("collapse-left");
119 $
(".right-side").toggleClass("strech");
123 $
('#popwait').hide();
124 $
('#callccda').click(function(){
125 $
('#popwait').show();
130 <!-- Right side column
. Contains content of the page
-->
131 <aside
class="right-side">
132 <!-- Main content
-->
133 <section
class="container-fluid content panel-group" id
="panelgroup">
134 <div id
="popwait" class="alert alert-warning" style
="font-size:18px"><strong
><?php
echo xlt('Working!'); ?
></strong
> <?php
echo xlt('Please wait...'); ?
></div
>
135 <div
class="row collapse" id
="lists">
136 <div
class="col-sm-6">
137 <div
class="panel panel-primary">
138 <header
class="panel-heading"><?php
echo xlt('Medications'); ?
> </header
>
139 <div id
="medicationlist" class="panel-body"></div
>
141 <div
class="panel-footer"></div
>
144 <div
class="panel panel-primary">
145 <header
class="panel-heading"><?php
echo xlt('Medications Allergy List'); ?
> </header
>
146 <div id
="allergylist" class="panel-body"></div
>
148 <div
class="panel-footer"></div
>
151 <div
class="col-sm-6">
152 <div
class="panel panel-primary">
153 <header
class="panel-heading"><?php
echo xlt('Issues List'); ?
></header
>
154 <div id
="problemslist" class="panel-body"></div
>
156 <div
class="panel-footer"></div
>
158 <div
class="panel panel-primary">
159 <header
class="panel-heading"><?php
echo xlt('Amendment List'); ?
> </header
>
160 <div id
="amendmentslist" class="panel-body"></div
>
162 <div
class="panel-footer"></div
>
165 <div
class="col-sm-12">
166 <div
class="panel panel-primary">
167 <header
class="panel-heading"><?php
echo xlt('Lab Results'); ?
> </header
>
168 <div id
="labresults" class="panel-body"></div
>
169 <div
class="panel-footer"></div
>
170 </div
><!-- /.panel
-->
173 </div
><!-- /.lists
-->
176 <div
class="col-sm-6">
177 <div
class="panel panel-primary collapse" id
="appointmentpanel">
178 <header
class="panel-heading"><?php
echo xlt('Appointments'); ?
> </header
>
179 <div id
="appointmentslist" class="panel-body"></div
>
180 <div
class="panel-footer"></div
>
181 </div
><!-- /.panel
-->
185 <!--<div
class="col-sm-12">
186 <div
class="panel panel-primary collapse" id
="paymentpanel">
187 <header
class="panel-heading"> <?php
echo xlt('Payments'); ?
> </header
>
188 <div id
="payment" class="panel-body"></div
>
189 <div
class="panel-footer">
195 <div
class="col-sm-12">
196 <div
class="panel panel-primary collapse" style
="padding-top:0;padding-bottom:0;" id
="messagespanel">
197 <!-- <header
class="panel-heading"><?php
//echo xlt('Secure Chat'); ?> </header>-->
198 <div id
="messages" class="panel-body" style
="height:calc(100vh - 120px);overflow:auto;padding:0 0 0 0;" >
199 <iframe src
="./messaging/secure_chat.php" width
="100%" height
="100%"></iframe
><!-- -->
206 <div
class="col-sm-8">
207 <div
class="panel panel-primary collapse" id
="reportpanel">
208 <header
class="panel-heading"><?php
echo xlt('Reports'); ?
> </header
>
209 <div id
="reports" class="panel-body"></div
>
210 <div
class="panel-footer"></div
>
215 <div
class="col-sm-6">
216 <div
class="panel panel-primary collapse" id
="downloadpanel">
217 <header
class="panel-heading"> <?php
echo xlt('Download Documents'); ?
> </header
>
218 <div id
="docsdownload" class="panel-body">
219 <?php
if ( $GLOBALS['portal_onsite_document_download'] ) { ?
>// really should always be able to download!
221 <span
class="text"><?php
echo xlt('Download all patient documents');?
></span
>
222 <form name
='doc_form' id
='doc_form' action
='./get_patient_documents.php' method
='post'>
223 <input type
="button" class="generateDoc_download" value
="<?php echo xla('Download'); ?>" />
227 </div
><!-- /.panel
-body
-->
228 <div
class="panel-footer"></div
>
234 <div
class="col-sm-12">
235 <div
class="panel panel-primary collapse" id
="ledgerpanel">
236 <header
class="panel-heading"><?php
echo xlt('Ledger');?
> </header
>
237 <div id
="patledger" class="panel-body"></div
>
238 <div
class="panel-footer">
239 <iframe src
="./report/pat_ledger.php?form=1&patient_id=<?php echo attr($pid);?>" width
="100%" height
="475" scrolling
="yes"></iframe
>
246 <div
class="col-sm-12">
247 <div
class="panel panel-primary collapse" id
="profilepanel">
248 <header
class="panel-heading"><?php
echo xlt('Profile'); ?
>
249 <!-- <button type
="button" id
="editDems" class="btn btn-info btn-sm pull-right">Pop
-up Edit
</button
>
250 <button type
="button" id
="editProfile" class="btn btn-info btn-sm pull-right">Pop
-up iFrame
</button
> -->
252 <div id
="profilereport" class="panel-body"></div
>
253 <div
class="panel-footer"></div
>
260 <!--<div
class="footer-main">Onsite Patient Portal Beta v3
.0 Copyright
© By sjpadgett@gmail
.com
, 2016 All Rights Reserved
and Recorded
</div
>-->
261 </aside
><!-- /.right
-side
-->
262 </div
><!-- ./wrapper
-->
263 <div id
="openSignModal" class="modal fade" role
="dialog">
264 <div
class="modal-dialog modal-lg">
265 <div
class="modal-content">
266 <div
class="modal-header">
267 <button type
="button" class="close" data
-dismiss
="modal">×
;</button
>
268 <div
class="input-group">
269 <span
class="input-group-addon"
270 onclick
="getSignature(document.getElementById('patientSignaturem'))"><em
> <?php
echo xlt('Show Current Signature On File');?
><br
>
271 <?php
echo xlt('As appears on documents');?
>.</em
></span
> <img
272 class="signature form-control" type
="patient-signature"
273 id
="patientSignaturem" onclick
="getSignature(this)"
274 alt
="Signature On File" src
="">
275 <!-- <span
class="input-group-addon" onclick
="clearSig(this)"><i
class="glyphicon glyphicon-trash"></i
></span
> -->
277 <!-- <h4
class="modal-title">Sign
</h4
> -->
279 <div
class="modal-body">
280 <form name
="signit" id
="signit" class="sigPad">
281 <input type
="hidden" name
="name" id
="name" class="name">
283 <label style
='display: none;'><input style
='display: none;'
284 type
="checkbox" class="" id
="isAdmin" name
="isAdmin" /><?php
echo xlt('Is Authorizing Signature');?
></label
>
285 <li
class="clearButton"><a href
="#clear"><button
><?php
echo xlt('Clear Signature');?
></button
></a
></li
>
287 <div
class="sig sigWrapper">
288 <div
class="typed"></div
>
289 <canvas
class="spad" id
="drawpad" width
="765" height
="325"
290 style
="border: 1px solid #000000; left: 0px;"></canvas
>
292 style
="display: none; position: absolute; TOP: 150px; LEFT: 315px; WIDTH: 100px; HEIGHT: 100px"
293 src
="sign/assets/loading.gif" /> <input type
="hidden" id
="output"
294 name
="output" class="output">
296 <input type
="hidden" name
="type" id
="type"
297 value
="patient-signature">
298 <button type
="button" onclick
="signDoc(this)"><?php
echo xlt('Acknowledge as my Electronic Signature');?
>.</button
>
302 <!-- <div
class="modal-footer">
303 <button type
="button" class="btn btn-default" data
-dismiss
="modal">Close
</button
>
308 style
="display: none; position: absolute; top: 100px; left: 260px; width: 100px; height: 100px"
309 src
="sign/assets/loading.gif" />