} //Display what the patient owes $balance = get_patient_balance($patient_id); if ($balance != "0") { $formatted = sprintf(xl('$') . '%01.2f', $balance); echo " <tr class='text billing'>\n"; echo " <td>" . $colorbeg . htmlspecialchars(xl('Balance Due'), ENT_NOQUOTES) . $colorend . "</td><td>" . $colorbeg . htmlspecialchars($formatted, ENT_NOQUOTES) . $colorend . "</td>\n"; echo " </tr>\n"; } if ($billing_note) { echo " <tr class='text billing'>\n"; echo " <td>" . $colorbeg . htmlspecialchars(xl('Billing Note'), ENT_NOQUOTES) . $colorend . "</td><td>" . $colorbeg . htmlspecialchars($billing_note, ENT_NOQUOTES) . $colorend . "</td>\n"; echo " </tr>\n"; } //retrieve all active notes $result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to", $patient_id, "all", 0, '', $docid, '', $orderid); if ($result != null) { $notes_count = 0; //number of notes so far displayed foreach ($result as $iter) { if ($notes_count >= $N) { //we have more active notes to print, but we've reached our display maximum echo " <tr>\n"; echo " <td colspan='3' align='center'>\n"; echo " <a "; if (!$GLOBALS['concurrent_layout']) { echo "target='Main' "; } echo "href='pnotes_full.php?active=1&{$urlparms}" . "' class='alert' onclick='top.restoreSession()'>"; echo htmlspecialchars(xl('Some notes were not displayed.', '', '', ' '), ENT_NOQUOTES) . htmlspecialchars(xl('Click here to view all.'), ENT_NOQUOTES) . "</a>\n"; echo " </td>\n";
} } $title = ''; $assigned_to = $_SESSION['authUser']; if ($noteid) { $prow = getPnoteById($noteid, 'title,assigned_to,body'); $title = $prow['title']; $assigned_to = $prow['assigned_to']; } // Get the users list. The "Inactive" test is a kludge, we should create // a separate column for this. $ures = sqlStatement("SELECT username, fname, lname FROM users " . "WHERE username != '' AND active = 1 AND " . "( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "ORDER BY lname, fname"); $pres = getPatientData($patient_id, "lname, fname"); $patientname = $pres['lname'] . ", " . $pres['fname']; //retrieve all notes $result = getPnotesByDate("", $active, 'id,date,body,user,activity,title,assigned_to,message_status', $patient_id, $N, $offset, '', $docid, '', $orderid); $result_sent = getSentPnotesByDate("", $active, 'id,date,body,user,activity,title,assigned_to,message_status', $patient_id, $M, $offset_sent, '', $docid, '', $orderid); ?> <html> <head> <?php html_header_show(); ?> <link rel='stylesheet' href="<?php echo $css_header; ?> " type="text/css"> <!-- supporting javascript code -->
} $noteid = ''; } } $title = ''; $assigned_to = $_SESSION['authUser']; if ($noteid) { $prow = getPnoteById($noteid, 'title,assigned_to,body'); $title = $prow['title']; $assigned_to = $prow['assigned_to']; } // Get the users list. The "Inactive" test is a kludge, we should create // a separate column for this. $ures = sqlStatement("SELECT username, fname, lname FROM users " . "WHERE username != '' AND active = 1 AND " . "( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "ORDER BY lname, fname"); //retrieve all notes $result = getPnotesByDate("", $active, 'id,date,body,user,activity,title,assigned_to', $pid, $N, $offset); ?> <html> <head> <?php html_header_show(); ?> <link rel='stylesheet' href="<?php echo $css_header; ?> " type="text/css"> <!-- supporting javascript code --> <script type="text/javascript" src="<?php
if ($thisauth) { $tmp = getPatientData($pid, "squad"); if ($tmp['squad'] && !acl_check('squads', $tmp['squad'])) { $thisauth = 0; } } if (!$thisauth) { echo "<p>(" . htmlspecialchars(xl('Notes not authorized'), ENT_NOQUOTES) . ")</p>\n"; } else { ?> <table width='100%' border='0' cellspacing='1' cellpadding='1' style='border-collapse:collapse;' > <?php $pres = getPatientData($pid, "lname, fname"); $patientname = $pres['lname'] . ", " . $pres['fname']; //retrieve all active notes $result = getPnotesByDate("", 1, "id,date,body,user,title,assigned_to,message_status", $pid, "{$N}", 0, '', $docid); if ($result != null) { $notes_count = 0; //number of notes so far displayed echo "<tr class='text' style='border-bottom:2px solid #000;' >\n"; echo "<td valign='top' class='text' ><b>" . htmlspecialchars(xl('From'), ENT_NOQUOTES) . "</b></td>\n"; echo "<td valign='top' class='text' ><b>" . htmlspecialchars(xl('Date'), ENT_NOQUOTES) . "</b></td>\n"; echo "<td valign='top' class='text' ><b>" . htmlspecialchars(xl('Subject'), ENT_NOQUOTES) . "</b></td>\n"; echo "<td valign='top' class='text' ><b>" . htmlspecialchars(xl('Content'), ENT_NOQUOTES) . "</b></td>\n"; echo "<td valign='top' class='text' ><b>" . htmlspecialchars(xl('Status'), ENT_NOQUOTES) . "</b></td>\n"; echo "</tr>\n"; foreach ($result as $iter) { $has_note = 1; $body = $iter['body']; if (preg_match('/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d\\:\\d\\d /', $body)) { $body = nl2br(htmlspecialchars(oeFormatPatientNote($body), ENT_NOQUOTES));
* @package OpenEMR * @author Karl Englund <*****@*****.**> * @link http://www.open-emr.org */ header("Content-Type:text/xml"); $ignoreAuth = true; require_once 'classes.php'; $xml_array = array(); $token = $_POST['token']; $patient_id = $_POST['patientId']; $active = isset($_POST['active']) ? $_POST['active'] : 1; if ($userId = validateToken($token)) { $username = getUsername($userId); $acl_allow = acl_check('patients', 'notes', $username); if ($acl_allow) { $patient_data = getPnotesByDate("", $active, 'id,date,body,user,activity,title,assigned_to,message_status', $patient_id); if ($patient_data) { $xml_array['status'] = 0; $xml_array['reason'] = 'The Patient notes has been fetched successfully'; foreach ($patient_data as $key => $patientnote) { $xml_array['patientnote' . $key]['id'] = $patientnote['id']; $xml_array['patientnote' . $key]['date'] = $patientnote['date']; $xml_array['patientnote' . $key]['body'] = $patientnote['body']; $xml_array['patientnote' . $key]['user'] = $patientnote['user']; $xml_array['patientnote' . $key]['activity'] = $patientnote['activity']; $xml_array['patientnote' . $key]['title'] = $patientnote['title']; $xml_array['patientnote' . $key]['assigned_to'] = $patientnote['assigned_to']; $xml_array['patientnote' . $key]['message_status'] = $patientnote['message_status']; } } else { $xml_array['status'] = -1;