6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 if ($GLOBALS['full_new_patient_form']) {
16 require("new_comprehensive.php");
20 // For a layout field return 0=unused, 1=optional, 2=mandatory.
21 function getLayoutUOR($form_id, $field_id)
23 $crow = sqlQuery("SELECT uor FROM layout_options WHERE " .
24 "form_id = ? AND field_id = ? LIMIT 1", array($form_id, $field_id));
25 return 0 +
$crow['uor'];
28 // Determine if the registration date should be requested.
29 $regstyle = getLayoutUOR('DEM', 'regdate') ?
"" : " style='display:none'";
31 $form_pubpid = $_POST['pubpid' ] ?
trim($_POST['pubpid' ]) : '';
32 $form_title = $_POST['title' ] ?
trim($_POST['title' ]) : '';
33 $form_fname = $_POST['fname' ] ?
trim($_POST['fname' ]) : '';
34 $form_mname = $_POST['mname' ] ?
trim($_POST['mname' ]) : '';
35 $form_lname = $_POST['lname' ] ?
trim($_POST['lname' ]) : '';
36 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
37 $form_sex = $_POST['sex' ] ?
trim($_POST['sex' ]) : '';
38 $form_refsource = $_POST['refsource'] ?
trim($_POST['refsource']) : '';
39 $form_dob = $_POST['DOB' ] ?
trim($_POST['DOB' ]) : '';
40 $form_regdate = $_POST['regdate' ] ?
trim($_POST['regdate' ]) : date('Y-m-d');
45 <?php
html_header_show(); ?
>
46 <link rel
="stylesheet" href
="<?php echo $css_header; ?>" type
="text/css">
47 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/build/jquery.datetimepicker.min.css">
49 <script type
="text/javascript" src
="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script
>
50 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery/dist/jquery.min.js"></script
>
51 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js"></script
>
53 <?php
include_once("{$GLOBALS['srcdir']}/options.js.php"); ?
>
55 <script LANGUAGE
="JavaScript">
58 var f
= document
.forms
[0];
59 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
60 if (f
.refsource
.selectedIndex
<= 0) {
61 alert('Please select a referral source!');
65 <?php
if (getLayoutUOR('DEM', 'sex') == 2) { ?
>
66 if (f
.sex
.selectedIndex
<= 0) {
67 alert('Please select a value for sex!');
71 <?php
if (getLayoutUOR('DEM', 'DOB') == 2) { ?
>
72 if (f
.DOB
.value
.length
== 0) {
73 alert('Please select a birth date!');
81 $
(document
).ready(function(){
82 $
('.datepicker').datetimepicker({
83 <?php
$datetimepicker_timepicker = false; ?
>
84 <?php
$datetimepicker_showseconds = false; ?
>
85 <?php
$datetimepicker_formatInput = true; ?
>
86 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
87 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
89 $
('.datetimepicker').datetimepicker({
90 <?php
$datetimepicker_timepicker = true; ?
>
91 <?php
$datetimepicker_showseconds = false; ?
>
92 <?php
$datetimepicker_formatInput = true; ?
>
93 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
94 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
102 <body
class="body_top" onload
="javascript:document.new_patient.fname.focus();">
104 <form name
='new_patient' method
='post' action
="new_patient_save.php"
105 onsubmit
='return validate()'>
106 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(collectCsrfToken()); ?>" />
108 <span
class='title'><?php
echo xlt('Add Patient Record'); ?
></span
>
114 <?php
if ($GLOBALS['omit_employers']) { ?
>
115 <input type
='hidden' name
='title' value
='' />
120 <?php
if (!$GLOBALS['omit_employers']) { ?
>
123 <span
class='bold'><?php
echo xlt('Title'); ?
>: </span
>
126 <select name
='title'>
128 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
129 "WHERE list_id = 'titles' AND activity = 1 ORDER BY seq");
130 while ($orow = sqlFetchArray($ores)) {
131 echo " <option value='" . attr($orow['option_id']) . "'";
132 if ($orow['option_id'] == $form_title) {
136 echo ">" . text($orow['title']) . "</option>\n";
146 <span
class='bold'><?php
echo xlt('First Name'); ?
>: </span
>
149 <input type
='entry' size
='15' name
='fname' value
='<?php echo attr($form_fname); ?>'>
155 <span
class='bold'><?php
echo xlt('Middle Name'); ?
>: </span
>
158 <input type
='entry' size
='15' name
='mname' value
='<?php echo attr($form_mname); ?>'>
164 <span
class='bold'><?php
echo xlt('Last Name'); ?
>: </span
>
167 <input type
='entry' size
='15' name
='lname' value
='<?php echo attr($form_lname); ?>'>
173 <span
class='bold'><?php
echo xlt('Sex'); ?
>: </span
>
177 <option value
=''>Unassigned
</option
>
179 $ores = sqlStatement("SELECT option_id, title FROM list_options " .
180 "WHERE list_id = 'sex' AND activity = 1 ORDER BY seq");
181 while ($orow = sqlFetchArray($ores)) {
182 echo " <option value='" . attr($orow['option_id']) . "'";
183 if ($orow['option_id'] == $form_sex) {
187 echo ">" . text($orow['title']) . "</option>\n";
194 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
197 <span
class='bold'><?php
echo xlt('Referral Source'); ?
>: </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='" . attr($orow['option_id']) . "'";
207 if ($orow['option_id'] == $form_refsource) {
211 echo ">" . text($orow['title']) . "</option>\n";
221 <span
class='bold'><?php
echo xlt('Birth Date'); ?
>: </span
>
224 <input type
='text' size
='10' class='datepicker' name
='DOB' id
='DOB'
225 value
='<?php echo attr($form_dob); ?>' />
229 <tr
<?php
echo $regstyle ?
>>
231 <span
class='bold'><?php
echo xlt('Registration Date'); ?
>: </span
>
234 <input type
='text' size
='10' class='datepicker' name
='regdate' id
='regdate'
235 value
='<?php echo attr($form_regdate); ?>' />
241 <span
class='bold'><?php
echo xlt('Patient Number'); ?
>: </span
>
244 <input type
='entry' size
='5' name
='pubpid' value
='<?php echo attr($form_pubpid); ?>'>
245 <span
class='text'><?php
echo xlt('omit to autoassign'); ?
>  
;  
; </span
>
252 <input type
='submit' name
='form_create' value
='<?php echo xla('Create
New Patient
'); ?>' />
261 <script language
="Javascript">
264 echo "alert(" . xlj('This patient ID is already in use!') . ");\n";