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
>
42 <script LANGUAGE
="JavaScript">
47 var f
= document
.forms
[0];
48 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
49 if (f
.refsource
.selectedIndex
<= 0) {
50 alert('Please select a referral source!');
54 <?php
if (getLayoutUOR('DEM','sex') == 2) { ?
>
55 if (f
.sex
.selectedIndex
<= 0) {
56 alert('Please select a value for sex!');
60 <?php
if (getLayoutUOR('DEM','DOB') == 2) { ?
>
61 if (f
.DOB
.value
.length
== 0) {
62 alert('Please select a birth date!');
74 <body
class="body_top" onload
="javascript:document.new_patient.fname.focus();">
76 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
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
>
81 <form name
='new_patient' method
='post' action
="new_patient_save.php"
82 target
='_top' onsubmit
='return validate()'>
83 <a
class="title" href
="../main/main_screen.php" target
="_top" onclick
="top.restoreSession()">
84 <?php
xl('Add Patient Record','e');?
></a
>
91 <?php
if ($GLOBALS['omit_employers']) { ?
>
92 <input type
='hidden' name
='title' value
='' />
97 <?php
if (!$GLOBALS['omit_employers']) { ?
>
100 <span
class='bold'><?php
xl('Title','e');?
>: </span
>
103 <select name
='title'>
105 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
106 "WHERE list_id = 'titles' ORDER BY seq");
107 while ($orow = sqlFetchArray($ores)) {
108 echo " <option value='" . $orow['option_id'] . "'";
109 if ($orow['option_id'] == $form_title) echo " selected";
110 echo ">" . $orow['title'] . "</option>\n";
120 <span
class='bold'><?php
xl('First Name','e');?
>: </span
>
123 <input type
='entry' size
='15' name
='fname' value
='<?php echo $form_fname; ?>'>
129 <span
class='bold'><?php
xl('Middle Name','e');?
>: </span
>
132 <input type
='entry' size
='15' name
='mname' value
='<?php echo $form_mname; ?>'>
138 <span
class='bold'><?php
xl('Last Name','e');?
>: </span
>
141 <input type
='entry' size
='15' name
='lname' value
='<?php echo $form_lname; ?>'>
147 <span
class='bold'><?php
xl('Sex','e'); ?
>: </span
>
151 <option value
=''>Unassigned
</option
>
153 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
154 "WHERE list_id = 'sex' ORDER BY seq");
155 while ($orow = sqlFetchArray($ores)) {
156 echo " <option value='" . $orow['option_id'] . "'";
157 if ($orow['option_id'] == $form_sex) echo " selected";
158 echo ">" . $orow['title'] . "</option>\n";
165 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
168 <span
class='bold'><?php
xl('Referral Source','e'); ?
>: </span
>
171 <select name
='refsource'>
172 <option value
=''>Unassigned
</option
>
174 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
175 "WHERE list_id = 'refsource' ORDER BY seq");
176 while ($orow = sqlFetchArray($ores)) {
177 echo " <option value='" . $orow['option_id'] . "'";
178 if ($orow['option_id'] == $form_refsource) echo " selected";
179 echo ">" . $orow['title'] . "</option>\n";
189 <span
class='bold'><?php
xl('Birth Date','e');?
>: </span
>
192 <input type
='text' size
='10' name
='DOB' id
='DOB'
193 value
='<?php echo $form_dob; ?>'
194 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
195 title
='yyyy-mm-dd' />
196 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
197 id
='img_dob' border
='0' alt
='[?]' style
='cursor:pointer'
198 title
='Click here to choose a date'>
199 <script LANGUAGE
="JavaScript">
200 Calendar
.setup({inputField
:"DOB", ifFormat
:"%Y-%m-%d", button
:"img_dob"});
205 <tr
<?php
echo $regstyle ?
>>
207 <span
class='bold'><?php
xl('Registration Date','e');?
>: </span
>
210 <input type
='text' size
='10' name
='regdate' id
='regdate'
211 value
='<?php echo $form_regdate; ?>'
212 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
213 title
='yyyy-mm-dd' />
214 <img src
='../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
215 id
='img_regdate' border
='0' alt
='[?]' style
='cursor:pointer'
216 title
='Click here to choose a date'>
217 <script LANGUAGE
="JavaScript">
218 Calendar
.setup({inputField
:"regdate", ifFormat
:"%Y-%m-%d", button
:"img_regdate"});
225 <span
class='bold'><?php
xl('Patient Number','e');?
>: </span
>
228 <input type
='entry' size
='5' name
='pubpid' value
='<?php echo $form_pubpid; ?>'>
229 <span
class='text'><?php
xl('omit to autoassign','e');?
>  
;  
; </span
>
236 <input type
='submit' name
='form_create' value
=<?php
xl('Create New Patient','e'); ?
> />
245 <script language
="Javascript">
248 echo "alert('" . xl('This patient ID is already in use!') . "');\n";