2 include_once("../globals.php");
4 // For a layout field return 0=unused, 1=optional, 2=mandatory.
5 function getLayoutUOR($form_id, $field_id) {
6 $crow = sqlQuery("SELECT uor FROM layout_options WHERE " .
7 "form_id = '$form_id' AND field_id = '$field_id' LIMIT 1");
8 return 0 +
$crow['uor'];
11 // Determine if the registration date should be requested.
12 $regstyle = getLayoutUOR('DEM','regdate') ?
"" : " style='display:none'";
14 $form_pubpid = $_POST['pubpid' ] ?
trim($_POST['pubpid' ]) : '';
15 $form_title = $_POST['title' ] ?
trim($_POST['title' ]) : '';
16 $form_fname = $_POST['fname' ] ?
trim($_POST['fname' ]) : '';
17 $form_mname = $_POST['mname' ] ?
trim($_POST['mname' ]) : '';
18 $form_lname = $_POST['lname' ] ?
trim($_POST['lname' ]) : '';
19 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
20 $form_sex = $_POST['sex' ] ?
trim($_POST['sex' ]) : '';
21 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
22 $form_dob = $_POST['DOB' ] ?
trim($_POST['DOB' ]) : '';
23 $form_regdate = $_POST['regdate' ] ?
trim($_POST['regdate' ]) : date('Y-m-d');
28 <?php
html_header_show(); ?
>
29 <link rel
="stylesheet" href
="<?php echo xl($css_header,'e');?>" type
="text/css">
30 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
32 <script type
="text/javascript" src
="../../library/textformat.js"></script
>
33 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
34 <script type
="text/javascript" src
="../../library/dynarch_calendar_en.js"></script
>
35 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
37 <script LANGUAGE
="JavaScript">
42 var f
= document
.forms
[0];
43 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
44 if (f
.refsource
.selectedIndex
<= 0) {
45 alert('Please select a referral source!');
49 <?php
if (getLayoutUOR('DEM','sex') == 2) { ?
>
50 if (f
.sex
.selectedIndex
<= 0) {
51 alert('Please select a value for sex!');
55 <?php
if (getLayoutUOR('DEM','DOB') == 2) { ?
>
56 if (f
.DOB
.value
.length
== 0) {
57 alert('Please select a birth date!');
69 <body
class="body_top" onload
="javascript:document.new_patient.fname.focus();">
71 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
72 <form name
='new_patient' method
='post' action
="new_patient_save.php"
73 onsubmit
='return validate()'>
74 <span
class='title'><?php
xl('Add Patient Record','e');?
></span
>
76 <form name
='new_patient' method
='post' action
="new_patient_save.php"
77 target
='_top' onsubmit
='return validate()'>
78 <a
class="title" href
="../main/main_screen.php" target
="_top" onclick
="top.restoreSession()">
79 <?php
xl('Add Patient Record','e');?
></a
>
86 <?php
if ($GLOBALS['omit_employers']) { ?
>
87 <input type
='hidden' name
='title' value
='' />
92 <?php
if (!$GLOBALS['omit_employers']) { ?
>
95 <span
class='bold'><?php
xl('Title','e');?
>: </span
>
100 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
101 "WHERE list_id = 'titles' ORDER BY seq");
102 while ($orow = sqlFetchArray($ores)) {
103 echo " <option value='" . $orow['option_id'] . "'";
104 if ($orow['option_id'] == $form_title) echo " selected";
105 echo ">" . $orow['title'] . "</option>\n";
115 <span
class='bold'><?php
xl('First Name','e');?
>: </span
>
118 <input type
='entry' size
='15' name
='fname' value
='<?php echo $form_fname; ?>'>
124 <span
class='bold'><?php
xl('Middle Name','e');?
>: </span
>
127 <input type
='entry' size
='15' name
='mname' value
='<?php echo $form_mname; ?>'>
133 <span
class='bold'><?php
xl('Last Name','e');?
>: </span
>
136 <input type
='entry' size
='15' name
='lname' value
='<?php echo $form_lname; ?>'>
142 <span
class='bold'><?php
xl('Sex','e'); ?
>: </span
>
146 <option value
=''>Unassigned
</option
>
148 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
149 "WHERE list_id = 'sex' ORDER BY seq");
150 while ($orow = sqlFetchArray($ores)) {
151 echo " <option value='" . $orow['option_id'] . "'";
152 if ($orow['option_id'] == $form_sex) echo " selected";
153 echo ">" . $orow['title'] . "</option>\n";
160 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
163 <span
class='bold'><?php
xl('Referral Source','e'); ?
>: </span
>
166 <select name
='refsource'>
167 <option value
=''>Unassigned
</option
>
169 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
170 "WHERE list_id = 'refsource' ORDER BY seq");
171 while ($orow = sqlFetchArray($ores)) {
172 echo " <option value='" . $orow['option_id'] . "'";
173 if ($orow['option_id'] == $form_refsource) echo " selected";
174 echo ">" . $orow['title'] . "</option>\n";
184 <span
class='bold'><?php
xl('Birth Date','e');?
>: </span
>
187 <input type
='text' size
='10' name
='DOB' id
='DOB'
188 value
='<?php echo $form_dob; ?>'
189 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
190 title
='yyyy-mm-dd' />
191 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
192 id
='img_dob' border
='0' alt
='[?]' style
='cursor:pointer'
193 title
='Click here to choose a date'>
194 <script LANGUAGE
="JavaScript">
195 Calendar
.setup({inputField
:"DOB", ifFormat
:"%Y-%m-%d", button
:"img_dob"});
200 <tr
<?php
echo $regstyle ?
>>
202 <span
class='bold'><?php
xl('Registration Date','e');?
>: </span
>
205 <input type
='text' size
='10' name
='regdate' id
='regdate'
206 value
='<?php echo $form_regdate; ?>'
207 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
208 title
='yyyy-mm-dd' />
209 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
210 id
='img_regdate' border
='0' alt
='[?]' style
='cursor:pointer'
211 title
='Click here to choose a date'>
212 <script LANGUAGE
="JavaScript">
213 Calendar
.setup({inputField
:"regdate", ifFormat
:"%Y-%m-%d", button
:"img_regdate"});
220 <span
class='bold'><?php
xl('Patient Number','e');?
>: </span
>
223 <input type
='entry' size
='5' name
='pubpid' value
='<?php echo $form_pubpid; ?>'>
224 <span
class='text'><?php
xl('omit to autoassign','e');?
>  
;  
; </span
>
231 <input type
='submit' name
='form_create' value
=<?php
xl('Create New Patient','e'); ?
> />
240 <script language
="Javascript">
243 echo "alert('" . xl('This patient ID is already in use!') . "');\n";