Skip to content

Commit

Permalink
Commented the unused code (#1173)
Browse files Browse the repository at this point in the history
* Removed deprecated new.php and replaced with new_comprehensive.php
* Fixed small small typos
  • Loading branch information
RAJAGOPALAN-GANGADHARAN authored and aethelwulffe committed Jun 22, 2018
1 parent 936749c commit 3494142
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 256 deletions.
2 changes: 1 addition & 1 deletion interface/forms/LBF/view.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
require("new.php");
?>
?>
2 changes: 1 addition & 1 deletion interface/forms/track_anything/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
} elseif(!$encounter AND $pid){
?> onclick="top.restoreSession();location='<?php echo $web_root ?>/interface/patient_file/summary/demographics.php'"<?php
} elseif(!$encounter AND !$pid){
?> onclick="top.restoreSession();location='<?php echo $web_root ?>/interface/new/new.php'"<?php
?> onclick="top.restoreSession();location='<?php echo $web_root ?>/interface/new/new_comprehensive.php'"<?php
}
echo " />\n";
echo "</p>\n";
Expand Down
2 changes: 1 addition & 1 deletion interface/main/main_title.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function toencounter(rawdata) {

<?php if (acl_check('patients','demo','',array('write','addonly') )) { ?>
<tr><td style="vertical-align:text-bottom;">
<a href='' class="css_button_small" style="margin:0px;vertical-align:top;" id='new0' onClick=" return top.window.parent.left_nav.loadFrame2('new0','RTop','new/new.php')">
<a href='' class="css_button_small" style="margin:0px;vertical-align:top;" id='new0' onClick=" return top.window.parent.left_nav.loadFrame2('new0','RTop','new/new_comprehensive.php')">
<span><?php echo htmlspecialchars( xl('NEW PATIENT'), ENT_QUOTES); ?></span></a>
</td>
<td style="vertical-align:text-bottom;">
Expand Down
243 changes: 2 additions & 241 deletions interface/new/new.php
Original file line number Diff line number Diff line change
@@ -1,242 +1,3 @@
<?php
include_once("../globals.php");

if ($GLOBALS['full_new_patient_form']) {
require("new_comprehensive.php");
exit;
}
require_once("$srcdir/formatting.inc.php");
$DateFormat = DateFormatRead();
$DateLocale = getLocaleCodeForDisplayLanguage($GLOBALS['language_default']);

// For a layout field return 0=unused, 1=optional, 2=mandatory.
function getLayoutUOR($form_id, $field_id) {
$crow = sqlQuery("SELECT uor FROM layout_options WHERE " .
"form_id = '$form_id' AND field_id = '$field_id' LIMIT 1");
return 0 + $crow['uor'];
}

// Determine if the registration date should be requested.
$regstyle = getLayoutUOR('DEM','regdate') ? "" : " style='display:none'";

$form_pubpid = $_POST['pubpid' ] ? trim($_POST['pubpid' ]) : '';
$form_title = $_POST['title' ] ? trim($_POST['title' ]) : '';
$form_fname = $_POST['fname' ] ? trim($_POST['fname' ]) : '';
$form_mname = $_POST['mname' ] ? trim($_POST['mname' ]) : '';
$form_lname = $_POST['lname' ] ? trim($_POST['lname' ]) : '';
$form_refsource = $_POST['refsource'] ? trim($_POST['refsource']) : '';
$form_sex = $_POST['sex' ] ? trim($_POST['sex' ]) : '';
$form_refsource = $_POST['refsource'] ? trim($_POST['refsource']) : '';
$form_dob = $_POST['DOB' ] ? trim($_POST['DOB' ]) : '';
$form_regdate = $_POST['regdate' ] ? trim($_POST['regdate' ]) : date('Y-m-d');
?>
<html>

<head>
<?php html_header_show(); ?>
<link rel="stylesheet" href="<?php echo xl($css_header,'e');?>" type="text/css">
<link rel="stylesheet" href="../../library/css/jquery.datetimepicker.css">

<script type="text/javascript" src="../../library/js/jquery.datetimepicker.full.min.js"></script>

<script type="text/javascript" src="../../library/textformat.js"></script>
<script type="text/javascript" src="../../library/js/jquery-1.9.1.min.js"></script>
<?php include_once("{$GLOBALS['srcdir']}/options.js.php"); ?>

<script LANGUAGE="JavaScript">

var mypcc = '1';

function validate() {
var f = document.forms[0];
<?php if ($GLOBALS['inhouse_pharmacy']) { ?>
if (f.refsource.selectedIndex <= 0) {
alert('Please select a referral source!');
return false;
}
<?php } ?>
<?php if (getLayoutUOR('DEM','sex') == 2) { ?>
if (f.sex.selectedIndex <= 0) {
alert('Please select a value for sex!');
return false;
}
<?php } ?>
<?php if (getLayoutUOR('DEM','DOB') == 2) { ?>
if (f.DOB.value.length == 0) {
alert('Please select a birth date!');
return false;
}
<?php } ?>
top.restoreSession();
return true;
}

</script>

</head>

<body class="body_top" onload="javascript:document.new_patient.fname.focus();">

<form name='new_patient' method='post' action="new_patient_save.php"
onsubmit='return validate()'>
<span class='title'><?php xl('Add Patient Record','e');?></span>

<br><br>

<center>

<?php if ($GLOBALS['omit_employers']) { ?>
<input type='hidden' name='title' value='' />
<?php } ?>

<table border='0'>

<?php if (!$GLOBALS['omit_employers']) { ?>
<tr>
<td>
<span class='bold'><?php xl('Title','e');?>: </span>
</td>
<td>
<select name='title'>
<?php
$ores = sqlStatement("SELECT option_id, title FROM list_options " .
"WHERE list_id = 'titles' ORDER BY seq");
while ($orow = sqlFetchArray($ores)) {
echo " <option value='" . $orow['option_id'] . "'";
if ($orow['option_id'] == $form_title) echo " selected";
echo ">" . $orow['title'] . "</option>\n";
}
?>
</select>
</td>
</tr>
<?php } ?>

<tr>
<td>
<span class='bold'><?php xl('First Name','e');?>: </span>
</td>
<td>
<input type='entry' size='15' name='fname' value='<?php echo $form_fname; ?>'>
</td>
</tr>

<tr>
<td>
<span class='bold'><?php xl('Middle Name','e');?>: </span>
</td>
<td>
<input type='entry' size='15' name='mname' value='<?php echo $form_mname; ?>'>
</td>
</tr>

<tr>
<td>
<span class='bold'><?php xl('Last Name','e');?>: </span>
</td>
<td>
<input type='entry' size='15' name='lname' value='<?php echo $form_lname; ?>'>
</td>
</tr>

<tr>
<td>
<span class='bold'><?php xl('Sex','e'); ?>: </span>
</td>
<td>
<select name='sex'>
<option value=''>Unassigned</option>
<?php
$ores = sqlStatement("SELECT option_id, title FROM list_options " .
"WHERE list_id = 'sex' ORDER BY seq");
while ($orow = sqlFetchArray($ores)) {
echo " <option value='" . $orow['option_id'] . "'";
if ($orow['option_id'] == $form_sex) echo " selected";
echo ">" . $orow['title'] . "</option>\n";
}
?>
</select>
</td>
</tr>

<?php if ($GLOBALS['inhouse_pharmacy']) { ?>
<tr>
<td>
<span class='bold'><?php xl('Referral Source','e'); ?>: </span>
</td>
<td>
<select name='refsource'>
<option value=''>Unassigned</option>
<?php
$ores = sqlStatement("SELECT option_id, title FROM list_options " .
"WHERE list_id = 'refsource' ORDER BY seq");
while ($orow = sqlFetchArray($ores)) {
echo " <option value='" . $orow['option_id'] . "'";
if ($orow['option_id'] == $form_refsource) echo " selected";
echo ">" . $orow['title'] . "</option>\n";
}
?>
</select>
</td>
</tr>
<?php } ?>

<tr>
<td>
<span class='bold'><?php xl('Birth Date','e');?>: </span>
</td>
<td>
<input type='text' size='10' name='DOB' id='DOB' value='<?php echo $form_dob; ?>'/>
</td>
</tr>

<tr<?php echo $regstyle ?>>
<td>
<span class='bold'><?php xl('Registration Date','e');?>: </span>
</td>
<td>
<input type='text' size='10' name='regdate' id='regdate' value='<?php echo $form_regdate; ?>'/>
</td>
</tr>

<tr>
<td>
<span class='bold'><?php xl('Patient Number','e');?>: </span>
</td>
<td>
<input type='entry' size='5' name='pubpid' value='<?php echo $form_pubpid; ?>'>
<span class='text'><?php xl('omit to autoassign','e');?> &nbsp; &nbsp; </span>
</td>
</tr>

<tr>
<td colspan='2'>
&nbsp;<br>
<input type='submit' name='form_create' value=<?php xl('Create New Patient','e'); ?> />
</td>
<td>
</td>
</tr>

</table>
</center>
</form>
<script language="Javascript">
<?php
if ($form_pubpid) {
echo "alert('" . xl('This patient ID is already in use!') . "');\n";
}
?>
</script>
<script>
$(function() {
$("#DOB, #regdate").datetimepicker({
timepicker: false,
format: "<?= $DateFormat; ?>"
});
$.datetimepicker.setLocale('<?= $DateLocale;?>');
});
</script>

</body>
</html>
//Useless
?>
4 changes: 2 additions & 2 deletions library/globals.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
array(
'/interface/main/main_info.php' => xl('Calendar Screen'),
'/interface/main/finder/dynamic_finder.php' => xl('Dynamic Finder'),
'/interface/new/new.php' => xl('Patient Add/Search'),
'/interface/new/new_comprehensive.php' => xl('Patient Add/Search'),
'/interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1' => xl('Patient Flow Board'),
'/interface/main/messages/messages.php?form_active=1' => xl("Messages"),
),
Expand All @@ -176,7 +176,7 @@
array(
'/interface/main/messages/messages.php?form_active=1' => xl("Messages"),
'/interface/main/finder/dynamic_finder.php' => xl('Dynamic Finder'),
'/interface/new/new.php' => xl('Patient Add/Search'),
'/interface/new/new_comprehensive.php' => xl('Patient Add/Search'),
'/interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1' => xl('Patient Flow Board'),
'/interface/main/main_info.php' => xl('Calendar Screen'),
),
Expand Down
2 changes: 1 addition & 1 deletion modules/calendar/add_edit_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ function find_available(extra) {
// refresh and redirect the parent window
if (!opener.closed && opener.refreshme) opener.refreshme();
top.restoreSession();
opener.document.location="../../interface/new/new.php";
opener.document.location="../../interface/new/new_comprehensive.php";
// Close the window
window.close();
</script>';
Expand Down
4 changes: 2 additions & 2 deletions modules/util_menu/menu.sql

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions sql/1_0_1-to-2_0_0_upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ INSERT INTO `menu_entries` (`id`, `label`, `icon`, `class`, `helperText`, `targe
('Modules:modimg', 'Modules', '', '', '', NULL, NULL, 0, 'null', 'null'),
('Native Data Loads|/interface/super/load_codes.php', 'Native Data Loads', '', '', '', 'adm', '/interface/super/load_codes.php', 0, '["admin","super"]', 'null'),
('New Documents|/controller.php?document&list&patient_id=00', 'New Documents', '', '', '', 'msc', '/controller.php?document&list&patient_id=00', 0, 'null', 'null'),
('New/Patient|/interface/new/new.php', 'Add Patient', 'fa-group', '', '', 'pat', '/interface/new/new.php', 0, 'null', 'null'),
('New/Patient|/interface/new/new_comprehensive.php', 'Add Patient', 'fa-group', '', '', 'pat', '/interface/new/new_comprehensive.php', 0, 'null', 'null'),
('Order Catalog|/interface/orders/types.php', 'Order Catalog', '', '', '', 'msc', '/interface/orders/types.php', 0, 'null', 'null'),
('Other:', 'Other', 'fa-caret-right', '', '', NULL, NULL, 0, 'null', 'null'),
('Password|/interface/usergroup/user_info.php', 'Password', '', '', '', 'msc', '/interface/usergroup/user_info.php', 0, 'null', 'null'),
Expand Down Expand Up @@ -645,7 +645,7 @@ INSERT INTO `menu_trees` (`menu_set`, `entry_id`, `icon`, `helperText`, `parent`
('Administrators', 'External Data Loads|/interface/code_systems/dataloads_ajax.php', '', '', 'Other:', 700, NULL),
('Administrators', 'Merge Patients|/interface/patient_file/merge_patients.php', '', '', 'Other:', 800, NULL),
('Administrators', 'Patients|/interface/main/finder/dynamic_finder.php', '', '', 'Patient/Client:patimg', 0, NULL),
('Administrators', 'New/Search|/interface/new/new.php', '', '', 'Patient/Client:patimg', 100, NULL),
('Administrators', 'New/Search|/interface/new/new_comprehensive.php', '', '', 'Patient/Client:patimg', 100, NULL),
('Administrators', 'Summary|/interface/patient_file/summary/demographics.php', '', '', 'Patient/Client:patimg', 200, NULL),
('Administrators', 'Visits:encounter', '', '', 'Patient/Client:patimg', 300, NULL),
('Administrators', 'Records:', '', '', 'Patient/Client:patimg', 400, NULL),
Expand Down Expand Up @@ -697,7 +697,7 @@ INSERT INTO `menu_trees` (`menu_set`, `entry_id`, `icon`, `helperText`, `parent`
('AnsServ', 'Preferences|/interface/super/edit_globals.php?mode=user', '', '', 'File:file0', 100, NULL),
('AnsServ', 'Calendar Administration|/modules/calendar/admin.php', '', '', 'Other:', 200, NULL),
('AnsServ', 'Patients|/interface/main/finder/dynamic_finder.php', '', '', 'Patient/Client:patimg', 0, NULL),
('AnsServ', 'New/Patient|/interface/new/new.php', '', '', 'Patient/Client:patimg', 100, NULL),
('AnsServ', 'New/Patient|/interface/new/new_comprehensive.php', '', '', 'Patient/Client:patimg', 100, NULL),
('AnsServ', 'Calendar|/interface/main/main_info.php', '', '', 'View:', 0, NULL),
('AnsServ', 'Flow Board|/interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1', '', '', 'View:', 100, NULL),
('AnsServ', 'Addr Book|/interface/usergroup/addrbook_list.php', '', '', 'View:', 300, NULL),
Expand All @@ -720,7 +720,7 @@ INSERT INTO `menu_trees` (`menu_set`, `entry_id`, `icon`, `helperText`, `parent`
('Clinical Staff', 'Upload|/interface/patient_file/ccr_import.php', '', '', 'Import:', 0, NULL),
('Clinical Staff', 'Pending Approval|/interface/patient_file/ccr_pending_approval.php', '', '', 'Import:', 100, NULL),
('Clinical Staff', 'Patients|/interface/main/finder/dynamic_finder.php', '0', '0', 'Patient/Client:patimg', 0, NULL),
('Clinical Staff', 'New/Patient|/interface/new/new.php', '0', '0', 'Patient/Client:patimg', 100, NULL),
('Clinical Staff', 'New/Patient|/interface/new/new_comprehensive.php', '0', '0', 'Patient/Client:patimg', 100, NULL),
('Clinical Staff', 'Summary|/interface/patient_file/summary/demographics.php', '0', '0', 'Patient/Client:patimg', 200, NULL),
('Clinical Staff', 'Visits:encounter', '0', '0', 'Patient/Client:patimg', 300, NULL),
('Clinical Staff', 'Visit Forms:', '', '', 'Patient/Client:patimg', 400, NULL),
Expand Down Expand Up @@ -843,7 +843,7 @@ INSERT INTO `menu_trees` (`menu_set`, `entry_id`, `icon`, `helperText`, `parent`
('default', 'External Data Loads|/interface/code_systems/dataloads_ajax.php', '', '', 'Other:', 700, NULL),
('default', 'Merge Patients|/interface/patient_file/merge_patients.php', '', '', 'Other:', 800, NULL),
('default', 'Patients|/interface/main/finder/dynamic_finder.php', '', '', 'Patient/Client:patimg', 0, NULL),
('default', 'New/Search|/interface/new/new.php', '', '', 'Patient/Client:patimg', 100, NULL),
('default', 'New/Search|/interface/new/new_comprehensive.php', '', '', 'Patient/Client:patimg', 100, NULL),
('default', 'Summary|/interface/patient_file/summary/demographics.php', '', '', 'Patient/Client:patimg', 200, NULL),
('default', 'Visits:encounter', '', '', 'Patient/Client:patimg', 300, NULL),
('default', 'Records:', '', '', 'Patient/Client:patimg', 400, NULL),
Expand Down Expand Up @@ -914,8 +914,8 @@ INSERT INTO `menu_trees` (`menu_set`, `entry_id`, `icon`, `helperText`, `parent`
('Front Office', 'Messages|/interface/main/messages/messages.php?form_active=1', '', '', 'Miscellaneous:misimg', 0, NULL),
('Front Office', 'Patient Education|/interface/reports/patient_edu_web_lookup.php', '', '', 'Miscellaneous:misimg', 100, NULL),
('Front Office', 'Patients|/interface/main/finder/dynamic_finder.php', '', '', 'Patient/Client:patimg', 0, NULL),
('Front Office', 'New/Search|/interface/new/new.php', '', '', 'Patient/Client:patimg', 100, NULL),
('Front Office', 'New/Patient|/interface/new/new.php', '', '', 'Patient/Client:patimg', 200, NULL),
('Front Office', 'New/Search|/interface/new/new_comprehensive.php', '', '', 'Patient/Client:patimg', 100, NULL),
('Front Office', 'New/Patient|/interface/new/new_comprehensive.php', '', '', 'Patient/Client:patimg', 200, NULL),
('Front Office', 'Clinical|/interface/reports/clinical_reports.php', '', '', 'Patient/Client:patimg', 300, NULL),
('Front Office', 'Issues|/interface/patient_file/problem_encounter.php', '', '', 'Popup:lists', 0, NULL),
('Front Office', 'Import|/custom/import_xml.php', '', '', 'Popup:lists', 100, NULL),
Expand Down

0 comments on commit 3494142

Please sign in to comment.