simplified adding/removing issue types and added dental as a type
[openemr.git] / interface / patient_file / summary / stats.php
blob229f7cf9dd2b327d0854c61fd4d7c3f3eebcc58e
1 <?
2 include_once("../../globals.php");
3 include_once("$srcdir/lists.inc");
4 include_once("$srcdir/acl.inc");
5 ?>
6 <html>
8 <head>
9 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
10 <style>
11 .link {
12 font-family: sans-serif;
13 text-decoration: none;
14 color: #000000;
15 font-size: 8pt;
17 </style>
18 </head>
20 <body <?echo $bottom_bg_line;?> topmargin='0' rightmargin='0' leftmargin='2'
21 bottommargin='0' marginwidth='2' marginheight='0'>
24 $thisauth = acl_check('patients', 'med');
25 if ($thisauth) {
26 $tmp = getPatientData($pid, "squad");
27 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
28 $thisauth = 0;
30 if (!$thisauth) {
31 echo "<p>(Issues not authorized)</p>\n";
32 echo "</body>\n</html>\n";
33 exit();
37 <table >
40 foreach ($ISSUE_TYPES as $key => $arr) {
41 echo " <tr>\n";
42 echo " <td width='20%' valign='top'>\n";
43 echo " <a href='stats_full.php?active=all' target='Main'><font class='title'>" .
44 $arr[0] . "</font><font class='more'>$tmore</font></a><br>\n";
45 if ($result = getListByType($pid, $key, "id,title,comments", 1, "all", 0)) {
46 foreach ($result as $iter) {
47 echo "<a class='link' target='Main' href='stats_full.php?active=1'>" .
48 $iter['title'] . "</a><br>\n";
51 echo " </td>\n";
52 echo " </tr>\n";
56 <tr>
57 <td width="20%" valign="top">
58 <a href="immunizations.php" target="Main"><font class="title">Immunizations</font><font class=more><?echo $tmore;?></font></a><br>
59 <?$sql = "select if(i1.administered_date
60 ,concat(i1.administered_date,' - ',i2.name)
61 ,substring(i1.note,1,20)
62 ) as immunization_data
63 from immunizations i1
64 left join immunization i2
65 on i1.immunization_id = i2.id
66 where i1.patient_id = $pid
67 order by administered_date desc";
69 $result = sqlStatement($sql);
71 while ($row=sqlFetchArray($result)){
72 echo "<a class=link target=Main href='immunizations.php'>" . $row{'immunization_data'} . "</a><br>\n";
75 </td>
76 </tr>
77 <tr>
78 <td width="20%" valign="top">
80 $cwd= getcwd();
81 chdir("../../../");
82 require_once("library/classes/Controller.class.php");
83 $c = new Controller();
84 echo '<font class="title">Prescriptions</font>';
85 echo $c->act(array("prescription" => "", "block" => "", "patient_id" => $pid));
87 </td>
88 </tr>
89 </table>
91 </body>
92 </html>