bug fixes in patient_files summary directory (#1964)
[openemr.git] / interface / patient_file / summary / pnotes_print.php
bloba1c4c328b67d63a5018e32baffc882911aa232d7
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 <?php html_header_show();?>
51 <link rel='stylesheet' href="<?php echo $css_header;?>" type="text/css">
52 </head>
54 <body class="body_top">
56 <p><?php echo "<b>" .
57 generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $title) .
58 "</b>" . ' ' . xlt('for') . ' ' .
59 "<b>" . attr($ptname) . "</b>"; ?></p>
61 <p><?php echo xlt('Assigned To'); ?>: <?php echo text($assigned_to); ?></p>
63 <p><?php echo xlt('Active'); ?>: <?php echo ($activity ? xlt('Yes') : xlt('No')); ?></p>
65 <p><?php echo nl2br(text($body)); ?></p>
67 <script language='JavaScript'>
68 opener.top.printLogPrint(window);
69 </script>
71 </body>
72 </html>