2 include_once("../../globals.php");
4 $disabled = "disabled";
6 // Uncomment this if you want to allow changing encounter dates.
7 // Eventually this needs to be subject to access control:
11 $months = array("01","02","03","04","05","06","07","08","09","10","11","12");
12 $days = array("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17",
13 "18","19","20","21","22","23","24","25","26","27","28","29","30","31");
14 $years = array("2004","2005","2006","2007");
16 $result = sqlQuery("select * from form_encounter where id='$id'");
18 $enc_year = substr($result{'date'}, 0, 4);
19 $enc_month = substr($result{'date'}, 5, 2);
20 $enc_day = substr($result{'date'}, 8, 2);
21 $ons_year = substr($result{'onset_date'}, 0, 4);
22 $ons_month = substr($result{'onset_date'}, 5, 2);
23 $ons_day = substr($result{'onset_date'}, 8, 2);
26 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
30 <title
>New Patient Encounter
</title
>
33 <body
<?
echo $top_bg_line;?
> topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
35 <form method
=post action
="<?echo $rootdir?>/forms/newpatient/save.php" name
=new_encounter target
=Main
>
36 <input type
=hidden name
=mode value
='update'>
37 <input type
=hidden name
=id value
='<?echo $_GET["id"];?>'>
38 <span
class=title
>New Patient Encounter Form
</span
>
43 <tr
><td
><select name
='facility'>
45 $fres = sqlStatement("select * from facility order by name");
47 for ($iter = 0; $frow = sqlFetchArray($fres); $iter++
)
48 $result[$iter] = $frow;
49 foreach($result as $iter) {
51 <option
<?
if ($iter{name
} == $result{facility
}) {echo "selected";};?
> value
="<?echo $iter{name};?>"><?
echo $iter{name
};?
></option
>
56 </select
></td
><td
></td
></tr
>
58 <tr
><td
><span
class=text
>Chief Complaint
:</span
></td
><td
></td
></tr
>
59 <tr
><td
><textarea name
=reason cols
=40 rows
=6 wrap
=virtual
><?
60 echo $result{"reason"};
64 <tr
><td
><span
class='text'>Date Of Service
:</span
></td
>
65 <td
><select name
='month' <?
echo $disabled ?
>>
67 foreach($months as $month){
69 <option value
="<?echo $month;?>" <?
if($month == $enc_month) echo "selected";?
>><?
echo $month?
></option
>
74 <select name
='day' <?
echo $disabled ?
>>
76 foreach($days as $day){
78 <option value
="<?echo $day;?>" <?
if($day == $enc_day) echo "selected";?
>><?
echo $day?
></option
>
83 <select name
='year' <?
echo $disabled ?
>>
85 foreach($years as $year){
87 <option value
="<?echo $year;?>" <?
if($year == $enc_year) echo "selected";?
>><?
echo $year?
></option
>
93 <tr
><td
><span
class='text'>Date of onset
or hospitalization
:</span
></td
>
94 <td
><select name
='onset_month'>
96 foreach($months as $month){
98 <option value
="<?echo $month;?>" <?
if($month == $ons_month) echo "selected";?
>><?
echo $month?
></option
>
103 <select name
='onset_day'>
105 foreach($days as $day){
107 <option value
="<?echo $day;?>" <?
if($day == $ons_day) echo "selected";?
>><?
echo $day?
></option
>
112 <select name
='onset_year'>
114 foreach($years as $year){
116 <option value
="<?echo $year;?>" <?
if($year == $ons_year) echo "selected";?
>><?
echo $year?
></option
>
124 <a href
="javascript:document.new_encounter.submit();" class="link_submit">[Save
]</a
>
125  
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
;
126 <a href
="<?echo "$rootdir/patient_file
/encounter
/patient_encounter
.php
";?>" class="link" target
=Main
>[Don
't Save Changes]</a>