2 include_once("../globals.php");
4 if ($GLOBALS['full_new_patient_form']) {
5 require("new_comprehensive.php");
9 // For a layout field return 0=unused, 1=optional, 2=mandatory.
10 function getLayoutUOR($form_id, $field_id) {
11 $crow = sqlQuery("SELECT uor FROM layout_options WHERE " .
12 "form_id = '$form_id' AND field_id = '$field_id' LIMIT 1");
13 return 0 +
$crow['uor'];
16 // Determine if the registration date should be requested.
17 $regstyle = getLayoutUOR('DEM','regdate') ?
"" : " style='display:none'";
19 $form_pubpid = $_POST['pubpid' ] ?
trim($_POST['pubpid' ]) : '';
20 $form_title = $_POST['title' ] ?
trim($_POST['title' ]) : '';
21 $form_fname = $_POST['fname' ] ?
trim($_POST['fname' ]) : '';
22 $form_mname = $_POST['mname' ] ?
trim($_POST['mname' ]) : '';
23 $form_lname = $_POST['lname' ] ?
trim($_POST['lname' ]) : '';
24 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
25 $form_sex = $_POST['sex' ] ?
trim($_POST['sex' ]) : '';
26 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
27 $form_dob = $_POST['DOB' ] ?
trim($_POST['DOB' ]) : '';
28 $form_regdate = $_POST['regdate' ] ?
trim($_POST['regdate' ]) : date('Y-m-d');
33 <?php
html_header_show(); ?
>
34 <link rel
="stylesheet" href
="<?php echo xl($css_header,'e');?>" type
="text/css">
35 <style type
="text/css">@import
url(../../library
/dynarch_calendar
.css
);</style
>
37 <script type
="text/javascript" src
="../../library/textformat.js"></script
>
38 <script type
="text/javascript" src
="../../library/dynarch_calendar.js"></script
>
39 <?php
include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?
>
40 <script type
="text/javascript" src
="../../library/dynarch_calendar_setup.js"></script
>
41 <?php
include_once("{$GLOBALS['srcdir']}/options.js.php"); ?
>
43 <script LANGUAGE
="JavaScript">
48 var f
= document
.forms
[0];
49 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
50 if (f
.refsource
.selectedIndex
<= 0) {
51 alert('Please select a referral source!');
55 <?php
if (getLayoutUOR('DEM','sex') == 2) { ?
>
56 if (f
.sex
.selectedIndex
<= 0) {
57 alert('Please select a value for sex!');
61 <?php
if (getLayoutUOR('DEM','DOB') == 2) { ?
>
62 if (f
.DOB
.value
.length
== 0) {
63 alert('Please select a birth date!');
75 <body
class="body_top" onload
="javascript:document.new_patient.fname.focus();">
77 <form name
='new_patient' method
='post' action
="new_patient_save.php"
78 onsubmit
='return validate()'>
79 <span
class='title'><?php
xl('Add Patient Record','e');?
></span
>
85 <?php
if ($GLOBALS['omit_employers']) { ?
>
86 <input type
='hidden' name
='title' value
='' />
91 <?php
if (!$GLOBALS['omit_employers']) { ?
>
94 <span
class='bold'><?php
xl('Title','e');?
>: </span
>
99 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
100 "WHERE list_id = 'titles' AND activity = 1 ORDER BY seq");
101 while ($orow = sqlFetchArray($ores)) {
102 echo " <option value='" . $orow['option_id'] . "'";
103 if ($orow['option_id'] == $form_title) echo " selected";
104 echo ">" . $orow['title'] . "</option>\n";
114 <span
class='bold'><?php
xl('First Name','e');?
>: </span
>
117 <input type
='entry' size
='15' name
='fname' value
='<?php echo $form_fname; ?>'>
123 <span
class='bold'><?php
xl('Middle Name','e');?
>: </span
>
126 <input type
='entry' size
='15' name
='mname' value
='<?php echo $form_mname; ?>'>
132 <span
class='bold'><?php
xl('Last Name','e');?
>: </span
>
135 <input type
='entry' size
='15' name
='lname' value
='<?php echo $form_lname; ?>'>
141 <span
class='bold'><?php
xl('Sex','e'); ?
>: </span
>
145 <option value
=''>Unassigned
</option
>
147 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
148 "WHERE list_id = 'sex' AND activity = 1 ORDER BY seq");
149 while ($orow = sqlFetchArray($ores)) {
150 echo " <option value='" . $orow['option_id'] . "'";
151 if ($orow['option_id'] == $form_sex) echo " selected";
152 echo ">" . $orow['title'] . "</option>\n";
159 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
162 <span
class='bold'><?php
xl('Referral Source','e'); ?
>: </span
>
165 <select name
='refsource'>
166 <option value
=''>Unassigned
</option
>
168 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
169 "WHERE list_id = 'refsource' AND activity = 1 ORDER BY seq");
170 while ($orow = sqlFetchArray($ores)) {
171 echo " <option value='" . $orow['option_id'] . "'";
172 if ($orow['option_id'] == $form_refsource) echo " selected";
173 echo ">" . $orow['title'] . "</option>\n";
183 <span
class='bold'><?php
xl('Birth Date','e');?
>: </span
>
186 <input type
='text' size
='10' name
='DOB' id
='DOB'
187 value
='<?php echo $form_dob; ?>'
188 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
189 title
='yyyy-mm-dd' />
190 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
191 id
='img_dob' border
='0' alt
='[?]' style
='cursor:pointer'
192 title
='Click here to choose a date'>
193 <script LANGUAGE
="JavaScript">
194 Calendar
.setup({inputField
:"DOB", ifFormat
:"%Y-%m-%d", button
:"img_dob"});
199 <tr
<?php
echo $regstyle ?
>>
201 <span
class='bold'><?php
xl('Registration Date','e');?
>: </span
>
204 <input type
='text' size
='10' name
='regdate' id
='regdate'
205 value
='<?php echo $form_regdate; ?>'
206 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
207 title
='yyyy-mm-dd' />
208 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
209 id
='img_regdate' border
='0' alt
='[?]' style
='cursor:pointer'
210 title
='Click here to choose a date'>
211 <script LANGUAGE
="JavaScript">
212 Calendar
.setup({inputField
:"regdate", ifFormat
:"%Y-%m-%d", button
:"img_regdate"});
219 <span
class='bold'><?php
xl('Patient Number','e');?
>: </span
>
222 <input type
='entry' size
='5' name
='pubpid' value
='<?php echo $form_pubpid; ?>'>
223 <span
class='text'><?php
xl('omit to autoassign','e');?
>  
;  
; </span
>
230 <input type
='submit' name
='form_create' value
=<?php
xl('Create New Patient','e'); ?
> />
239 <script language
="Javascript">
242 echo "alert('" . xl('This patient ID is already in use!') . "');\n";