4 * Viewing of office notes.
7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../../globals.php");
15 use OpenEMR\Common\Acl\AclMain
;
16 use OpenEMR\Common\Twig\TwigContainer
;
17 use OpenEMR\Core\Header
;
18 use OpenEMR\Services\ONoteService
;
21 if (!AclMain
::aclCheckCore('encounters', 'notes')) {
22 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Office Notes")]);
26 //display all of the notes for the day, as well as others that are active from previous dates, up to a certain number, $N
29 $oNoteService = new ONoteService();
35 <?php Header
::setupHeader(); ?
>
38 <body
class="body_top">
40 <div id
="officenotes_list">
41 <a href
="office_comments_full.php" onclick
='top.restoreSession()'>
42 <font
class="title"><?php
echo xlt('Office Notes'); ?
></font
>
43 <font
class="more"><?php
echo text($tmore);?
></font
></a
>
47 <table border
=0 width
=100%
>
51 $notes = $oNoteService->getNotes(1, 0, ($N +
1));
53 //retrieve all active notes
55 $notes_count = 0;//number of notes so far displayed
56 foreach ($notes as $note) {
57 if ($notes_count >= $N) {
58 //we have more active notes to print, but we've reached our display maximum (defined at top of this file)
60 $notice .= '<div class="alert alert-info">';
61 $notice .= ' <a href=\'office_comments_full.php?active=-1\' onclick=\'top.restoreSession()\'>' . xlt("Some office notes were not displayed. Click here to view all.") . '</a>';
67 $date = (new DateTime($note['date']))->format('Y-m-d');
69 $todaysDate = new DateTime();
70 if ($todaysDate->format('Y-m-d') == $date) {
71 $date_string = xl("Today") . ", " . oeFormatShortDate($date);
73 $date_string = oeFormatShortDate($date);
77 $card .= '<div class="card panel-default">';
78 $card .= ' <div class="card-heading">';
79 $card .= ' <h3 class="card-title">' . text($date_string) . ' <strong>(' . text($note['user']) . ')</strong></h3>';
81 $card .= ' <div class="card-body">';
82 $card .= nl2br(text($note['body']));