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)
30 $crow = sqlQuery("SELECT uor FROM layout_options WHERE " .
31 "form_id = '$form_id' AND field_id = '$field_id' LIMIT 1");
32 return 0 +
$crow['uor'];
35 // Determine if the registration date should be requested.
36 $regstyle = getLayoutUOR('DEM', 'regdate') ?
"" : " style='display:none'";
38 $form_pubpid = $_POST['pubpid' ] ?
trim($_POST['pubpid' ]) : '';
39 $form_title = $_POST['title' ] ?
trim($_POST['title' ]) : '';
40 $form_fname = $_POST['fname' ] ?
trim($_POST['fname' ]) : '';
41 $form_mname = $_POST['mname' ] ?
trim($_POST['mname' ]) : '';
42 $form_lname = $_POST['lname' ] ?
trim($_POST['lname' ]) : '';
43 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
44 $form_sex = $_POST['sex' ] ?
trim($_POST['sex' ]) : '';
45 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
46 $form_dob = $_POST['DOB' ] ?
trim($_POST['DOB' ]) : '';
47 $form_regdate = $_POST['regdate' ] ?
trim($_POST['regdate' ]) : date('Y-m-d');
52 <?php
html_header_show(); ?
>
53 <link rel
="stylesheet" href
="<?php echo xl($css_header, 'e');?>" type
="text/css">
54 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
56 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
57 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script
>
58 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script
>
60 <?php
include_once("{$GLOBALS['srcdir']}/options.js.php"); ?
>
62 <script LANGUAGE
="JavaScript">
67 var f
= document
.forms
[0];
68 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
69 if (f
.refsource
.selectedIndex
<= 0) {
70 alert('Please select a referral source!');
74 <?php
if (getLayoutUOR('DEM', 'sex') == 2) { ?
>
75 if (f
.sex
.selectedIndex
<= 0) {
76 alert('Please select a value for sex!');
80 <?php
if (getLayoutUOR('DEM', 'DOB') == 2) { ?
>
81 if (f
.DOB
.value
.length
== 0) {
82 alert('Please select a birth date!');
90 $
(document
).ready(function(){
91 $
('.datepicker').datetimepicker({
92 <?php
$datetimepicker_timepicker = false; ?
>
93 <?php
$datetimepicker_showseconds = false; ?
>
94 <?php
$datetimepicker_formatInput = false; ?
>
95 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
96 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
98 $
('.datetimepicker').datetimepicker({
99 <?php
$datetimepicker_timepicker = true; ?
>
100 <?php
$datetimepicker_showseconds = false; ?
>
101 <?php
$datetimepicker_formatInput = false; ?
>
102 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
103 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
111 <body
class="body_top" onload
="javascript:document.new_patient.fname.focus();">
113 <form name
='new_patient' method
='post' action
="new_patient_save.php"
114 onsubmit
='return validate()'>
115 <span
class='title'><?php
xl('Add Patient Record', 'e');?
></span
>
121 <?php
if ($GLOBALS['omit_employers']) { ?
>
122 <input type
='hidden' name
='title' value
='' />
127 <?php
if (!$GLOBALS['omit_employers']) { ?
>
130 <span
class='bold'><?php
xl('Title', 'e');?
>: </span
>
133 <select name
='title'>
135 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
136 "WHERE list_id = 'titles' AND activity = 1 ORDER BY seq");
137 while ($orow = sqlFetchArray($ores)) {
138 echo " <option value='" . $orow['option_id'] . "'";
139 if ($orow['option_id'] == $form_title) {
143 echo ">" . $orow['title'] . "</option>\n";
153 <span
class='bold'><?php
xl('First Name', 'e');?
>: </span
>
156 <input type
='entry' size
='15' name
='fname' value
='<?php echo $form_fname; ?>'>
162 <span
class='bold'><?php
xl('Middle Name', 'e');?
>: </span
>
165 <input type
='entry' size
='15' name
='mname' value
='<?php echo $form_mname; ?>'>
171 <span
class='bold'><?php
xl('Last Name', 'e');?
>: </span
>
174 <input type
='entry' size
='15' name
='lname' value
='<?php echo $form_lname; ?>'>
180 <span
class='bold'><?php
xl('Sex', 'e'); ?
>: </span
>
184 <option value
=''>Unassigned
</option
>
186 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
187 "WHERE list_id = 'sex' AND activity = 1 ORDER BY seq");
188 while ($orow = sqlFetchArray($ores)) {
189 echo " <option value='" . $orow['option_id'] . "'";
190 if ($orow['option_id'] == $form_sex) {
194 echo ">" . $orow['title'] . "</option>\n";
201 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
204 <span
class='bold'><?php
xl('Referral Source', 'e'); ?
>: </span
>
207 <select name
='refsource'>
208 <option value
=''>Unassigned
</option
>
210 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
211 "WHERE list_id = 'refsource' AND activity = 1 ORDER BY seq");
212 while ($orow = sqlFetchArray($ores)) {
213 echo " <option value='" . $orow['option_id'] . "'";
214 if ($orow['option_id'] == $form_refsource) {
218 echo ">" . $orow['title'] . "</option>\n";
228 <span
class='bold'><?php
xl('Birth Date', 'e');?
>: </span
>
231 <input type
='text' size
='10' class='datepicker' name
='DOB' id
='DOB'
232 value
='<?php echo $form_dob; ?>'
233 title
='yyyy-mm-dd' />
237 <tr
<?php
echo $regstyle ?
>>
239 <span
class='bold'><?php
xl('Registration Date', 'e');?
>: </span
>
242 <input type
='text' size
='10' class='datepicker' name
='regdate' id
='regdate'
243 value
='<?php echo $form_regdate; ?>'
244 title
='yyyy-mm-dd' />
250 <span
class='bold'><?php
xl('Patient Number', 'e');?
>: </span
>
253 <input type
='entry' size
='5' name
='pubpid' value
='<?php echo $form_pubpid; ?>'>
254 <span
class='text'><?php
xl('omit to autoassign', 'e');?
>  
;  
; </span
>
261 <input type
='submit' name
='form_create' value
=<?php
xl('Create New Patient', 'e'); ?
> />
270 <script language
="Javascript">
273 echo "alert('" . xl('This patient ID is already in use!') . "');\n";