2 $months = array("01","02","03","04","05","06","07","08","09","10","11","12");
3 $days = array("01","02","03","04","05","06","07","08","09","10","11","12","13","14",
4 "15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
6 $years = array($thisyear-1, $thisyear, $thisyear+
1, $thisyear+
2);
10 $result = sqlQuery("SELECT * FROM form_encounter WHERE id = '$id'");
11 $encounter = $result['encounter'];
12 if ($result['sensitivity'] && !acl_check('sensitivities', $result['sensitivity'])) {
13 echo "<body>\n<html>\n";
14 echo "<p>You are not authorized to see this encounter.</p>\n";
15 echo "</body>\n</html>\n";
20 // Sort comparison for sensitivities by their order attribute.
21 function sensitivity_compare($a, $b) {
22 return ($a[2] < $b[2]) ?
-1 : 1;
26 $ires = sqlStatement("SELECT id, type, title, begdate FROM lists WHERE " .
27 "pid = $pid AND enddate IS NULL " .
28 "ORDER BY type, begdate");
32 <?php
html_header_show();?
>
33 <title
><?php
xl('Patient Encounter','e'); ?
></title
>
35 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
37 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
38 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/overlib_mini.js"></script
>
39 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script
>
41 <!-- pop up calendar
-->
42 <style type
="text/css">@import
url(<?php
echo $GLOBALS['webroot'] ?
>/library
/dynarch_calendar
.css
);</style
>
43 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script
>
44 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_en.js"></script
>
45 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script
>
47 <script language
="JavaScript">
49 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
51 // Process click on issue title.
53 dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 600, 475);
57 // callback from add_edit_issue.php:
58 function refreshIssue(issue
, title
) {
59 var s
= document
.forms
[0]['issues[]'];
60 s
.options
[s
.options
.length
] = new Option(title
, issue
, true, true);
63 function saveClicked() {
64 var f
= document
.forms
[0];
65 <?php
if ($GLOBALS['ippf_specific']) { ?
>
66 if (f
['issues[]'].selectedIndex
< 0) {
67 if (!confirm('There is no issue selected. If this visit relates to ' +
68 'contraception or abortion, click Cancel now and then select or ' +
69 'create the appropriate issue. Otherwise you can click OK.'))
82 <?php
if ($viewmode) { ?
>
83 <body
class="body_top">
85 <body
class="body_top" onload
="javascript:document.new_encounter.reason.focus();">
88 <!-- Required
for the popup date selectors
-->
89 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
91 <form method
='post' action
="<?php echo $rootdir ?>/forms/newpatient/save.php" name
='new_encounter'
92 <?php
if (!$GLOBALS['concurrent_layout']) echo "target='Main'"; ?
>>
94 <?php
if ($viewmode) { ?
>
95 <input type
=hidden name
='mode' value
='update'>
96 <input type
=hidden name
='id' value
='<?php echo $_GET["id"] ?>'>
97 <span
class=title
><?php
xl('Patient Encounter Form','e'); ?
></span
>
99 <input type
='hidden' name
='mode' value
='new'>
100 <span
class='title'><?php
xl('New Encounter Form','e'); ?
></span
>
109 <td width
='33%' nowrap
class='bold'><?php
xl('Consultation Brief Description','e'); ?
>:</td
>
110 <td width
='34%' rowspan
='2' align
='center' valign
='top' class='text'>
114 <td
class='bold' nowrap
><?php
xl('Visit Category:','e'); ?
></td
>
116 <select name
='pc_catid'>
118 $cres = sqlStatement("SELECT pc_catid, pc_catname " .
119 "FROM openemr_postcalendar_categories ORDER BY pc_catname");
120 while ($crow = sqlFetchArray($cres)) {
121 $catid = $crow['pc_catid'];
122 if ($catid < 9 && $catid != 5) continue;
123 echo " <option value='$catid'";
124 if ($viewmode && $crow['pc_catid'] == $result['pc_catid']) echo " selected";
125 echo ">" . $crow['pc_catname'] . "</option>\n";
133 <td
class='bold' nowrap
><?php
xl('Facility:','e'); ?
></td
>
135 <select name
='facility_id'>
139 $def_facility = $result['facility_id'];
141 $dres = sqlStatement("select facility_id from users where username = '" . $_SESSION['authUser'] . "'");
142 $drow = sqlFetchArray($dres);
143 $def_facility = $drow['facility_id'];
145 $fres = sqlStatement("select * from facility where service_location != 0 order by name");
148 for ($iter = 0; $frow = sqlFetchArray($fres); $iter++
)
149 $fresult[$iter] = $frow;
150 foreach($fresult as $iter) {
152 <option value
="<?php echo $iter['id']; ?>" <?php
if ($def_facility == $iter['id']) echo "selected";?
>><?php
echo $iter['name']; ?
></option
>
163 $sensitivities = acl_get_sensitivities();
164 if ($sensitivities && count($sensitivities)) {
165 usort($sensitivities, "sensitivity_compare");
167 <td
class='bold' nowrap
><?php
xl('Sensitivity:','e'); ?
></td
>
169 <select name
='form_sensitivity'>
171 foreach ($sensitivities as $value) {
172 // Omit sensitivities to which this user does not have access.
173 if (acl_check('sensitivities', $value[1])) {
174 echo " <option value='" . $value[1] . "'";
175 if ($viewmode && $result['sensitivity'] == $value[1]) echo " selected";
176 echo ">" . $value[3] . "</option>\n";
179 echo " <option value=''";
180 if ($viewmode && !$result['sensitivity']) echo " selected";
181 echo ">" . xl('None'). "</option>\n";
188 <td colspan
='2'><!-- sensitivities not used
--></td
>
195 <td
class='bold' nowrap
><?php
xl('Date of Service:','e'); ?
></td
>
196 <td
class='text' nowrap
>
197 <input type
='text' size
='10' name
='form_date' id
='form_date' <?php
echo $disabled ?
>
198 value
='<?php echo $viewmode ? substr($result['date
'], 0, 10) : date('Y
-m
-d
'); ?>'
199 title
='<?php xl('yyyy
-mm
-dd Date of service
','e
'); ?>'
200 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' />
201 <img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
202 id
='img_form_date' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
203 title
='<?php xl('Click here to choose a date
','e
'); ?>'>
208 <td
class='bold' nowrap
><?php
xl('Onset/hosp. date:','e'); ?
></td
>
209 <td
class='text' nowrap
>
210 <input type
='text' size
='10' name
='form_onset_date' id
='form_onset_date'
211 value
='<?php echo $viewmode ? substr($result['onset_date
'], 0, 10) : date('Y
-m
-d
'); ?>'
212 title
='<?php xl('yyyy
-mm
-dd Date of onset
or hospitalization
','e
'); ?>'
213 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' />
215 <img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
216 id
='img_form_onset_date' border
='0' alt
='[?]' style
='cursor:pointer;cursor:hand'
217 title
='<?php xl('Click here to choose a date
','e
'); ?>'>
223 <td
class='text' colspan
='2' style
='padding-top:1em'>
225 <?php
if ($GLOBALS['athletic_team']) { ?
>
226 <p
><i
>Click
[Add Issue
] to add a
new issue
if:<br
/>
227 New injury likely to miss
>
; 1 day
<br
/>
228 New significant illness
/medical
<br
/>
229 New allergy
- only
if nil exist
</i
></p
>
233 <a href
="javascript:saveClicked();" class="link_submit">[<?php
xl('Save','e'); ?
>]</a
>
234 <?php
if ($viewmode ||
!isset($_GET["autoloaded"]) ||
$_GET["autoloaded"] != "1") { ?
>
236 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
237 <a href
="<?php echo "$rootdir/patient_file
/encounter
/encounter_top
.php
"; ?>"
238 class="link_submit" onclick
="top.restoreSession()">[<?php
xl('Cancel','e'); ?
>]</a
>
240 <a href
="<?php echo "$rootdir/patient_file
/encounter
/patient_encounter
.php
"; ?>"
241 class="link_submit" target
='Main' onclick
="top.restoreSession()">
242 [<?php
xl('Cancel','e'); ?
>]</a
>
243 <?php
} // end not concurrent layout ?>
244 <?php
} // end not autoloading ?>
246 <a href
="" onclick
="return newissue()" class="link_submit">[<?php
xl('Add Issue','e'); ?
>]</a
>
256 <td
class='bold' width
='33%' nowrap
>
257 <?php
xl('Issues (Injuries/Medical/Allergy):','e'); ?
>
262 <td
class='text' valign
='top'>
263 <textarea name
='reason' cols
='40' rows
='12' wrap
='virtual' style
='width:96%'
264 ><?php
echo $viewmode ?
htmlspecialchars($result['reason']) : $GLOBALS['default_chief_complaint']; ?
></textarea
>
266 <td
class='text' valign
='top'>
267 <select multiple name
='issues[]' size
='8' style
='width:100%'
268 title
='<?php xl('Hold down
[Ctrl
] for multiple selections
or to unselect
','e
'); ?>'>
270 while ($irow = sqlFetchArray($ires)) {
271 $list_id = $irow['id'];
272 $tcode = $irow['type'];
273 if ($ISSUE_TYPES[$tcode]) $tcode = $ISSUE_TYPES[$tcode][2];
276 echo " <option value='$list_id'";
277 $perow = sqlQuery("SELECT count(*) AS count FROM issue_encounter WHERE " .
278 "pid = '$pid' AND encounter = '$encounter' AND list_id = '$list_id'");
279 if ($perow['count']) echo " selected";
280 echo ">$tcode: " . $irow['begdate'] . " " .
281 htmlspecialchars(substr($irow['title'], 0, 40)) . "</option>\n";
284 echo " <option value='$list_id'>$tcode: ";
285 echo $irow['begdate'] . " " . htmlspecialchars(substr($irow['title'], 0, 40)) . "</option>\n";
291 <p
><i
>To link this encounter
/consult to an existing issue
, click the desired issue
292 above to highlight it
and then click
[Save
]. Hold down
<
;Ctrl
>
; to select
293 multiple issues
.</i
></p
>
306 <script language
="javascript">
307 /* required for popup calendar */
308 Calendar
.setup({inputField
:"form_date", ifFormat
:"%Y-%m-%d", button
:"img_form_date"});
309 Calendar
.setup({inputField
:"form_onset_date", ifFormat
:"%Y-%m-%d", button
:"img_form_onset_date"});