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.php");
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,
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" id
="pill-list" role
="tablist">
65 <li
class="nav-item" role
="presention">
66 <a href
="#encounters" id
="pills-encounters-tab" class="nav-link active" data
-toggle
="pill" type
="button" role
="tab" aria
-controls
="pills-encounters-tab" aria
-selected
="true"><?php
echo xlt('Encounters'); ?
></a
>
68 <li
class="nav-item" role
="presentation">
69 <a href
="#procedures" id
="pills-procedures-tab" class="nav-link" data
-toggle
="pill" type
="button" role
="tab" aria
-controls
="pills-procedures-tab" aria
-selected
="false"><?php
echo xlt('Procedures'); ?
></a
>
73 <div
class="col-sm-12 mt-3">
74 <div
class="tab-content" id
="pills-tabContent">
75 <div
class="tab-pane active" id
="encounters" role
="tabpanel" aria
-labelledby
="encounters-tab">
76 <div
class="table-responsive">
78 $query1 = "SELECT ee.*,CONCAT_WS(' ',u1.lname, u1.fname) AS provider,u2.organization AS facility
79 FROM external_encounters AS ee
80 LEFT JOIN users AS u1 ON u1.id = ee.ee_provider_id
81 LEFT JOIN users AS u2 ON u2.id = ee.ee_facility_id
83 $res1 = sqlStatement($query1, array($pid));
84 while ($row1 = sqlFetchArray($res1)) {
89 <?php
if (count($records1) > 0) : ?
>
90 <table
class="table table-sm">
93 <th
><?php
echo xlt('Date'); ?
></th
>
94 <th
><?php
echo xlt('Diagnosis'); ?
></th
>
95 <th
><?php
echo xlt('Provider'); ?
></th
>
96 <th
><?php
echo xlt('Facility'); ?
></th
>
101 foreach ($records1 as $value1) : ?
>
103 <td
><?php
echo text(oeFormatShortDate($value1['ee_date'])); ?
></td
>
104 <td
><?php
echo text($value1['ee_encounter_diagnosis']); ?
></td
>
105 <td
><?php
echo text($value1['provider']); ?
></td
>
106 <td
><?php
echo text($value1['facility']); ?
></td
>
112 <p
class="text-center">
113 <?php
echo xlt('No External Encounters'); ?
>
118 <div
class="tab-pane" id
="procedures" role
="tabpanel" aria
-labelledby
="proccedures-tab">
119 <div
class="table-responsive">
121 $query2 = "SELECT ep.*,u.organization AS facility FROM external_procedures AS ep LEFT JOIN users AS u ON u.id = ep.ep_facility_id WHERE ep.ep_pid = ?";
122 $res2 = sqlStatement($query2, array($pid));
123 while ($row2 = sqlFetchArray($res2)) {
127 <?php
if (count($records2) > 0) : ?
>
128 <table
class="table table-sm">
131 <th
><?php
echo xlt('Date'); ?
></th
>
132 <th
><?php
echo xlt('Code'); ?
></th
>
133 <th
><?php
echo xlt('Code Text'); ?
></th
>
134 <th
><?php
echo xlt('Facility'); ?
></th
>
139 foreach ($records2 as $value2) : ?
>
141 <td
><?php
echo text(oeFormatShortDate($value2['ep_date'])); ?
></td
>
142 <td
><?php
echo text($value2['ep_code_type'] . ':' . $value2['ep_code']); ?
></td
>
143 <td
><?php
echo text($value2['ep_code_text']); ?
></td
>
144 <td
><?php
echo text($value2['facility']); ?
></td
>
150 <p
class="text-center">
151 <?php
echo xlt('No External Procedures'); ?
>
159 </div
><!--end of container div
-->
160 <?php
$oemr_ui->oeBelowContainerDiv();?
>