* @author Vinish K * @author Brady Miller * @author Jerry Padgett * @author Stephen Nielson * @copyright Copyright (c) 2015 Z&H Consultancy Services Private Limited * @copyright Copyright (c) 2017-2019 Brady Miller * @copyright Copyright (c) 2021 * @copyright Copyright (c) 2021 Stephen Nielson * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once("../../globals.php"); require_once("$srcdir/api.inc"); require_once("$srcdir/patient.inc"); require_once("$srcdir/options.inc.php"); require_once($GLOBALS['srcdir'] . '/csv_like_join.php'); use OpenEMR\Common\Csrf\CsrfUtils; use OpenEMR\Common\Uuid\UuidRegistry; use OpenEMR\Core\Header; use OpenEMR\Services\ClinicalNotesService; $returnurl = 'encounter_top.php'; $formid = (int) ($_GET['id'] ?? 0); $clinicalNotesService = new ClinicalNotesService(); if (empty($formid)) { $sql = "SELECT form_id, encounter FROM `forms` WHERE formdir = 'clinical_notes' AND pid = ? AND encounter = ? AND deleted = 0 LIMIT 1"; $formid = sqlQuery($sql, array($_SESSION["pid"], $_SESSION["encounter"]))['form_id'] ?? 0; if (!empty($formid)) { echo ""; } } if ($formid) { $records = $clinicalNotesService->getClinicalNotesForPatientForm($formid, $_SESSION['pid'], $_SESSION['encounter']) ?? []; $check_res = []; foreach ($records as $record) { // we are only going to include active clinical notes, but we leave them as historical records in the system // FHIR and other resources still refer to them, they will just be marked as inactive... if ($record['activity'] == ClinicalNotesService::ACTIVITY_ACTIVE) { $record['uuid'] = UuidRegistry::uuidToString($record['uuid']); $check_res[] = $record; } } } else { $check_res = [ [ 'id' => 0 ,'code' => '' ,'codetext' => '' ,'clinical_notes_type' => '' ,'description' => '' ] ]; } $clinical_notes_type = $clinicalNotesService->getClinicalNoteTypes(); $clinical_notes_category = $clinicalNotesService->getClinicalNoteCategories(); ?> <?php echo xlt("Clinical Notes Form"); ?>

$obj) { $context = ""; ?>
" /> " /> " />
' title='' />