translation patches from Dr. Bosman and his crew
[openemr.git] / interface / forms / newpatient / view.php
blob56dd357dbe07ed29a10cd453fd024af690f043a0
1 <?
2 include_once("../../globals.php");
3 include_once("$srcdir/acl.inc");
4 include_once("$srcdir/lists.inc");
6 $disabled = "disabled";
8 // If we are allowed to change encounter dates...
9 if (acl_check('encounters', 'date_a')) {
10 $disabled = "";
13 $months = array("01","02","03","04","05","06","07","08","09","10","11","12");
14 $days = array("01","02","03","04","05","06","07","08","09","10","11","12","13","14",
15 "15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
16 $thisyear = date("Y");
17 $years = array($thisyear-1, $thisyear, $thisyear+1, $thisyear+2);
19 $id = $_REQUEST['id'];
21 $result = sqlQuery("SELECT * FROM form_encounter WHERE id = '$id'");
23 $encounter = $result['encounter'];
25 if ($result['sensitivity'] && !acl_check('sensitivities', $result['sensitivity'])) {
26 echo "<body>\n<html>\n";
27 echo "<p>You are not authorized to see this encounter.</p>\n";
28 echo "</body>\n</html>\n";
29 exit();
32 // Sort comparison for sensitivities by their order attribute.
33 function sensitivity_compare($a, $b) {
34 return ($a[2] < $b[2]) ? -1 : 1;
37 // get issues
38 $ires = sqlStatement("SELECT id, type, title, begdate FROM lists WHERE " .
39 "pid = $pid AND enddate IS NULL " .
40 "ORDER BY type, begdate");
43 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
45 <html>
46 <head>
47 <title><?php xl('Patient Encounter','e'); ?></title>
49 <script type="text/javascript" src="../../../library/dialog.js"></script>
50 <script type="text/javascript" src="../../../library/overlib_mini.js"></script>
51 <script type="text/javascript" src="../../../library/calendar.js"></script>
52 <script type="text/javascript" src="../../../library/textformat.js"></script>
54 <script language="JavaScript">
56 var mypcc = '<? echo $GLOBALS['phone_country_code'] ?>';
58 // Process click on issue title.
59 function newissue() {
60 dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 600, 475);
61 return false;
64 // callback from add_edit_issue.php:
65 function refreshIssue(issue, title) {
66 var s = document.forms[0]['issues[]'];
67 s.options[s.options.length] = new Option(title, issue, true, true);
70 </script>
71 </head>
73 <body <?echo $top_bg_line;?> topmargin='0' rightmargin='0' leftmargin='2' bottommargin='0'
74 marginwidth='2' marginheight='0'>
76 <!-- Required for the popup date selectors -->
77 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
79 <form method='post' action="<?echo $rootdir?>/forms/newpatient/save.php" name='new_encounter'
80 <?php if (!$GLOBALS['concurrent_layout']) echo "target='Main'"; ?>>
81 <input type=hidden name='mode' value='update'>
82 <input type=hidden name='id' value='<? echo $_GET["id"] ?>'>
83 <span class=title><?php xl('Patient Encounter Form','e'); ?></span>
84 <br>
85 <center>
86 <table width='96%'>
88 <tr>
89 <td colspan='2' width='50%' nowrap class='text'><?php xl('Chief Complaint:','e'); ?></td>
90 <td class='text' width='50%' nowrap>
91 <?php xl('Issues (Problems, Medications, Surgeries, Allergies):','e'); ?>
92 </td>
93 </tr>
95 <tr>
96 <td colspan='2'>
97 <textarea name='reason' cols='40' rows='4' wrap='virtual' style='width:96%'><? echo htmlspecialchars($result['reason']) ?></textarea>
98 </td>
99 <td rowspan='5' valign='top'>
100 <select multiple name='issues[]' size='10' style='width:100%'
101 title='<?php xl('Hold down [Ctrl] for multiple selections or to unselect','e'); ?>'>
103 while ($irow = sqlFetchArray($ires)) {
104 $list_id = $irow['id'];
105 $tcode = $irow['type'];
106 if ($ISSUE_TYPES[$tcode]) $tcode = $ISSUE_TYPES[$tcode][2];
108 echo " <option value='$list_id'";
109 $perow = sqlQuery("SELECT count(*) AS count FROM issue_encounter WHERE " .
110 "pid = '$pid' AND encounter = '$encounter' AND list_id = '$list_id'");
111 if ($perow['count']) echo " selected";
112 echo ">$tcode: " . $irow['begdate'] . " " .
113 htmlspecialchars(substr($irow['title'], 0, 40)) . "</option>\n";
116 </select>
117 </td>
118 </tr>
120 <tr>
121 <td class='text' width='1%' nowrap><?php xl('Facility:','e'); ?></td>
122 <td>
123 <select name='facility'>
125 $fres = sqlStatement("select * from facility order by name");
126 if ($fres) {
127 $fresult = array();
128 for ($iter = 0; $frow = sqlFetchArray($fres); $iter++)
129 $fresult[$iter] = $frow;
130 foreach($fresult as $iter) {
132 <option value="<?echo $iter{name};?>" <?if ($result{facility} == $iter{name}) echo "selected";?>><?echo $iter{name};?></option>
137 </select>
138 </td>
139 </tr>
141 <tr>
142 <?php
143 $sensitivities = acl_get_sensitivities();
144 if ($sensitivities && count($sensitivities)) {
145 usort($sensitivities, "sensitivity_compare");
147 <td class='text' width='1%' nowrap><?php xl('Sensitivity:','e'); ?></td>
148 <td>
149 <select name='form_sensitivity'>
150 <?php
151 foreach ($sensitivities as $value) {
152 // Omit sensitivities to which this user does not have access.
153 if (acl_check('sensitivities', $value[1])) {
154 echo " <option value='" . $value[1] . "'";
155 if ($result['sensitivity'] == $value[1]) echo " selected";
156 echo ">" . $value[3] . "</option>\n";
159 echo " <option value=''";
160 if (!$result['sensitivity']) echo " selected";
161 echo ">" . xl('None'). "</option>\n";
163 </select>
164 </td>
165 <?php
166 } else {
168 <td colspan='2'><!-- sensitivities not used --></td>
169 <?php
172 </tr>
174 <tr>
175 <td class='text' nowrap><?php xl('Date of Service:','e'); ?></td>
176 <td nowrap>
177 <input type='text' size='10' name='form_date' <? echo $disabled ?>
178 value='<? echo substr($result['date'], 0, 10) ?>'
179 title='<?php xl('yyyy-mm-dd Date of service','e'); ?>'
180 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
181 <a href="javascript:show_calendar('new_encounter.form_date')"
182 title="<?php xl('Click here to choose a date','e'); ?>"
183 ><img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' border='0' alt='[?]'></a>
184 </td>
185 </tr>
187 <tr>
188 <td class='text' nowrap><?php xl('Onset/hospitalization date:','e'); ?></td>
189 <td nowrap>
190 <input type='text' size='10' name='form_onset_date'
191 value='<? echo substr($result['onset_date'], 0, 10) ?>'
192 title='<?php xl('yyyy-mm-dd Date of onset or hospitalization','e'); ?>'
193 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
194 <a href="javascript:show_calendar('new_encounter.form_onset_date')"
195 title="<?php xl('Click here to choose a date','e'); ?>"
196 ><img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' border='0' alt='[?]'></a>
197 </td>
198 </tr>
200 </table>
203 <a href="javascript:document.new_encounter.submit();" class="link_submit">[<?php xl('Save','e'); ?>]</a>
204 &nbsp; &nbsp;
206 <?php if ($GLOBALS['concurrent_layout']) { ?>
207 <a href="<?php echo "$rootdir/patient_file/encounter/encounter_top.php"; ?>"
208 class="link_submit">[<?php xl('Cancel','e'); ?>]</a>
209 <?php } else { ?>
210 <a href="<?php echo "$rootdir/patient_file/encounter/patient_encounter.php"; ?>"
211 class="link_submit" target='Main'>[<?php xl('Cancel','e'); ?>]</a>
212 <?php } ?>
214 &nbsp; &nbsp;
215 <a href="" onclick="return newissue()" class="link_submit">[<?php xl('Add Issue','e'); ?>]</a>
217 </center>
219 </form>
221 </body>
222 </html>