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