Skip to content

Commit

Permalink
upgrades to pt history and navigation menus for data import feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Jun 8, 2007
1 parent 0092d6e commit 2f7d8d8
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 105 deletions.
4 changes: 4 additions & 0 deletions interface/main/left_nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
'ono' => array('Ofc Notes' , 0, 'main/onotes/office_comments.php'),
'fax' => array('Fax/Scan' , 0, 'fax/faxq.php'),
'adb' => array('Addr Bk' , 0, 'usergroup/addrbook_list.php'),
'imp' => array('Import' , 0, '../custom/import.php'),
'bil' => array('Billing' , 0, 'billing/billing_report.php'),
'sup' => array('Superbill' , 0, 'patient_file/encounter/superbill_custom_full.php'),
'aun' => array('Auth/notes', 0, 'main/authorizations/authorizations.php'),
Expand Down Expand Up @@ -146,6 +147,9 @@
$disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
acl_check('encounters', 'notes_a') == 'write') &&
acl_check('patients', 'med') == 'write');

$disallowed['imp'] = $disallowed['new'] ||
!is_readable("$webserver_root/custom/import.php");
?>
<html>
<head>
Expand Down
10 changes: 10 additions & 0 deletions interface/main/main_navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
&nbsp;<a href="../usergroup/addrbook_list.php" target="Main" class="menu"><? xl('AB','e'); ?></a>&nbsp;
</td>

<?php
$tmp = acl_check('patients', 'demo');
if (($tmp == 'write' || $tmp == 'addonly') &&
is_readable("$webserver_root/custom/import.php")) {
?>
<td align="center" nowrap>
&nbsp;<a href="<?php echo $web_root; ?>/custom/import.php" target="Main" class="menu"><? xl('Import','e'); ?></a>&nbsp;
</td>
<?php } ?>

