7 * @link http://www.open-emr.org
8 * @author Jacob T Paul <jacob@zhservices.com>
9 * @author Vinish K <vinish@zhservices.com>
10 * @author Brady Miller <brady.g.miller@gmail.com>
11 * @copyright Copyright (c) 2015 Z&H Consultancy Services Private Limited <sam@zhservices.com>
12 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
13 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
16 require_once("../globals.php");
17 require_once("$srcdir/patient.inc");
18 require_once "$srcdir/options.inc.php";
20 use OpenEMR\Core\Header
;
21 use OpenEMR\Menu\PatientMenuRole
;
22 use OpenEMR\OeUI\OemrUI
;
29 <?php Header
::setupHeader();?
>
30 <title
><?php
echo xlt('External Data'); ?
></title
>
31 <script
><?php
require_once("$include_root/patient_file/erx_patient_portal_js.php"); // jQuery for popups for eRx and patient portal ?></script>
33 $arrOeUiSettings = array(
34 'heading_title' => xl('External Data'),
35 'include_patient_name' => true,
36 'expandable' => false,
37 'expandable_files' => array("external_data_patient_xpd", "stats_full_patient_xpd", "patient_ledger_patient_xpd"),//all file names need suffix _xpd
38 'action' => "",//conceal, reveal, search, reset, link or back
40 'action_href' => "",//only for actions - reset, link or back
41 'show_help_icon' => false,
42 'help_file_name' => "external_data_dashboard_help.php"
44 $oemr_ui = new OemrUI($arrOeUiSettings);
48 <div id
="container_div" class="<?php echo $oemr_ui->oeContainer();?> mt-3">
50 <div
class="col-sm-12">
52 require_once("$include_root/patient_file/summary/dashboard_header.php")
57 $list_id = "external_data"; // to indicate nav item is active, count and give correct id
58 // Collect the patient menu then build it
59 $menuPatient = new PatientMenuRole();
60 $menuPatient->displayHorizNavBarMenu();
62 <div
class="row mt-3">
63 <div
class="col-sm-12">
64 <ul
class="nav nav-pills">
65 <li
class="nav-item" id
="btnEncounters">
66 <a href
="#" class="nav-link font-weight-bold active"><?php
echo xlt('Encounters'); ?
></a
>
68 <li
class="nav-item" id
="btnProcedures">
69 <a href
="#" class="nav-link font-weight-bold"><?php
echo xlt('Procedures'); ?
></a
>
73 <div
class="col-sm-12 mt-3">
74 <div
class="table-responsive jumbotron py-4" id
="encounters">
77 <td
><?php
echo xlt('Date'); ?
></td
>
78 <td
><?php
echo xlt('Diagnosis'); ?
></td
>
79 <td
><?php
echo xlt('Provider'); ?
></td
>
80 <td
><?php
echo xlt('Facility'); ?
></td
>
83 $query1 = "SELECT ee.*,CONCAT_WS(' ',u1.lname, u1.fname) AS provider,u2.organization AS facility
84 FROM external_encounters AS ee
85 LEFT JOIN users AS u1 ON u1.id = ee.ee_provider_id
86 LEFT JOIN users AS u2 ON u2.id = ee.ee_facility_id
88 $res1 = sqlStatement($query1, array($pid));
89 while ($row1 = sqlFetchArray($res1)) {
93 foreach ($records1 as $value1) {
96 <td
><?php
echo text(oeFormatShortDate($value1['ee_date'])); ?
></td
>
97 <td
><?php
echo text($value1['ee_encounter_diagnosis']); ?
></td
>
98 <td
><?php
echo text($value1['provider']); ?
></td
>
99 <td
><?php
echo text($value1['facility']); ?
></td
>
104 <?php
if (empty($records1)) { ?
>
105 <p
class="text-center">
106 <?php
echo xlt('Nothing to display'); ?
>
110 <div
class="table-responsive jumbotron py-4" id
="procedures">
111 <table
class="table">
113 <td
><?php
echo xlt('Date'); ?
></td
>
114 <td
><?php
echo xlt('Code'); ?
></td
>
115 <td
><?php
echo xlt('Code Text'); ?
></td
>
116 <td
><?php
echo xlt('Facility'); ?
></td
>
119 $query2 = "SELECT ep.*,u.organization AS facility
120 FROM external_procedures AS ep
121 LEFT JOIN users AS u ON u.id = ep.ep_facility_id
122 WHERE ep.ep_pid = ?";
123 $res2 = sqlStatement($query2, array($pid));
124 while ($row2 = sqlFetchArray($res2)) {
128 foreach ($records2 as $value2) { ?
>
130 <td
><?php
echo text(oeFormatShortDate($value2['ep_date'])); ?
></td
>
131 <td
><?php
echo text($value2['ep_code_type'] . ':' . $value2['ep_code']); ?
></td
>
132 <td
><?php
echo text($value2['ep_code_text']); ?
></td
>
133 <td
><?php
echo text($value2['facility']); ?
></td
>
138 <?php
if (empty($records2)) { ?
>
139 <p
class="text-center">
140 <?php
echo xlt('Nothing to display'); ?
>
146 </div
><!--end of container div
-->
147 <?php
$oemr_ui->oeBelowContainerDiv();?
>
149 var listId
= '#' +
<?php
echo js_escape($list_id); ?
>;
151 $
(listId
).addClass("active");
155 $
('.nav-link').click(function() {
156 $
('.nav-link').removeClass("active");
157 $
(this
).addClass("active");
160 $
('#btnEncounters').click(function() {
161 $
('#encounters').show();
162 $
('#procedures').hide();
165 $
('#btnProcedures').click(function() {
166 $
('#procedures').show();
167 $
('#encounters').hide();
170 $
('#encounters').hide();