9b0139d9eb119b50fec3d85aeb062ddbe7dd733f
2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
8 $sanitize_all_escapes=true;
11 //STOP FAKE REGISTER GLOBALS
12 $fake_register_globals=false;
15 require_once("../../globals.php");
16 require_once("$srcdir/pnotes.inc");
17 require_once("$srcdir/acl.inc");
18 require_once("$srcdir/patient.inc");
19 require_once("$srcdir/options.inc.php");
20 require_once("$srcdir/classes/Document.class.php");
21 require_once("$srcdir/formatting.inc.php");
23 // form parameter docid can be passed to restrict the display to a document.
24 $docid = empty($_REQUEST['docid']) ?
0 : 0 +
$_REQUEST['docid'];
27 <li
class="current" ><a href
="#"><?php
echo htmlspecialchars(xl('Inbox'),ENT_NOQUOTES
); ?
></a
></li
>
28 <li
><a href
="#"><?php
echo htmlspecialchars(xl('Sent Items'),ENT_NOQUOTES
); ?
></a
></li
>
30 <div
class='tabContainer' >
31 <div
class='tab current' >
33 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
41 $thisauth = acl_check('patients', 'notes');
43 $tmp = getPatientData($pid, "squad");
44 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
48 echo "<p>(" . htmlspecialchars(xl('Notes not authorized'),ENT_NOQUOTES
) . ")</p>\n";
50 <table width
='100%' border
='0' cellspacing
='1' cellpadding
='1' style
='border-collapse:collapse;' >
53 $pres = getPatientData($pid,"lname, fname");
54 $patientname = $pres['lname'] . ", " . $pres['fname'];
55 //retrieve all active notes
56 $result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to,message_status",
57 $pid, "$N", 0, '', $docid);
59 if ($result != null) {
60 $notes_count = 0;//number of notes so far displayed
61 echo "<tr class='text' style='border-bottom:2px solid #000;' >\n";
62 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('From'),ENT_NOQUOTES
) ."</b></td>\n";
63 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Date'),ENT_NOQUOTES
) ."</b></td>\n";
64 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Subject'),ENT_NOQUOTES
) ."</b></td>\n";
65 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Content'),ENT_NOQUOTES
) ."</b></td>\n";
66 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Status'),ENT_NOQUOTES
) ."</b></td>\n";
68 foreach ($result as $iter) {
71 $body = $iter['body'];
72 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
73 $body = nl2br(htmlspecialchars(oeFormatPatientNote($body),ENT_NOQUOTES
));
75 $body = htmlspecialchars(oeFormatSDFT(strtotime($iter['date'])) . date(' H:i', strtotime($iter['date'])) .
76 ' (' . $iter['user'] . ') ',ENT_NOQUOTES
) .
77 nl2br(htmlspecialchars(oeFormatPatientNote($body),ENT_NOQUOTES
));
79 $body = preg_replace('/(\sto\s)-patient-(\))/','${1}'.$patientname.'${2}',$body);
80 $body = strlen($body) > 120 ?
substr($body,0,120)."<b>.......</b>" : $body;
81 echo " <tr class='text' id='".htmlspecialchars($iter['id'],ENT_QUOTES
)."' style='border-bottom:1px dashed;height:30px;' >\n";
83 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
84 echo "<td valign='top' class='text'>".htmlspecialchars($iter['user'],ENT_NOQUOTES
)."</td>\n";
85 echo "<td valign='top' class='text'>".htmlspecialchars($iter['date'],ENT_NOQUOTES
)."</td>\n";
86 echo " <td valign='top' class='text'><b>";
87 echo generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']);
90 echo " <td valign='top' class='text'>$body</td>\n";
91 echo " <td valign='top' class='text'>";
92 echo generate_display_field(array('data_type'=>'1','list_id'=>'message_status'), $iter['message_status']);
103 if ($has_note < 1 ) { ?
>
105 <?php
echo htmlspecialchars(xl( "There are no notes on file for this patient."),ENT_NOQUOTES
);
107 echo "<a href='pnotes_full.php'>";
108 echo htmlspecialchars(xl("To add notes, please click here"),ENT_NOQUOTES
);
115 <?php
echo htmlspecialchars(xl('Displaying the following number of most recent notes:'),ENT_NOQUOTES
); ?
>
116 <b
><?php
echo $N;?
></b
><br
>
117 <a href
='pnotes_full.php?s=0'><?php
echo htmlspecialchars(xl('Click here to view them all.'),ENT_NOQUOTES
); ?
></a
>
129 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
135 echo "<p>(" . htmlspecialchars(xl('Notes not authorized'),ENT_NOQUOTES
) . ")</p>\n";
137 <table width
='100%' border
='0' cellspacing
='1' cellpadding
='1' style
='border-collapse:collapse;' >
139 //retrieve all active notes
140 $result_sent = getSentPnotesByDate("", 1, "id,date,body,user,title,assigned_to,pid",
141 $pid, "$M", 0, '', $docid);
142 if ($result_sent != null) {
143 $notes_sent_count = 0;//number of notes so far displayed
144 echo "<tr class='text' style='border-bottom:2px solid #000;' >\n";
145 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('To'),ENT_NOQUOTES
) ."</b></td>\n";
146 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Date'),ENT_NOQUOTES
) ."</b></td>\n";
147 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Subject'),ENT_NOQUOTES
) ."</b></td>\n";
148 echo "<td valign='top' class='text' ><b>". htmlspecialchars(xl('Content'),ENT_NOQUOTES
) ."</b></td>\n";
150 foreach ($result_sent as $iter) {
152 $body = $iter['body'];
153 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
154 $body = nl2br(htmlspecialchars(oeFormatPatientNote($body),ENT_NOQUOTES
));
156 $body = htmlspecialchars(oeFormatSDFT(strtotime($iter['date'])) . date(' H:i', strtotime($iter['date'])) .
157 ' (' . $iter['user'] . ') ',ENT_NOQUOTES
) .
158 nl2br(htmlspecialchars(oeFormatPatientNote($body),ENT_NOQUOTES
));
160 $body = preg_replace('/(:\d{2}\s\()'.$iter['pid'].'(\sto\s)/','${1}'.$patientname.'${2}',$body);
161 $body = strlen($body) > 120 ?
substr($body,0,120)."<b>.......</b>" : $body;
162 echo " <tr class='text' id='".htmlspecialchars($iter['id'],ENT_QUOTES
)."' style='border-bottom:1px dashed;height:30px;' >\n";
163 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
164 echo "<td valign='top' class='text'>".htmlspecialchars($iter['assigned_to'],ENT_NOQUOTES
)."</td>\n";
165 echo "<td valign='top' class='text'>".htmlspecialchars($iter['date'],ENT_NOQUOTES
)."</td>\n";
166 echo " <td valign='top' class='text'><b>";
167 echo generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']);
169 echo " <td valign='top' class='text'>$body</td>\n";
176 if ($has_sent_note < 1 ) { ?
>
178 <?php
echo htmlspecialchars(xl( "There are no notes on file for this patient."),ENT_NOQUOTES
);
180 echo "<a href='pnotes_full.php'>";
181 echo htmlspecialchars(xl("To add notes, please click here"),ENT_NOQUOTES
);
188 <?php
echo htmlspecialchars(xl('Displaying the following number of most recent notes'),ENT_NOQUOTES
).":"; ?
>
189 <b
><?php
echo $M;?
></b
><br
>
190 <a href
='pnotes_full.php?s=1'><?php
echo htmlspecialchars(xl('Click here to view them all.'),ENT_NOQUOTES
); ?
></a
>
200 <script language
="javascript">
201 // jQuery stuff to make the page a little easier to use
205 $
(document
).ready(function(){
206 $
(".noterow").mouseover(function() { $
(this
).toggleClass("highlight"); });
207 $
(".noterow").mouseout(function() { $
(this
).toggleClass("highlight"); });