Portal credential enhancements
[openemr.git] / interface / patient_file / summary / pnotes_print.php
bloba77ab98e777a78e59f052229f2fa3689b5c348a4
1 <?php
2 /**
3 * Display patient notes.
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../../globals.php");
14 require_once("$srcdir/patient.inc");
15 require_once("$srcdir/acl.inc");
16 require_once("$srcdir/options.inc.php");
17 require_once("$srcdir/pnotes.inc");
19 $prow = getPatientData($pid, "squad, title, fname, mname, lname");
21 // Check authorization.
22 $thisauth = acl_check('patients', 'notes');
23 if (!$thisauth) {
24 die(xlt('Not authorized'));
27 if ($prow['squad'] && ! acl_check('squads', $prow['squad'])) {
28 die(xlt('Not authorized for this squad.'));
31 $noteid = $_REQUEST['noteid'];
33 $ptname = $prow['title'] . ' ' . $prow['fname'] . ' ' . $prow['mname'] .
34 ' ' . $prow['lname'];
36 $title = '';
37 $assigned_to = '';
38 $body = '';
39 $activity = 0;
40 if ($noteid) {
41 $nrow = getPnoteById($noteid, 'title,assigned_to,activity,body');
42 $title = $nrow['title'];
43 $assigned_to = $nrow['assigned_to'];
44 $activity = $nrow['activity'];
45 $body = $nrow['body'];
48 <html>
49 <head>
50 <link rel='stylesheet' href="<?php echo $css_header;?>" type="text/css">
51 </head>
53 <body class="body_top">
55 <p><?php echo "<b>" .
56 generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $title) .
57 "</b>" . ' ' . xlt('for') . ' ' .
58 "<b>" . attr($ptname) . "</b>"; ?></p>
60 <p><?php echo xlt('Assigned To'); ?>: <?php echo text($assigned_to); ?></p>
62 <p><?php echo xlt('Active{{Note}}'); ?>: <?php echo ($activity ? xlt('Yes') : xlt('No')); ?></p>
64 <p><?php echo nl2br(text($body)); ?></p>
66 <script language='JavaScript'>
67 opener.top.printLogPrint(window);
68 </script>
70 </body>
71 </html>