2 include_once("../../globals.php");
3 include_once("$srcdir/calendar.inc");
4 include_once("$srcdir/lists.inc");
5 include_once("$srcdir/patient.inc");
6 include_once("$srcdir/acl.inc");
8 // Check permission to create encounters.
9 $tmp = getPatientData($pid, "squad");
10 if (($tmp['squad'] && ! acl_check('squads', $tmp['squad'])) ||
11 ! (acl_check('encounters', 'notes_a' ) ||
12 acl_check('encounters', 'notes' ) ||
13 acl_check('encounters', 'coding_a') ||
14 acl_check('encounters', 'coding' ) ||
15 acl_check('encounters', 'relaxed' )))
17 echo "<body>\n<html>\n";
18 echo "<p>(New encounters not authorized)</p>\n";
19 echo "</body>\n</html>\n";
23 $months = array("01","02","03","04","05","06","07","08","09","10","11","12");
24 $days = array("01","02","03","04","05","06","07","08","09","10","11","12","13","14",
25 "15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
26 $thisyear = date("Y");
27 $years = array($thisyear-1, $thisyear, $thisyear+
1, $thisyear+
2);
29 // Sort comparison for sensitivities by their order attribute.
30 function sensitivity_compare($a, $b) {
31 return ($a[2] < $b[2]) ?
-1 : 1;
35 $ires = sqlStatement("SELECT id, type, title, begdate FROM lists WHERE " .
36 "pid = $pid AND enddate IS NULL " .
37 "ORDER BY type, begdate");
40 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
44 <title
>New Encounter
</title
>
46 <script type
="text/javascript" src
="../../../library/dialog.js"></script
>
47 <script type
="text/javascript" src
="../../../library/overlib_mini.js"></script
>
48 <script type
="text/javascript" src
="../../../library/calendar.js"></script
>
49 <script type
="text/javascript" src
="../../../library/textformat.js"></script
>
51 <script language
="JavaScript">
53 var mypcc
= '<? echo $GLOBALS['phone_country_code
'] ?>';
55 // Process click on issue title.
57 dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 600, 475);
61 // callback from add_edit_issue.php:
62 function refreshIssue(issue
, title
) {
63 var s
= document
.forms
[0]['issues[]'];
64 s
.options
[s
.options
.length
] = new Option(title
, issue
, true, true);
70 <body
<?
echo $top_bg_line;?
> topmargin
='0' rightmargin
='0' leftmargin
='2' bottommargin
='0'
71 marginwidth
='2' marginheight
='0' onload
="javascript:document.new_encounter.reason.focus();">
73 <!-- Required
for the popup date selectors
-->
74 <div id
="overDiv" style
="position:absolute; visibility:hidden; z-index:1000;"></div
>
76 <form method
='post' action
="<?echo $rootdir?>/forms/newpatient/save.php" name
='new_encounter'
77 <?php
if (!$GLOBALS['concurrent_layout']) echo "target='Main'"; ?
>>
78 <input type
='hidden' name
='mode' value
='new'>
79 <span
class='title'>New Encounter Form
</span
>
85 <td colspan
='2' width
='50%' nowrap
class='text'>Chief Complaint
:</td
>
86 <td
class='text' width
='50%' nowrap
>
87 Issues (Problems
, Medications
, Surgeries
, Allergies
):
93 <textarea name
='reason' cols
='40' rows
='4' wrap
='virtual' style
='width:96%'
94 ><?php
echo $GLOBALS['default_chief_complaint'] ?
></textarea
>
96 <td rowspan
='5' valign
='top'>
97 <select multiple name
='issues[]' size
='10' style
='width:100%'
98 title
='Hold down [Ctrl] for multiple selections or to unselect'>
100 while ($irow = sqlFetchArray($ires)) {
101 $tcode = $irow['type'];
102 if ($ISSUE_TYPES[$tcode]) $tcode = $ISSUE_TYPES[$tcode][2];
103 echo " <option value='" . $irow['id'] . "'>$tcode: ";
104 echo $irow['begdate'] . " " . htmlspecialchars(substr($irow['title'], 0, 40)) . "</option>\n";
112 <td
class='text' width
='1%' nowrap
>Facility
:</td
>
114 <select name
='facility'>
116 $dres = sqlStatement("select facility from users where username='".$_SESSION{"authUser"}."'");
117 $drow = sqlFetchArray($dres);
118 $fres = sqlStatement("select * from facility order by name");
121 for ($iter = 0; $frow = sqlFetchArray($fres); $iter++
)
122 $result[$iter] = $frow;
123 foreach($result as $iter) {
125 <option value
="<?echo $iter{name};?>" <?
if ($drow{facility
} == $iter{name
}) {echo "selected";};?
>><?
echo $iter{name
};?
></option
>
136 $sensitivities = acl_get_sensitivities();
137 if ($sensitivities && count($sensitivities)) {
138 usort($sensitivities, "sensitivity_compare");
140 <td
class='text' width
='1%' nowrap
>Sensitivity
:</td
>
142 <select name
='form_sensitivity'>
144 foreach ($sensitivities as $value) {
145 // Omit sensitivities to which this user does not have access.
146 if (acl_check('sensitivities', $value[1])) {
147 echo " <option value='" . $value[1] . "'>" . $value[3] . "</option>\n";
150 echo " <option value=''>None</option>\n";
157 <td colspan
='2'><!-- sensitivities not used
--></td
>
164 <td
class='text' nowrap
>Date of Service
:</td
>
166 <input type
='text' size
='10' name
='form_date' <?
echo $disabled ?
>
167 value
='<? echo date('Y
-m
-d
') ?>'
168 title
='yyyy-mm-dd Date of service'
169 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' />
170 <a href
="javascript:show_calendar('new_encounter.form_date')"
171 title
="Click here to choose a date"
172 ><img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22' border
='0' alt
='[?]'></a
>
177 <td
class='text' nowrap
>Onset
/hospitalization date
:</td
>
180 <input type
='text' size
='10' name
='form_onset_date'
181 value
='<? echo date('Y
-m
-d
') ?>'
182 title
='yyyy-mm-dd Date of onset or hospitalization'
183 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)' />
184 <a href
="javascript:show_calendar('new_encounter.form_onset_date')"
185 title
="Click here to choose a date"
186 ><img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22' border
='0' alt
='[?]'></a
>
193 <a href
="javascript:document.new_encounter.submit();" class="link_submit">[Save
]</a
>
194 <?
if (!isset($_GET["autoloaded"]) ||
$_GET["autoloaded"] != "1") { ?
>
197 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
198 <a href
="<?php echo "$rootdir/patient_file
/encounter
/encounter_top
.php
"; ?>"
199 class="link_submit">[Cancel
]</a
>
201 <a href
="<?echo "$rootdir/patient_file
/encounter
/patient_encounter
.php
";?>"
202 class="link_submit">[Don
't Save]</a>
207 <a href="" onclick="return newissue()" class="link_submit">[Add Issue]</a>