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/patient.inc");
18 require_once("$srcdir/acl.inc");
19 require_once("$srcdir/log.inc");
20 require_once("$srcdir/options.inc.php");
21 require_once("$srcdir/classes/Document.class.php");
22 require_once("$srcdir/gprelations.inc.php");
23 require_once("$srcdir/formatting.inc.php");
25 if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) {
26 require_once("$srcdir/pid.inc");
27 setpid($_GET['set_pid']);
30 // Check authorization.
31 if (!acl_check('patients','notes','',array('write','addonly') ))
32 die(htmlspecialchars( xl('Not authorized'), ENT_NOQUOTES
));
33 $tmp = getPatientData($pid, "squad");
34 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
35 die(htmlspecialchars( xl('Not authorized for this squad.'), ENT_NOQUOTES
));
37 //the number of records to display per screen
41 $mode = $_REQUEST['mode'];
42 $offset = $_REQUEST['offset'];
43 $offset_sent = $_REQUEST['offset_sent'];
44 $form_active = $_REQUEST['form_active'];
45 $form_inactive = $_REQUEST['form_inactive'];
46 $noteid = $_REQUEST['noteid'];
47 $form_doc_only = isset($_POST['mode']) ?
(empty($_POST['form_doc_only']) ?
0 : 1) : 1;
48 if($_REQUEST['s'] == '1'){
51 $inbox_style = "style='display:none;border:5px solid #FFFFFF;'";
52 $outbox_style = "style='border:5px solid #FFFFFF;'";
56 $inbox_style = "style='border:5px solid #FFFFFF;'";;
57 $outbox_style = "style='display:none;border:5px solid #FFFFFF;'";
60 if (!isset($offset)) $offset = 0;
61 if (!isset($offset_sent)) $offset_sent = 0;
63 // Collect active variable and applicable html code for links
66 $activity_string_html = 'form_active=1';
68 else if ($form_inactive) {
70 $activity_string_html = 'form_inactive=1';
74 $activity_string_html = '';
75 $form_active = $form_inactive = '1';
78 // form parameter docid can be passed to restrict the display to a document.
79 $docid = empty($_REQUEST['docid']) ?
0 : 0 +
$_REQUEST['docid'];
81 // this code handles changing the state of activity tags when the user updates
82 // them through the interface
84 if ($mode == "update") {
85 foreach ($_POST as $var => $val) {
86 if (strncmp($var, 'act', 3) == 0) {
87 $id = str_replace("act", "", $var);
88 if ($_POST["chk$id"]) {
94 setGpRelation(1, $docid, 6, $id, !empty($_POST["lnk$id"]));
99 elseif ($mode == "new") {
100 $note = $_POST['note'];
103 updatePnote($noteid, $note, $_POST['form_note_type'], $_POST['assigned_to']);
107 addPnote($pid, $note, $userauthorized, '1', $_POST['form_note_type'],
108 $_POST['assigned_to']);
111 elseif ($mode == "delete") {
113 deletePnote($noteid);
114 newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "pnotes: id ".$noteid);
121 $assigned_to = $_SESSION['authUser'];
123 $prow = getPnoteById($noteid, 'title,assigned_to,body');
124 $title = $prow['title'];
125 $assigned_to = $prow['assigned_to'];
128 // Get the users list. The "Inactive" test is a kludge, we should create
129 // a separate column for this.
130 $ures = sqlStatement("SELECT username, fname, lname FROM users " .
131 "WHERE username != '' AND active = 1 AND " .
132 "( info IS NULL OR info NOT LIKE '%Inactive%' ) " .
133 "ORDER BY lname, fname");
135 $pres = sqlQuery("SELECT lname, fname " .
136 "FROM patient_data WHERE pid = ?", array($pid) );
137 $patientname = $pres['lname'] . ", " . $pres['fname'];
140 $result = getPnotesByDate("", $active, 'id,date,body,user,activity,title,assigned_to,message_status',
142 $result_sent = getSentPnotesByDate("", $active, 'id,date,body,user,activity,title,assigned_to,message_status',
143 $pid, $M, $offset_sent);
148 <?php
html_header_show();?
>
150 <link rel
='stylesheet' href
="<?php echo $css_header;?>" type
="text/css">
152 <!-- supporting javascript code
-->
153 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script
>
154 <link rel
="stylesheet" type
="text/css" href
="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
155 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
156 <script type
="text/javascript" src
="../../../library/js/jquery.1.3.2.js"></script
>
157 <script type
="text/javascript" src
="../../../library/js/common.js"></script
>
158 <script type
="text/javascript" src
="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
159 <script type
="text/javascript">
160 /// todo, move this to a common library
162 $
(document
).ready(function(){
164 $
("#dem_view").click( function() {
165 toggle( $
(this
), "#DEM" );
169 $
("#stats_div").load("stats.php");
170 $
("#notes_div").load("pnotes_fragment.php");
176 function show_div(name
){
178 document
.getElementById('inbox_div').style
.display
= '';
179 document
.getElementById('outbox_div').style
.display
= 'none';
181 document
.getElementById('inbox_div').style
.display
= 'none';
182 document
.getElementById('outbox_div').style
.display
= '';
187 <body
class="body_top">
189 <div id
="pnotes"> <!-- large outer DIV
-->
191 <form border
='0' method
='post' name
='new_note' id
="new_note" action
='pnotes_full.php?docid=<?php echo htmlspecialchars( $docid, ENT_QUOTES); ?>&<?php echo attr($activity_string_html);?>'>
195 <span
class="title"><?php
echo htmlspecialchars( xl('Patient Notes'), ENT_NOQUOTES
); ?
></span
>
197 <div style
='float:left;margin-right:10px'>
198 <?php
echo htmlspecialchars( xl('for'), ENT_NOQUOTES
);?
> 
;<span
class="title">
199 <a href
="../summary/demographics.php" onclick
="top.restoreSession()"><?php
echo htmlspecialchars( getPatientName($pid), ENT_NOQUOTES
); ?
></a
></span
>
202 <a href
="pnotes_full_add.php" class="css_button iframe"><span
><?php
echo htmlspecialchars( xl('Add'), ENT_NOQUOTES
); ?
></span
></a
>
203 <a href
="demographics.php" <?php
if (!$GLOBALS['concurrent_layout']) echo "target='Main'"; ?
> class="css_button" onclick
="top.restoreSession()">
204 <span
><?php
echo htmlspecialchars( xl('View Patient'), ENT_NOQUOTES
);?
></span
>
210 <?php
if ($active == "all") { ?
>
211 <span
><?php
echo xlt('Show All'); ?
></span
>
213 <a href
="pnotes_full.php" class="link" onclick
="top.restoreSession()"><span
><?php
echo xlt('Show All'); ?
></span
></a
>
216 <?php
if ($active == '1') { ?
>
217 <span
><?php
echo xlt('Show Active'); ?
></span
>
219 <a href
="pnotes_full.php?form_active=1" class="link" onclick
="top.restoreSession()"><span
><?php
echo xlt('Show Active'); ?
></span
></a
>
222 <?php
if ($active == '0') { ?
>
223 <span
><?php
echo xlt('Show Inactive'); ?
></span
>
225 <a href
="pnotes_full.php?form_inactive=1" class="link" onclick
="top.restoreSession()"><span
><?php
echo xlt('Show Inactive'); ?
></span
></a
>
232 $title_docname = " " . htmlspecialchars( xl("linked to document"), ENT_NOQUOTES
) . " ";
233 $d = new Document($docid);
234 $title_docname .= $d->get_url_file();
237 <input type
='hidden' name
='mode' id
="mode" value
="new">
238 <input type
='hidden' name
='offset' id
="offset" value
="<?php echo $offset; ?>">
239 <input type
='hidden' name
='offset_sent' id
="offset_sent" value
="<?php echo $offset_sent; ?>">
240 <input type
='hidden' name
='form_active' id
="form_active" value
="<?php echo htmlspecialchars( $form_active, ENT_QUOTES); ?>">
241 <input type
='hidden' name
='form_inactive' id
="form_inactive" value
="<?php echo htmlspecialchars( $form_inactive, ENT_QUOTES); ?>">
242 <input type
='hidden' name
='noteid' id
="noteid" value
="<?php echo htmlspecialchars( $noteid, ENT_QUOTES); ?>">
243 <input type
='hidden' name
='form_doc_only' id
="form_doc_only" value
="<?php echo htmlspecialchars( $form_doc_only, ENT_QUOTES); ?>">
248 // Get the billing note if there is one.
252 $sql = "select genericname2, genericval2 " .
253 "from patient_data where pid = ? limit 1";
254 $resnote = sqlQuery($sql, array($pid) );
255 if($resnote && $resnote['genericname2'] == 'Billing') {
256 $billing_note = $resnote['genericval2'];
257 $colorbeg = "<span style='color:red'>";
258 $colorend = "</span>";
261 //Display what the patient owes
262 $balance = get_patient_balance($pid);
265 <?php
if ($billing_note ||
$balance ) { ?
>
267 <div style
='margin-top:3px'>
270 if ($balance != "0") {
271 // $formatted = sprintf((xl('$').'%01.2f'), $balance);
272 $formatted = oeFormatMoney($balance);
273 echo " <tr class='text billing'>\n";
274 echo " <td>".$colorbeg . htmlspecialchars( xl('Balance Due'), ENT_NOQUOTES
) .
275 $colorend." ".$colorbeg. htmlspecialchars( $formatted, ENT_NOQUOTES
) .
281 echo " <tr class='text billing'>\n";
282 echo " <td>".$colorbeg . htmlspecialchars( xl('Billing Note'), ENT_NOQUOTES
) .
283 $colorend." ".$colorbeg . htmlspecialchars( $billing_note, ENT_NOQUOTES
) .
293 <li
class="<?php echo $inbox; ?>" ><a onclick
="show_div('inbox')" href
="#"><?php
echo htmlspecialchars(xl('Inbox'),ENT_NOQUOTES
); ?
></a
></li
>
294 <li
class="<?php echo $outbox; ?>" ><a onclick
="show_div('outbox')" href
="#"><?php
echo htmlspecialchars(xl('Sent Items'),ENT_NOQUOTES
); ?
></a
></li
>
296 <div
class='tabContainer' >
297 <div id
='inbox_div' <?php
echo $inbox_style; ?
> >
298 <form border
='0' method
='post' name
='update_activity' id
='update_activity'
299 action
="pnotes_full.php?docid=<?php echo htmlspecialchars( $docid, ENT_QUOTES); ?>&<?php echo attr($activity_string_html);?>">
300 <!-- start of previous notes DIV
-->
301 <div
class=pat_notes
>
302 <input type
='hidden' name
='mode' value
="update">
303 <input type
='hidden' name
='offset' id
='offset' value
="<?php echo $offset; ?>">
304 <input type
='hidden' name
='offset_sent' id
='offset_sent' value
="<?php echo $offset_sent; ?>">
305 <input type
='hidden' name
='noteid' id
='noteid' value
="0">
306 <table border
='0' cellpadding
="1" class="text">
307 <?php
if ($result != ""): ?
>
309 <td colspan
='5' style
="padding: 5px;" >
310 <a href
="#" class="change_activity" ><span
><?php
echo htmlspecialchars( xl('Update Active'), ENT_NOQUOTES
); ?
></span
></a
>
312 <a href
="pnotes_full.php?<?php echo attr($activity_string_html);?>" class="" id
='Submit'><span
><?php
echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES
); ?
></span
></a
>
317 <table border
='0' cellpadding
="1" class="text" width
= "80%">
319 // display all of the notes for the day, as well as others that are active
320 // from previous dates, up to a certain number, $N
323 echo " <tr class=showborder_head align='left'>\n";
324 echo " <th style='width:100px';> </th>\n";
325 echo " <th>" . htmlspecialchars( xl('Active'), ENT_NOQUOTES
) . " </th>\n";
326 echo " <th>" . ($docid ?
htmlspecialchars( xl('Linked'), ENT_NOQUOTES
) : '') . "</th>\n";
327 echo " <th>" . htmlspecialchars( xl('Type'), ENT_NOQUOTES
) . "</th>\n";
328 echo " <th>" . htmlspecialchars( xl('Content'), ENT_NOQUOTES
) . "</th>\n";
332 foreach ($result as $iter) {
334 $row_note_id = $iter['id'];
338 if (isGpRelation(1, $docid, 6, $row_note_id)) {
342 // Skip unlinked notes if that is requested.
343 if ($form_doc_only) continue;
347 $body = $iter['body'];
348 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
349 $body = nl2br(htmlspecialchars( oeFormatPatientNote($body), ENT_NOQUOTES
));
351 $body = htmlspecialchars( oeFormatSDFT(strtotime($iter['date'])).date(' H:i', strtotime($iter['date'])), ENT_NOQUOTES
) .
352 ' (' . htmlspecialchars( $iter['user'], ENT_NOQUOTES
) . ') ' . nl2br(htmlspecialchars( oeFormatPatientNote($body), ENT_NOQUOTES
));
354 $body = preg_replace('/(\sto\s)-patient-(\))/','${1}'.$patientname.'${2}',$body);
355 if ( ($iter{"activity"}) && ($iter['message_status'] != "Done") ) {
356 $checked = "checked";
361 // highlight the row if it's been selected for updating
362 if ($_REQUEST['noteid'] == $row_note_id) {
363 echo " <tr height=20 class='noterow highlightcolor' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>\n";
366 echo " <tr class='noterow' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>\n";
370 echo " <td><a href='pnotes_full_add.php?trigger=edit¬eid=".htmlspecialchars( $row_note_id, ENT_QUOTES
).
371 "' class='css_button_small iframe'><span>". htmlspecialchars( xl('Edit'), ENT_NOQUOTES
) ."</span></a>\n";
373 // display, or not, a button to delete the note
374 // if the user is an admin or if they are the author of the note, they can delete it
375 if (($iter['user'] == $_SESSION['authUser']) ||
(acl_check('admin','super','','write'))) {
376 echo " <a href='#' class='deletenote css_button_small' id='del" . htmlspecialchars( $row_note_id, ENT_QUOTES
) .
377 "' title='" . htmlspecialchars( xl('Delete this note'), ENT_QUOTES
) . "'><span>" .
378 htmlspecialchars( xl('Delete'), ENT_NOQUOTES
) . "</span>\n";
383 echo " <td class='text bold'>\n";
384 echo " <input type='hidden' name='act".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' value='1' />\n";
385 echo " <input type='checkbox' name='chk".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' $checked />\n";
388 echo " <td class='text bold'>\n";
390 echo " <input type='checkbox' name='lnk".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' $linked />\n";
394 echo " <td class='bold notecell' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>" .
395 "<a href='pnotes_full_add.php?trigger=edit¬eid=".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' class='iframe'>\n";
396 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
397 echo generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']);
400 echo " <td class='notecell' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>\n";
409 print "<tr><td colspan='3' class='text'>" . htmlspecialchars( xl('None'), ENT_NOQUOTES
) . ".</td></tr>\n";
418 <table width
='400' border
='0' cellpadding
='0' cellspacing
='0'>
422 if ($offset > ($N-1)) {
423 echo " <a class='link' href='pnotes_full.php" .
424 "?docid=" . htmlspecialchars( $docid, ENT_QUOTES
) .
425 "&form_active=" . htmlspecialchars( $form_active, ENT_QUOTES
) .
426 "&form_inactive=" . htmlspecialchars( $form_inactive, ENT_QUOTES
) .
427 "&form_doc_only=" . htmlspecialchars( $form_doc_only, ENT_QUOTES
) .
428 "&offset=" . ($offset-$N) . "&" . attr($activity_string_html) . "' onclick='top.restoreSession()'>[" .
429 htmlspecialchars( xl('Previous'), ENT_NOQUOTES
) . "]</a>\n";
435 if ($result_count == $N) {
436 echo " <a class='link' href='pnotes_full.php" .
437 "?docid=" . htmlspecialchars( $docid, ENT_QUOTES
) .
438 "&form_active=" . htmlspecialchars( $form_active, ENT_QUOTES
) .
439 "&form_inactive=" . htmlspecialchars( $form_inactive, ENT_QUOTES
) .
440 "&form_doc_only=" . htmlspecialchars( $form_doc_only, ENT_QUOTES
) .
441 "&offset=" . ($offset+
$N) . "&" . attr($activity_string_html) . "' onclick='top.restoreSession()'>[" .
442 htmlspecialchars( xl('Next'), ENT_NOQUOTES
) . "]</a>\n";
450 <div id
='outbox_div' <?php
echo $outbox_style; ?
> >
451 <table border
='0' cellpadding
="1" class="text">
452 <?php
if ($result_sent != ""): ?
>
454 <td colspan
='5' style
="padding: 5px;" >
455 <a href
="pnotes_full.php?s=1&<?php echo attr($activity_string_html);?>" class="" id
='Submit'><span
><?php
echo htmlspecialchars( xl('Refresh'), ENT_NOQUOTES
); ?
></span
></a
>
460 <table border
='0' cellpadding
="1" class="text" width
= "80%">
462 // display all of the notes for the day, as well as others that are active
463 // from previous dates, up to a certain number, $N
465 if ($result_sent != "") {
466 echo " <tr class=showborder_head align='left'>\n";
467 echo " <th style='width:100px';> </th>\n";
468 echo " <th>" . htmlspecialchars( xl('Active'), ENT_NOQUOTES
) . " </th>\n";
469 echo " <th>" . ($docid ?
htmlspecialchars( xl('Linked'), ENT_NOQUOTES
) : '') . "</th>\n";
470 echo " <th>" . htmlspecialchars( xl('Type'), ENT_NOQUOTES
) . "</th>\n";
471 echo " <th>" . htmlspecialchars( xl('Content'), ENT_NOQUOTES
) . "</th>\n";
474 $result_sent_count = 0;
475 foreach ($result_sent as $iter) {
476 $result_sent_count++
;
477 $row_note_id = $iter['id'];
481 if (isGpRelation(1, $docid, 6, $row_note_id)) {
485 // Skip unlinked notes if that is requested.
486 if ($form_doc_only) continue;
490 $body = $iter['body'];
491 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
492 $body = nl2br(htmlspecialchars( oeFormatPatientNote($body), ENT_NOQUOTES
));
494 $body = htmlspecialchars( oeFormatSDFT(strtotime($iter['date'])).date(' H:i', strtotime($iter['date'])), ENT_NOQUOTES
) .
495 ' (' . htmlspecialchars( $iter['user'], ENT_NOQUOTES
) . ') ' . nl2br(htmlspecialchars( oeFormatPatientNote($body), ENT_NOQUOTES
));
497 $body = preg_replace('/(:\d{2}\s\()'.$pid.'(\sto\s)/','${1}'.$patientname.'${2}',$body);
498 if (($iter{"activity"}) && ($iter['message_status'] != "Done") ) {
499 $checked = "checked";
504 // highlight the row if it's been selected for updating
505 if ($_REQUEST['noteid'] == $row_note_id) {
506 echo " <tr height=20 class='noterow highlightcolor' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>\n";
509 echo " <tr class='noterow' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>\n";
513 echo " <td><a href='pnotes_full_add.php?trigger=edit¬eid=".htmlspecialchars( $row_note_id, ENT_QUOTES
).
514 "' class='css_button_small iframe'><span>". htmlspecialchars( xl('Edit'), ENT_NOQUOTES
) ."</span></a>\n";
516 // display, or not, a button to delete the note
517 // if the user is an admin or if they are the author of the note, they can delete it
518 if (($iter['user'] == $_SESSION['authUser']) ||
(acl_check('admin','super','','write'))) {
519 echo " <a href='#' class='deletenote css_button_small' id='del" . htmlspecialchars( $row_note_id, ENT_QUOTES
) .
520 "' title='" . htmlspecialchars( xl('Delete this note'), ENT_QUOTES
) . "'><span>" .
521 htmlspecialchars( xl('Delete'), ENT_NOQUOTES
) . "</span>\n";
526 echo " <td class='text bold'>\n";
527 echo " <input type='hidden' name='act".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' value='1' />\n";
528 echo " <input type='checkbox' name='chk".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' $checked />\n";
531 echo " <td class='text bold'>\n";
533 echo " <input type='checkbox' name='lnk".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' $linked />\n";
537 echo " <td class='bold notecell' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>" .
538 "<a href='pnotes_full_add.php?trigger=edit¬eid=".htmlspecialchars( $row_note_id, ENT_QUOTES
)."' class='iframe'>\n";
539 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
540 echo generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']);
543 echo " <td class='notecell' id='".htmlspecialchars( $row_note_id, ENT_QUOTES
)."'>\n";
552 print "<tr><td colspan='3' class='text'>" . htmlspecialchars( xl('None'), ENT_NOQUOTES
) . ".</td></tr>\n";
559 <table width
='400' border
='0' cellpadding
='0' cellspacing
='0'>
563 if ($offset_sent > ($M-1)) {
564 echo " <a class='link' href='pnotes_full.php" .
565 "?docid=" . htmlspecialchars( $docid, ENT_QUOTES
) .
567 "&form_active=" . htmlspecialchars( $form_active, ENT_QUOTES
) .
568 "&form_inactive=" . htmlspecialchars( $form_inactive, ENT_QUOTES
) .
569 "&form_doc_only=" . htmlspecialchars( $form_doc_only, ENT_QUOTES
) .
570 "&offset_sent=" . ($offset_sent-$M) . "&" . attr($activity_string_html) . "' onclick='top.restoreSession()'>[" .
571 htmlspecialchars( xl('Previous'), ENT_NOQUOTES
) . "]</a>\n";
577 if ($result_sent_count == $M) {
578 echo " <a class='link' href='pnotes_full.php" .
579 "?docid=" . htmlspecialchars( $docid, ENT_QUOTES
) .
581 "&form_active=" . htmlspecialchars( $form_active, ENT_QUOTES
) .
582 "&form_inactive=" . htmlspecialchars( $form_inactive, ENT_QUOTES
) .
583 "&form_doc_only=" . htmlspecialchars( $form_doc_only, ENT_QUOTES
) .
584 "&offset_sent=" . ($offset_sent+
$M) . "&" . attr($activity_string_html) . "' onclick='top.restoreSession()'>[" .
585 htmlspecialchars( xl('Next'), ENT_NOQUOTES
) . "]</a>\n";
594 <script language
='JavaScript'>
597 if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) {
598 $ndata = getPatientData($pid, "fname, lname, pubpid");
600 parent
.left_nav
.setPatient(<?php
echo "'" . htmlspecialchars( $ndata['fname']." ".$ndata['lname'], ENT_QUOTES
) . "'," .
601 htmlspecialchars( $pid, ENT_QUOTES
) . ",'" . htmlspecialchars( $ndata['pubpid'], ENT_QUOTES
) . "',window.name"; ?
>);
602 parent
.left_nav
.setRadio(window
.name
, 'pno');
606 // If this note references a new patient document, pop up a display
609 if ($noteid /* && $title == 'New Document' */ ) {
610 $prow = getPnoteById($noteid, 'body');
611 if (preg_match('/New scanned document (\d+): [^\n]+\/([^\n]+)/', $prow['body'], $matches)) {
612 $docid = $matches[1];
613 $docname = $matches[2];
615 window
.open('../../../controller.php?document&retrieve&patient_id=<?php echo htmlspecialchars( $pid, ENT_QUOTES); ?>&document_id=<?php echo htmlspecialchars( $docid, ENT_QUOTES); ?>&<?php echo htmlspecialchars( $docname, ENT_QUOTES);?>&as_file=true',
616 '_blank', 'resizable=1,scrollbars=1,width=600,height=500');
624 </div
> <!-- end outer
'pnotes' -->
628 <script language
="javascript">
630 // jQuery stuff to make the page a little easier to use
632 $
(document
).ready(function(){
633 $
("#appendnote").click(function() { AppendNote(); });
634 $
("#newnote").click(function() { NewNote(); });
635 $
("#printnote").click(function() { PrintNote(); });
637 $
(".change_activity").click(function() { top
.restoreSession(); $
("#update_activity").submit(); });
639 $
(".deletenote").click(function() { DeleteNote(this
); });
641 $
(".noterow").mouseover(function() { $
(this
).toggleClass("highlight"); });
642 $
(".noterow").mouseout(function() { $
(this
).toggleClass("highlight"); });
643 $
(".notecell").click(function() { EditNote(this
); });
647 var EditNote
= function(note
) {
648 top
.restoreSession();
649 $
("#noteid").val(note
.id
);
651 $
("#new_note").submit();
654 var NewNote
= function () {
655 top
.restoreSession();
656 $
("#noteid").val('');
657 $
("#new_note").submit();
660 var AppendNote
= function () {
661 top
.restoreSession();
662 $
("#new_note").submit();
665 var PrintNote
= function () {
666 top
.restoreSession();
667 window
.open('pnotes_print.php?noteid=<?php echo htmlspecialchars( $noteid, ENT_QUOTES); ?>', '_blank', 'resizable=1,scrollbars=1,width=600,height=500');
670 var DeleteNote
= function(note
) {
671 if (confirm("<?php echo htmlspecialchars( xl('Are you sure you want to delete this note?','','','\n '), ENT_QUOTES) .
672 htmlspecialchars( xl('This action CANNOT be undone.'), ENT_QUOTES); ?>")) {
673 top
.restoreSession();
674 // strip the 'del' part of the object's ID
675 $
("#noteid").val(note
.id
.replace(/del
/, ""));
676 $
("#mode").val("delete");
677 $
("#new_note").submit();