Remove unnecissary include of pnotes.inc. This file does not use this API.
[openemr.git] / interface / patient_file / report / full_report.php
blob6023b84c1f4413b09877961a1e9f81505686525a
1 <?php
2 include_once("../../globals.php");
4 include_once("$srcdir/forms.inc");
5 include_once("$srcdir/billing.inc");
6 include_once("$srcdir/patient.inc");
7 include_once("$srcdir/report.inc");
8 include_once("$srcdir/acl.inc");
9 include_once("$srcdir/options.inc.php");
11 // get various authorization levels
12 $auth_notes_a = acl_check('encounters', 'notes_a');
13 $auth_notes = acl_check('encounters', 'notes');
14 $auth_coding_a = acl_check('encounters', 'coding_a');
15 $auth_coding = acl_check('encounters', 'coding');
16 $auth_relaxed = acl_check('encounters', 'relaxed');
17 $auth_med = acl_check('patients' , 'med');
18 $auth_demo = acl_check('patients' , 'demo');
20 if (!isset($_GET["viewnum"])) { $N = 6; }
21 else { $N = $_GET["viewnum"]; }
25 <html>
26 <head>
27 <?php html_header_show();?>
29 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
31 </head>
33 <body class="body_top">
34 <div id="report_custom"> <!-- large outer DIV -->
35 <!--
36 echo "<hr />";
37 echo "<div class='text demographics' id='DEM'>\n";
38 print "<h1>".xl('Patient Data').":</h1>";
39 -->
40 <a href="patient_report.php"><h1 class='title'><?php xl('Patient Record Report','e'); ?></h1><span class='back'><?php echo $tback;?></span></a>
41 <br><br>
42 <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>
44 <br>
46 <div class='demographics'>
47 <h1><?php xl('Patient Data','e'); ?>:</h1>
48 <?php
49 printRecData($patient_data_array, getRecPatientData ($pid), $N);
51 </div>
53 <hr/>
55 <?php if (acl_check('patients', 'med')): ?>
56 <div class='history'>
57 <h1><?php xl('History Data','e'); ?>:</h1>
58 <?php printRecData($history_data_array, getRecHistoryData ($pid), $N); ?>
59 </div>
60 <hr/>
61 <?php endif; ?>
64 <div class='demographics'>
65 <h1><?php xl('Employer Data','e'); ?>:</h1>
66 <?php
67 printRecData($employer_data_array, getRecEmployerData ($pid), $N);
69 </div>
70 <hr/>
73 <div class='insurance'>
74 <h1><?php xl('Insurance Data','e'); ?>:</h1>
75 <span class='bold'><?php xl('Primary Insurance Data','e'); ?>:</span> <br/>
76 <?php
77 printRecData($insurance_data_array, getRecInsuranceData ($pid,"primary"), $N);
79 <br/>
80 <br/>
81 <span class='bold'><?php xl('Secondary Insurance Data','e'); ?>:</span> <br/>
82 <?php
83 printRecData($insurance_data_array, getRecInsuranceData ($pid,"secondary"), $N);
85 <br/>
86 <br/>
87 <span class='bold'><?php xl('Tertiary Insurance Data','e'); ?>:</span> <br/>
88 <?php
89 printRecData($insurance_data_array, getRecInsuranceData ($pid,"tertiary"), $N);
91 </div>
92 <hr/>
94 <!-- Patient Issues -->
95 <?php if (acl_check('patients', 'med')): ?>
96 <div class='issues history'>
97 <h1><?php xl('Issues','e'); ?>:</h1>
98 <br/>
99 <h2><?php xl('Allergies','e'); ?>:</h2>
100 <?php printListData($pid, "allergy", "1") ?>
102 <br/>
103 <h2><?php xl('Medications','e'); ?>:</h2>
104 <?php printListData($pid, "medication", "1") ?>
106 <br/>
107 <h2><?php xl('Medical Problems','e'); ?>:</h2>
108 <?php printListData($pid, "medical_problem", "1") ?>
109 </div>
110 <hr/>
112 <div class='issues history'>
113 <h1><?php xl('Immunizations','e'); ?>:</h1>
114 <?php
115 $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";
117 $result = sqlStatement($sql);
118 while ($row=sqlFetchArray($result)){
119 echo "<span class=text> " . $row{'immunization_data'} .
120 generate_display_field(array('data_type'=>'1','list_id'=>'immunizations'), $row['immunization_id']) .
121 "</span><br>\n";
124 </div>
125 <hr>
127 <?php endif; // end patient-issues ?>
129 <!-- Patient communications -->
130 <div class='communications'>
131 <h1><?php xl('Patient Comunication Sent','e'); ?>:</h1>
132 <?php
133 $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'";
134 // echo $sql;
135 $result = sqlStatement($sql);
136 while ($row=sqlFetchArray($result)) {
137 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";
140 </div>
141 <hr/>
143 <div class='notes'>
144 <h1><?php xl('Patient Notes','e'); ?>:</h1>
145 <?php printPatientNotes($pid); ?>
146 </div>
147 <hr>
149 <?php if (acl_check('acct', 'rep') || acl_check('acct', 'eob') || acl_check('acct', 'bill')) : ?>
150 <div class='billing'>
151 <h1><?php xl('Billing','e'); ?>:</h1>
152 <?php printPatientBilling($pid); ?>
153 </div>
154 <hr>
155 <?php endif; ?>
157 <div class='transactions'>
158 <h1><?php xl('Transactions','e'); ?>:</h1>
159 <?php printPatientTransactions($pid); ?>
160 </div>
161 <hr>
163 <!-- Encounters and Forms -->
164 <?php if (($auth_notes_a || $auth_notes || $auth_coding_a || $auth_coding || $auth_med || $auth_relaxed)): ?>
165 <div class='encounters'>
166 <h1><?php xl('Encounters & Forms','e'); ?>:</h1>
167 <?php printPatientForms($pid, $N); ?>
168 </div>
169 <?php endif; ?>
171 </div> <!-- close large outer DIV -->
172 </body>
173 </html>