Revert "Contributed GYM Forms, some of the table.sql files include inserts into list_...
[openemr.git] / interface / patient_file / report / full_report.php
blobe014581b416989a80e0a0a339beacc0ae5681134
1 <?php
2 include_once("../../globals.php");
4 include_once("$srcdir/forms.inc");
5 include_once("$srcdir/billing.inc");
6 include_once("$srcdir/pnotes.inc");
7 include_once("$srcdir/patient.inc");
8 include_once("$srcdir/report.inc");
9 include_once("$srcdir/acl.inc");
10 include_once("$srcdir/options.inc.php");
12 // get various authorization levels
13 $auth_notes_a = acl_check('encounters', 'notes_a');
14 $auth_notes = acl_check('encounters', 'notes');
15 $auth_coding_a = acl_check('encounters', 'coding_a');
16 $auth_coding = acl_check('encounters', 'coding');
17 $auth_relaxed = acl_check('encounters', 'relaxed');
18 $auth_med = acl_check('patients' , 'med');
19 $auth_demo = acl_check('patients' , 'demo');
21 if (!isset($_GET["viewnum"])) { $N = 6; }
22 else { $N = $_GET["viewnum"]; }
26 <html>
27 <head>
28 <?php html_header_show();?>
30 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
32 </head>
34 <body class="body_top">
35 <div id="report_custom"> <!-- large outer DIV -->
36 <!--
37 echo "<hr />";
38 echo "<div class='text demographics' id='DEM'>\n";
39 print "<h1>".xl('Patient Data').":</h1>";
40 -->
41 <a href="patient_report.php"><h1 class='title'><?php xl('Patient Record Report','e'); ?></h1><span class='back'><?php echo $tback;?></span></a>
42 <br><br>
43 <a href="full_report.php?viewnum=6" class=link_submit>[<?php xl('Normal View','e'); ?>]</a><a href="full_report.php?viewnum=1" class=link_submit>[<?php xl('Expanded View','e'); ?>]</a><br>
45 <br>
47 <div class='demographics'>
48 <h1><?php xl('Patient Data','e'); ?>:</h1>
49 <?php
50 printRecData($patient_data_array, getRecPatientData ($pid), $N);
52 </div>
54 <hr/>
56 <?php if (acl_check('patients', 'med')): ?>
57 <div class='history'>
58 <h1><?php xl('History Data','e'); ?>:</h1>
59 <?php printRecData($history_data_array, getRecHistoryData ($pid), $N); ?>
60 </div>
61 <hr/>
62 <?php endif; ?>
65 <div class='demographics'>
66 <h1><?php xl('Employer Data','e'); ?>:</h1>
67 <?php
68 printRecData($employer_data_array, getRecEmployerData ($pid), $N);
70 </div>
71 <hr/>
74 <div class='insurance'>
75 <h1><?php xl('Insurance Data','e'); ?>:</h1>
76 <span class='bold'><?php xl('Primary Insurance Data','e'); ?>:</span> <br/>
77 <?php
78 printRecData($insurance_data_array, getRecInsuranceData ($pid,"primary"), $N);
80 <br/>
81 <br/>
82 <span class='bold'><?php xl('Secondary Insurance Data','e'); ?>:</span> <br/>
83 <?php
84 printRecData($insurance_data_array, getRecInsuranceData ($pid,"secondary"), $N);
86 <br/>
87 <br/>
88 <span class='bold'><?php xl('Tertiary Insurance Data','e'); ?>:</span> <br/>
89 <?php
90 printRecData($insurance_data_array, getRecInsuranceData ($pid,"tertiary"), $N);
92 </div>
93 <hr/>
95 <!-- Patient Issues -->
96 <?php if (acl_check('patients', 'med')): ?>
97 <div class='issues history'>
98 <h1><?php xl('Issues','e'); ?>:</h1>
99 <br/>
100 <h2><?php xl('Allergies','e'); ?>:</h2>
101 <?php printListData($pid, "allergy", "1") ?>
103 <br/>
104 <h2><?php xl('Medications','e'); ?>:</h2>
105 <?php printListData($pid, "medication", "1") ?>
107 <br/>
108 <h2><?php xl('Medical Problems','e'); ?>:</h2>
109 <?php printListData($pid, "medical_problem", "1") ?>
110 </div>
111 <hr/>
113 <div class='issues history'>
114 <h1><?php xl('Immunizations','e'); ?>:</h1>
115 <?php
116 $sql = "select i1.immunization_id as immunization_id, if(i1.administered_date,concat(i1.administered_date,' - ') ,substring(i1.note,1,20) ) as immunization_data from immunizations i1 where i1.patient_id = $pid order by administered_date desc";
118 $result = sqlStatement($sql);
119 while ($row=sqlFetchArray($result)){
120 echo "<span class=text> " . $row{'immunization_data'} .
121 generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']) .
122 "</span><br>\n";
125 </div>
126 <hr>
128 <?php endif; // end patient-issues ?>
130 <!-- Patient communications -->
131 <div class='communications'>
132 <h1><?php xl('Patient Comunication Sent','e'); ?>:</h1>
133 <?php
134 $sql="SELECT concat( 'Messsage Type: ', batchcom.msg_type, ', Message Subject: ', batchcom.msg_subject, ', Sent on:', batchcom.msg_date_sent ) AS batchcom_data, batchcom.msg_text, concat( users.fname, users.lname ) AS user_name FROM `batchcom` JOIN `users` ON users.id = batchcom.sent_by WHERE batchcom.patient_id='$pid'";
135 // echo $sql;
136 $result = sqlStatement($sql);
137 while ($row=sqlFetchArray($result)) {
138 echo "<tr><td><span class=text>".$row{'batchcom_data'}.", By: ".$row{'user_name'}."</td></tr><tr><td>Text:<br> ".$row{'msg_txt'}."</span></td></tr>\n";
141 </div>
142 <hr/>
144 <div class='notes'>
145 <h1><?php xl('Patient Notes','e'); ?>:</h1>
146 <?php printPatientNotes($pid); ?>
147 </div>
148 <hr>
150 <?php if (acl_check('acct', 'rep') || acl_check('acct', 'eob') || acl_check('acct', 'bill')) : ?>
151 <div class='billing'>
152 <h1><?php xl('Billing','e'); ?>:</h1>
153 <?php printPatientBilling($pid); ?>
154 </div>
155 <hr>
156 <?php endif; ?>
158 <div class='transactions'>
159 <h1><?php xl('Transactions','e'); ?>:</h1>
160 <?php printPatientTransactions($pid); ?>
161 </div>
162 <hr>
164 <!-- Encounters and Forms -->
165 <?php if (($auth_notes_a || $auth_notes || $auth_coding_a || $auth_coding || $auth_med || $auth_relaxed)): ?>
166 <div class='encounters'>
167 <h1><?php xl('Encounters & Forms','e'); ?>:</h1>
168 <?php printPatientForms($pid, $N); ?>
169 </div>
170 <?php endif; ?>
172 </div> <!-- close large outer DIV -->
173 </body>
174 </html>