<?php
if ($GLOBALS['hylafax_server'] || $GLOBALS['scanner_output_directory']) {
$faxcount = 0;
Expand Down
37 changes: 22 additions & 15 deletions interface/patient_file/history/history.inc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2005 Rod Roark <[email protected]>
// Copyright (C) 2005-2007 Rod Roark <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand All @@ -13,23 +13,30 @@
//
if ($GLOBALS['athletic_team']) {
$exams = array(
"last_cardiac_echo" => xl('08 Cardiac Echo'),
"last_ecg" => xl('07 ECG'),
"last_physical_exam" => xl('05 Physical Exam'),
"last_breast_exam" => xl('00 Breast Exam'),
"last_mammogram" => xl('01 Mammogram')
"last_cardiac_echo" => '08 ' . xl('Cardiac Echo'),
"last_ecg" => '07 ' . xl('ECG'),
"last_physical_exam" => '05 ' . xl('Physical Exam'),
"last_breast_exam" => '00 ' . xl('Breast Exam'),
"last_mammogram" => '01 ' . xl('Mammogram')
);
} else {
$exams = array(
"last_breast_exam" => xl('00 Breast Exam'),
"last_cardiac_echo" => xl('08 Cardiac Echo'),
"last_ecg" => xl('07 ECG'),
"last_gynocological_exam" => xl('02 Gynecological Exam'),
"last_mammogram" => xl('01 Mammogram'),
"last_physical_exam" => xl('05 Physical Exam'),
"last_prostate_exam" => xl('04 Prostate Exam'),
"last_rectal_exam" => xl('03 Rectal Exam'),
"last_sigmoidoscopy_colonoscopy" => xl('06 Sigmoid/Colonoscopy')
"last_breast_exam" => '00 ' . xl('Breast Exam'),
"last_cardiac_echo" => '08 ' . xl('Cardiac Echo'),
"last_ecg" => '07 ' . xl('ECG'),
"last_gynocological_exam" => '02 ' . xl('Gynecological Exam'),
"last_mammogram" => '01 ' . xl('Mammogram'),
"last_physical_exam" => '05 ' . xl('Physical Exam'),
"last_prostate_exam" => '04 ' . xl('Prostate Exam'),
"last_rectal_exam" => '03 ' . xl('Rectal Exam'),
"last_sigmoidoscopy_colonoscopy" => '06 ' . xl('Sigmoid/Colonoscopy'),
// new for McCormick:
"last_retinal" => '09 ' . xl('Retinal Exam'),
"last_fluvax" => '10 ' . xl('Flu Vaccination'),
"last_pneuvax" => '11 ' . xl('Pneumonia Vaccination'),
"last_ldl" => '12 ' . xl('LDL'),
"last_hemoglobin" => '13 ' . xl('Hemoglobin'),
"last_psa" => '14 ' . xl('PSA')
);
}

Expand Down
68 changes: 34 additions & 34 deletions interface/patient_file/history/history_full.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?
<?php
include_once("../../globals.php");
include_once("$srcdir/patient.inc");
include_once("history.inc.php");
Expand All @@ -16,11 +16,11 @@
?>
<html>
<head>
<link rel=stylesheet href="<? echo $css_header ?>" type="text/css">
<link rel=stylesheet href="<?php echo $css_header ?>" type="text/css">
</head>
<body <?echo $top_bg_line;?> topmargin='0' rightmargin='0' leftmargin='2' bottommargin='0' marginwidth='2' marginheight='0'>

<?
<?php
$result = getHistoryData($pid);
if (!is_array($result)) {
newHistoryData($pid);
Expand All @@ -36,47 +36,47 @@
<?php } else { ?>
<a href='patient_history.php' target='Main'>
<?php } ?>
<font class='title'><? xl('Patient History / Lifestyle','e'); ?></font>
<font class='title'><?php xl('Patient History / Lifestyle','e'); ?></font>
<font class=back><?echo $tback;?></font></a><br>

<table border='0' cellpadding='5' width='100%'>

<tr>
<td valign='top'>
<table border='0' cellpadding='0' cellspacing='0'>
<tr><td colspan='2' class='bold'><? xl('Family History','e'); ?>:</td></tr>
<tr><td class='text'><? xl('Father','e'); ?></td><td><input type='text' size='20' name='history_father' value="<?echo $result{"history_father"};?>"></tr>
<tr><td class='text'><? xl('Mother','e'); ?></td><td><input type='text' size='20' name='history_mother' value="<?echo $result{"history_mother"};?>"></tr>
<tr><td class='text'><? xl('Siblings','e'); ?></td><td><input type='text' size='20' name='history_siblings' value="<?echo $result{"history_siblings"};?>"></tr>
<tr><td class='text'><? xl('Spouse','e'); ?></td><td><input type='text' size='20' name='history_spouse' value="<?echo $result{"history_spouse"};?>"></tr>
<tr><td class='text'><? xl('Offspring','e'); ?>&nbsp;</td><td><input type='text' size='20' name='history_offspring' value="<?echo $result{"history_offspring"};?>"></tr>
<tr><td colspan='2' class='bold'><?php xl('Family History','e'); ?>:</td></tr>
<tr><td class='text'><?php xl('Father','e'); ?></td><td><input type='text' size='20' name='history_father' value="<?echo $result{"history_father"};?>"></tr>
<tr><td class='text'><?php xl('Mother','e'); ?></td><td><input type='text' size='20' name='history_mother' value="<?echo $result{"history_mother"};?>"></tr>
<tr><td class='text'><?php xl('Siblings','e'); ?></td><td><input type='text' size='20' name='history_siblings' value="<?echo $result{"history_siblings"};?>"></tr>
<tr><td class='text'><?php xl('Spouse','e'); ?></td><td><input type='text' size='20' name='history_spouse' value="<?echo $result{"history_spouse"};?>"></tr>
<tr><td class='text'><?php xl('Offspring','e'); ?>&nbsp;</td><td><input type='text' size='20' name='history_offspring' value="<?echo $result{"history_offspring"};?>"></tr>
</table>
</td>
<td valign='top'>
<table border='0' cellpadding='0' cellspacing='0'>
<tr><td colspan='2' class='bold'><? xl('Relatives','e'); ?>:</td></tr>
<tr><td class='text'><? xl('Cancer','e'); ?></td><td><input type='text' size='20' name='relatives_cancer' value="<?echo $result{"relatives_cancer"};?>"></tr>
<tr><td class='text'><? xl('Tuberculosis','e'); ?></td><td><input type='text' size='20' name='relatives_tuberculosis' value="<?echo $result{"relatives_tuberculosis"};?>"></tr>
<tr><td class='text'><? xl('Diabetes','e'); ?></td><td><input type='text' size='20' name='relatives_diabetes' value="<?echo $result{"relatives_diabetes"};?>"></tr>
<tr><td class='text'><? xl('High Blood Pressure','e'); ?>&nbsp;</td><td><input type='text' size='20' name='relatives_high_blood_pressure' value="<?echo $result{"relatives_high_blood_pressure"};?>"></tr>
<tr><td class='text'><? xl('Heart Problems','e'); ?></td><td><input type='text' size='20' name='relatives_heart_problems' value="<?echo $result{"relatives_heart_problems"};?>"></tr>
<tr><td class='text'><? xl('Stroke','e'); ?></td><td><input type='text' size='20' name='relatives_stroke' value="<?echo $result{"relatives_stroke"};?>"></tr>
<tr><td class='text'><? xl('Epilepsy','e'); ?></td><td><input type='text' size='20' name='relatives_epilepsy' value="<?echo $result{"relatives_epilepsy"};?>"></tr>
<tr><td class='text'><? xl('Mental Illness','e'); ?></td><td><input type='text' size='20' name='relatives_mental_illness' value="<?echo $result{"relatives_mental_illness"};?>"></tr>
<tr><td class='text'><? xl('Suicide','e'); ?></td><td><input type='text' size='20' name='relatives_suicide' value="<?echo $result{"relatives_suicide"};?>"></tr>
<tr><td colspan='2' class='bold'><?php xl('Relatives','e'); ?>:</td></tr>
<tr><td class='text'><?php xl('Cancer','e'); ?></td><td><input type='text' size='20' name='relatives_cancer' value="<?echo $result{"relatives_cancer"};?>"></tr>
<tr><td class='text'><?php xl('Tuberculosis','e'); ?></td><td><input type='text' size='20' name='relatives_tuberculosis' value="<?echo $result{"relatives_tuberculosis"};?>"></tr>
<tr><td class='text'><?php xl('Diabetes','e'); ?></td><td><input type='text' size='20' name='relatives_diabetes' value="<?echo $result{"relatives_diabetes"};?>"></tr>
<tr><td class='text'><?php xl('High Blood Pressure','e'); ?>&nbsp;</td><td><input type='text' size='20' name='relatives_high_blood_pressure' value="<?echo $result{"relatives_high_blood_pressure"};?>"></tr>
<tr><td class='text'><?php xl('Heart Problems','e'); ?></td><td><input type='text' size='20' name='relatives_heart_problems' value="<?echo $result{"relatives_heart_problems"};?>"></tr>
<tr><td class='text'><?php xl('Stroke','e'); ?></td><td><input type='text' size='20' name='relatives_stroke' value="<?echo $result{"relatives_stroke"};?>"></tr>
<tr><td class='text'><?php xl('Epilepsy','e'); ?></td><td><input type='text' size='20' name='relatives_epilepsy' value="<?echo $result{"relatives_epilepsy"};?>"></tr>
<tr><td class='text'><?php xl('Mental Illness','e'); ?></td><td><input type='text' size='20' name='relatives_mental_illness' value="<?echo $result{"relatives_mental_illness"};?>"></tr>
<tr><td class='text'><?php xl('Suicide','e'); ?></td><td><input type='text' size='20' name='relatives_suicide' value="<?echo $result{"relatives_suicide"};?>"></tr>
</table>
</td>
<td valign='top'>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2 class=bold><? xl('Lifestyle','e'); ?>:</td></tr>
<tr><td class='text'><? xl('Coffee','e'); ?></td><td><input type='text' size='20' name='coffee' value="<?echo $result{"coffee"};?>"></tr>
<tr><td class='text'><? xl('Tobacco','e'); ?></td><td><input type='text' size='20' name='tobacco' value="<?echo $result{"tobacco"};?>"></tr>
<tr><td class='text'><? xl('Alcohol','e'); ?></td><td><input type='text' size='20' name='alcohol' value="<?echo $result{"alcohol"};?>"></tr>
<tr><td class='text'><? xl('Sleep Patterns','e'); ?></td><td><input type='text' size='20' name='sleep_patterns' value="<?echo $result{"sleep_patterns"};?>"></tr>
<tr><td class='text'><? xl('Exercise Patterns','e'); ?></td><td><input type='text' size='20' name='exercise_patterns' value="<?echo $result{"exercise_patterns"};?>"></tr>
<tr><td class='text'><? xl('Seatbelt Use','e'); ?></td><td><input type='text' size='20' name='seatbelt_use' value="<?echo $result{"seatbelt_use"};?>"></tr>
<tr><td class='text'><? xl('Counseling','e'); ?></td><td><input type='text' size='20' name='counseling' value="<?echo $result{"counseling"};?>"></tr>
<tr><td class='text'><? xl('Hazardous Activities','e'); ?>&nbsp;</td><td><input type='text' size='20' name='hazardous_activities' value="<?echo $result{"hazardous_activities"};?>"></tr>
<tr><td colspan=2 class=bold><?php xl('Lifestyle','e'); ?>:</td></tr>
<tr><td class='text'><?php xl('Coffee','e'); ?></td><td><input type='text' size='20' name='coffee' value="<?echo $result{"coffee"};?>"></tr>
<tr><td class='text'><?php xl('Tobacco','e'); ?></td><td><input type='text' size='20' name='tobacco' value="<?echo $result{"tobacco"};?>"></tr>
<tr><td class='text'><?php xl('Alcohol','e'); ?></td><td><input type='text' size='20' name='alcohol' value="<?echo $result{"alcohol"};?>"></tr>
<tr><td class='text'><?php xl('Sleep Patterns','e'); ?></td><td><input type='text' size='20' name='sleep_patterns' value="<?echo $result{"sleep_patterns"};?>"></tr>
<tr><td class='text'><?php xl('Exercise Patterns','e'); ?></td><td><input type='text' size='20' name='exercise_patterns' value="<?echo $result{"exercise_patterns"};?>"></tr>
<tr><td class='text'><?php xl('Seatbelt Use','e'); ?></td><td><input type='text' size='20' name='seatbelt_use' value="<?echo $result{"seatbelt_use"};?>"></tr>
<tr><td class='text'><?php xl('Counseling','e'); ?></td><td><input type='text' size='20' name='counseling' value="<?echo $result{"counseling"};?>"></tr>
<tr><td class='text'><?php xl('Hazardous Activities','e'); ?>&nbsp;</td><td><input type='text' size='20' name='hazardous_activities' value="<?echo $result{"hazardous_activities"};?>"></tr>
</table>
</td>
<td valign='top'>
Expand All @@ -89,11 +89,11 @@
<td valign='top' width='10%'>
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='2' class='bold'><? xl('Date/Notes of Last','e'); ?>:</td>
<td class='bold'><? xl('Nor','e'); ?>&nbsp;</td>
<td class='bold'><? xl('Abn','e'); ?></td>
<td colspan='2' class='bold'><?php xl('Date/Notes of Last','e'); ?>:</td>
<td class='bold'><?php xl('Nor','e'); ?>&nbsp;</td>
<td class='bold'><?php xl('Abn','e'); ?></td>
</tr>
<?
<?php
foreach ($exams as $key => $value) {
$testresult = substr($result['last_exam_results'], substr($value, 0, 2), 1);
echo " <tr>\n";
Expand Down Expand Up @@ -130,7 +130,7 @@
</td>
<td align='center' valign='top'>
<table border='0' cellpadding='0' cellspacing='0'>
<tr><td colspan='2' class='bold'><? xl('Additional History','e'); ?>:</td></tr>
<tr><td colspan='2' class='bold'><?php xl('Additional History','e'); ?>:</td></tr>
<tr><td class='text'><input type='text' size='20' name='name_1' value="<?=$result{"name_1"}?>">:</td><td><input type='text' size='20' name='value_1' value="<?=$result{"value_1"}?>"></td></tr>
<tr><td class='text'><input type='text' size='20' name='name_2' value="<?=$result{"name_2"}?>">:</td><td><input type='text' size='20' name='value_2' value="<?=$result{"value_2"}?>"></td></tr>
</table><br>
Expand Down
102 changes: 55 additions & 47 deletions interface/patient_file/history/history_save.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// Compute the string of radio button values representing
// normal/abnormal exam results.
//
$ltr = "000000000";
$ltr = "0000000000000000";
foreach ($exams as $key => $value) {
if ($_POST[$key]) {
$tmp = $_POST['rb_' . $key];
Expand All @@ -36,52 +36,60 @@
}

newHistoryData($pid,
$_POST["coffee"],
$_POST["tobacco"],
$_POST["alcohol"],
$_POST["sleep_patterns"],
$_POST["exercise_patterns"],
$_POST["seatbelt_use"],
$_POST["counseling"],
$_POST["hazardous_activities"],
$_POST["last_breast_exam"],
$_POST["last_mammogram"],
$_POST["last_gynocological_exam"],
$_POST["last_rectal_exam"],
$_POST["last_prostate_exam"],
$_POST["last_physical_exam"],
$_POST["last_sigmoidoscopy_colonoscopy"],
$_POST["history_mother"],
$_POST["history_father"],
$_POST["history_siblings"],
$_POST["history_offspring"],
$_POST["history_spouse"],
$_POST["relatives_cancer"],
$_POST["relatives_tuberculosis"],
$_POST["relatives_diabetes"],
$_POST["relatives_high_blood_pressure"],
$_POST["relatives_heart_problems"],
$_POST["relatives_stroke"],
$_POST["relatives_epilepsy"],
$_POST["relatives_mental_illness"],
$_POST["relatives_suicide"],
$_POST["cataract_surgery"],
$_POST["tonsillectomy"],
$_POST["appendectomy"],
$_POST["cholecystestomy"],
$_POST["heart_surgery"],
$_POST["hysterectomy"],
$_POST["hernia_repair"],
$_POST["hip_replacement"],
$_POST["knee_replacement"],
$_POST["name_1"],
$_POST["value_1"],
$_POST["name_2"],
$_POST["value_2"],
$_POST["additional_history"],
$_POST["last_ecg"],
$_POST["last_cardiac_echo"],
$ltr
array(
'coffee' => $_POST["coffee"],
'tobacco' => $_POST["tobacco"],
'alcohol' => $_POST["alcohol"],
'sleep_patterns' => $_POST["sleep_patterns"],
'exercise_patterns' => $_POST["exercise_patterns"],
'seatbelt_use' => $_POST["seatbelt_use"],
'counseling' => $_POST["counseling"],
'hazardous_activities' => $_POST["hazardous_activities"],
'last_breast_exam' => $_POST["last_breast_exam"],
'last_mammogram' => $_POST["last_mammogram"],
'last_gynocological_exam' => $_POST["last_gynocological_exam"],
'last_rectal_exam' => $_POST["last_rectal_exam"],
'last_prostate_exam' => $_POST["last_prostate_exam"],
'last_physical_exam' => $_POST["last_physical_exam"],
'last_sigmoidoscopy_colonoscopy' => $_POST["last_sigmoidoscopy_colonoscopy"],
'history_mother' => $_POST["history_mother"],
'history_father' => $_POST["history_father"],
'history_siblings' => $_POST["history_siblings"],
'history_offspring' => $_POST["history_offspring"],
'history_spouse' => $_POST["history_spouse"],
'relatives_cancer' => $_POST["relatives_cancer"],
'relatives_tuberculosis' => $_POST["relatives_tuberculosis"],
'relatives_diabetes' => $_POST["relatives_diabetes"],
'relatives_high_blood_pressure' => $_POST["relatives_high_blood_pressure"],
'relatives_heart_problems' => $_POST["relatives_heart_problems"],
'relatives_stroke' => $_POST["relatives_stroke"],
'relatives_epilepsy' => $_POST["relatives_epilepsy"],
'relatives_mental_illness' => $_POST["relatives_mental_illness"],
'relatives_suicide' => $_POST["relatives_suicide"],
'cataract_surgery' => $_POST["cataract_surgery"],
'tonsillectomy' => $_POST["tonsillectomy"],
'appendectomy' => $_POST["appendectomy"],
'cholecystestomy' => $_POST["cholecystestomy"],
'heart_surgery' => $_POST["heart_surgery"],
'hysterectomy' => $_POST["hysterectomy"],
'hernia_repair' => $_POST["hernia_repair"],
'hip_replacement' => $_POST["hip_replacement"],
'knee_replacement' => $_POST["knee_replacement"],
'name_1' => $_POST["name_1"],
'value_1' => $_POST["value_1"],
'name_2' => $_POST["name_2"],
'value_2' => $_POST["value_2"],
'additional_history' => $_POST["additional_history"],
'last_ecg' => $_POST["last_ecg"],
'last_cardiac_echo' => $_POST["last_cardiac_echo"],
'last_retinal' => $_POST["last_retinal"],
'last_fluvax' => $_POST["last_fluvax"],
'last_pneuvax' => $_POST["last_pneuvax"],
'last_ldl' => $_POST["last_ldl"],
'last_hemoglobin' => $_POST["last_hemoglobin"],
'last_psa' => $_POST["last_psa"],
'last_exam_results' => $ltr
)
);

if ($GLOBALS['concurrent_layout']) {
Expand Down
13 changes: 13 additions & 0 deletions library/patient.inc
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ function updateInsuranceData($pid,$new)
return sqlInsert($sql);
}

/****
function newHistoryData( $pid,
$coffee = "",
$tobacco = "",
Expand Down Expand Up @@ -743,6 +744,18 @@ function newHistoryData( $pid,
pid='$pid'
");
}
****/

function newHistoryData($pid, $new=false) {
$sql = "insert into history_data set pid = '$pid', date = NOW()";
if ($new) {
while(list($key, $value) = each($new)) {
if (!get_magic_quotes_gpc()) $value = addslashes($value);
$sql .= ", $key = '$value'";
}
}
return sqlInsert($sql);
}

function updateHistoryData($pid,$new)
{
Expand Down
Loading

0 comments on commit 2f7d8d8

Please sign in to comment.