Merge pull request #7442 from juggernautsei/claimrev-module-manager
[openemr.git] / portal / get_profile.php
blob8eab1c1cf8cc1c868c9ae094f4c1c7feafe6ccd4
1 <?php
3 /**
5 * Copyright (C) 2016-2021 Jerry Padgett <sjpadgett@gmail.com>
6 * Copyright (C) 2020 Tyler Wrenn <tyler@tylerwrenn.com>
8 * LICENSE: This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @package OpenEMR
20 * @author Jerry Padgett <sjpadgett@gmail.com>
21 * @author Tyler Wrenn <tyler@tylerwrenn.com>
22 * @link http://www.open-emr.org
26 //namespace OnsitePortal;
28 require_once("verify_session.php");
29 require_once("./../library/report.inc.php");
30 require_once("./../library/options.inc.php");
31 require_once("./../library/lists.inc.php");
32 require_once("./../custom/code_types.inc.php");
33 require_once("./../library/forms.inc.php");
34 require_once("./../library/patient.inc.php");
36 require_once("./lib/appsql.class.php");
38 $appsql = new ApplicationTable();
39 $pending = $appsql->getPortalAudit($pid, 'review');
40 $N = 7;
43 <style>
44 .insurance .table .bold {
45 font-weight: normal;
48 .insurance .table .text {
49 color: var(--danger);
52 .demographics .groupname.bold {
53 font-size: 1rem;
54 color: var(--primary);
57 .demographics table .bold {
58 font-weight: normal;
59 border-top: 0;
62 .demographics table .text {
63 font-weight: normal;
64 color: var(--danger);
67 .demographics .table td {
68 border-top: 0;
71 </style>
72 <body>
74 <div class='demographics table-responsive' id='DEM'>
76 <?php
77 $result1 = getPatientData($pid);
78 $result2 = getEmployerData($pid);
80 <div class="card">
81 <header class="card-header border border-bottom-0"><?php echo xlt('Profile Demographics'); ?>
82 <?php if ($pending) {
83 echo '<button type="button" id="editDems" class="btn btn-danger btn-sm float-right text-white">' . xlt('Pending Review') . '</button>';
84 } else {
85 echo '<button type="button" id="editDems" class="btn btn-success btn-sm float-right text-white">' . xlt('Revise') . '</button>';
88 </header>
89 <div class="card-body border" id="dempanel">
90 <table class='table table-responsive table-sm'>
91 <?php
92 display_layout_rows('DEM', $result1, $result2);
94 </table>
95 </div>
96 </div>
97 </div>
98 <div class='insurance table-sm table-responsive'>
99 <div class="card">
100 <header class="card-header border border-bottom-0"><?php echo xlt('Primary Insurance');?></header>
101 <div class="card-body border">
102 <?php
103 printRecDataOne($insurance_data_array, getRecInsuranceData($pid, "primary"), $N);
105 </div>
106 </div>
107 <div class="card">
108 <header class="card-header border border-bottom-0"><?php echo xlt('Secondary Insurance');?></header>
109 <div class="card-body border">
110 <?php
111 printRecDataOne($insurance_data_array, getRecInsuranceData($pid, "secondary"), $N);
112 ?></div>
113 </div>
114 <div class="card">
115 <header class="card-header border border-bottom-0"><?php echo xlt('Tertiary Insurance');?></header>
116 <div class="card-body border">
117 <?php
118 printRecDataOne($insurance_data_array, getRecInsuranceData($pid, "tertiary"), $N);
119 ?></div>
120 </div>
121 </div>
122 <div>
123 <?php
124 echo "<div class='card'>";
125 echo "<header class='card-header border border-bottom-0 immunizations'>" . xlt('Patient Immunization') . '</header>';
126 echo "<div class='card-body border'>";
128 $query = "SELECT im.*, cd.code_text, DATE(administered_date) AS administered_date,
129 DATE_FORMAT(administered_date,'%m/%d/%Y') AS administered_formatted, lo.title as route_of_administration,
130 u.title, u.fname, u.mname, u.lname, u.npi, u.street, u.streetb, u.city, u.state, u.zip, u.phonew1,
131 f.name, f.phone, lo.notes as route_code
132 FROM immunizations AS im
133 LEFT JOIN codes AS cd ON cd.code = im.cvx_code
134 JOIN code_types AS ctype ON ctype.ct_key = 'CVX' AND ctype.ct_id=cd.code_type
135 LEFT JOIN list_options AS lo ON lo.list_id = 'drug_route' AND lo.option_id = im.route
136 LEFT JOIN users AS u ON u.id = im.administered_by_id
137 LEFT JOIN facility AS f ON f.id = u.facility_id
138 WHERE im.patient_id=?";
139 $result = $appsql->zQuery($query, array($pid));
140 $records = array();
141 foreach ($result as $row) {
142 $records[] = $row;
144 foreach ($records as $row) {
145 echo text($row['administered_formatted']) . ' : ';
146 echo text($row['code_text']) . ' : ';
147 echo text($row['note']) . ' : ';
148 echo text($row['completion_status']) . '<br />';
150 echo "</div></div>";
152 </div>
154 </body>