4 * LICENSE: This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 3
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>.
16 * @author Brady Miller <brady.g.miller@gmail.com>
17 * @link http://www.open-emr.org
20 include_once("../globals.php");
22 if ($GLOBALS['full_new_patient_form']) {
23 require("new_comprehensive.php");
27 // For a layout field return 0=unused, 1=optional, 2=mandatory.
28 function getLayoutUOR($form_id, $field_id) {
29 $crow = sqlQuery("SELECT uor FROM layout_options WHERE " .
30 "form_id = '$form_id' AND field_id = '$field_id' LIMIT 1");
31 return 0 +
$crow['uor'];
34 // Determine if the registration date should be requested.
35 $regstyle = getLayoutUOR('DEM','regdate') ?
"" : " style='display:none'";
37 $form_pubpid = $_POST['pubpid' ] ?
trim($_POST['pubpid' ]) : '';
38 $form_title = $_POST['title' ] ?
trim($_POST['title' ]) : '';
39 $form_fname = $_POST['fname' ] ?
trim($_POST['fname' ]) : '';
40 $form_mname = $_POST['mname' ] ?
trim($_POST['mname' ]) : '';
41 $form_lname = $_POST['lname' ] ?
trim($_POST['lname' ]) : '';
42 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
43 $form_sex = $_POST['sex' ] ?
trim($_POST['sex' ]) : '';
44 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
45 $form_dob = $_POST['DOB' ] ?
trim($_POST['DOB' ]) : '';
46 $form_regdate = $_POST['regdate' ] ?
trim($_POST['regdate' ]) : date('Y-m-d');
51 <?php
html_header_show(); ?
>
52 <link rel
="stylesheet" href
="<?php echo xl($css_header,'e');?>" type
="text/css">
53 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
55 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
56 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
57 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
59 <?php
include_once("{$GLOBALS['srcdir']}/options.js.php"); ?
>
61 <script LANGUAGE
="JavaScript">
66 var f
= document
.forms
[0];
67 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
68 if (f
.refsource
.selectedIndex
<= 0) {
69 alert('Please select a referral source!');
73 <?php
if (getLayoutUOR('DEM','sex') == 2) { ?
>
74 if (f
.sex
.selectedIndex
<= 0) {
75 alert('Please select a value for sex!');
79 <?php
if (getLayoutUOR('DEM','DOB') == 2) { ?
>
80 if (f
.DOB
.value
.length
== 0) {
81 alert('Please select a birth date!');
89 $
(document
).ready(function(){
90 $
('.datepicker').datetimepicker({
91 <?php
$datetimepicker_timepicker = false; ?
>
92 <?php
$datetimepicker_showseconds = false; ?
>
93 <?php
$datetimepicker_formatInput = false; ?
>
94 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
95 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
97 $
('.datetimepicker').datetimepicker({
98 <?php
$datetimepicker_timepicker = true; ?
>
99 <?php
$datetimepicker_showseconds = false; ?
>
100 <?php
$datetimepicker_formatInput = false; ?
>
101 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
102 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
110 <body
class="body_top" onload
="javascript:document.new_patient.fname.focus();">
112 <form name
='new_patient' method
='post' action
="new_patient_save.php"
113 onsubmit
='return validate()'>
114 <span
class='title'><?php
xl('Add Patient Record','e');?
></span
>
120 <?php
if ($GLOBALS['omit_employers']) { ?
>
121 <input type
='hidden' name
='title' value
='' />
126 <?php
if (!$GLOBALS['omit_employers']) { ?
>
129 <span
class='bold'><?php
xl('Title','e');?
>: </span
>
132 <select name
='title'>
134 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
135 "WHERE list_id = 'titles' AND activity = 1 ORDER BY seq");
136 while ($orow = sqlFetchArray($ores)) {
137 echo " <option value='" . $orow['option_id'] . "'";
138 if ($orow['option_id'] == $form_title) echo " selected";
139 echo ">" . $orow['title'] . "</option>\n";
149 <span
class='bold'><?php
xl('First Name','e');?
>: </span
>
152 <input type
='entry' size
='15' name
='fname' value
='<?php echo $form_fname; ?>'>
158 <span
class='bold'><?php
xl('Middle Name','e');?
>: </span
>
161 <input type
='entry' size
='15' name
='mname' value
='<?php echo $form_mname; ?>'>
167 <span
class='bold'><?php
xl('Last Name','e');?
>: </span
>
170 <input type
='entry' size
='15' name
='lname' value
='<?php echo $form_lname; ?>'>
176 <span
class='bold'><?php
xl('Sex','e'); ?
>: </span
>
180 <option value
=''>Unassigned
</option
>
182 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
183 "WHERE list_id = 'sex' AND activity = 1 ORDER BY seq");
184 while ($orow = sqlFetchArray($ores)) {
185 echo " <option value='" . $orow['option_id'] . "'";
186 if ($orow['option_id'] == $form_sex) echo " selected";
187 echo ">" . $orow['title'] . "</option>\n";
194 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
197 <span
class='bold'><?php
xl('Referral Source','e'); ?
>: </span
>
200 <select name
='refsource'>
201 <option value
=''>Unassigned
</option
>
203 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
204 "WHERE list_id = 'refsource' AND activity = 1 ORDER BY seq");
205 while ($orow = sqlFetchArray($ores)) {
206 echo " <option value='" . $orow['option_id'] . "'";
207 if ($orow['option_id'] == $form_refsource) echo " selected";
208 echo ">" . $orow['title'] . "</option>\n";
218 <span
class='bold'><?php
xl('Birth Date','e');?
>: </span
>
221 <input type
='text' size
='10' class='datepicker' name
='DOB' id
='DOB'
222 value
='<?php echo $form_dob; ?>'
223 title
='yyyy-mm-dd' />
227 <tr
<?php
echo $regstyle ?
>>
229 <span
class='bold'><?php
xl('Registration Date','e');?
>: </span
>
232 <input type
='text' size
='10' class='datepicker' name
='regdate' id
='regdate'
233 value
='<?php echo $form_regdate; ?>'
234 title
='yyyy-mm-dd' />
240 <span
class='bold'><?php
xl('Patient Number','e');?
>: </span
>
243 <input type
='entry' size
='5' name
='pubpid' value
='<?php echo $form_pubpid; ?>'>
244 <span
class='text'><?php
xl('omit to autoassign','e');?
>  
;  
; </span
>
251 <input type
='submit' name
='form_create' value
=<?php
xl('Create New Patient','e'); ?
> />
260 <script language
="Javascript">
263 echo "alert('" . xl('This patient ID is already in use!') . "');\n";