Skip to content

Commit

Permalink
a couple of simplification and hipaa options for demographics and pre…
Browse files Browse the repository at this point in the history
…scriptions from mtfc
  • Loading branch information
sunsetsystems committed Dec 20, 2006
1 parent 941d5af commit e9489f4
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 66 deletions.
1 change: 1 addition & 0 deletions controllers/C_Prescription.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function C_Prescription($template_mod = "general") {
$this->assign("TOP_ACTION", $GLOBALS['webroot']."/controller.php?" . "prescription" . "&");
$this->assign("STYLE", $GLOBALS['style']);
$this->assign("WEIGHT_LOSS_CLINIC", $GLOBALS['weight_loss_clinic']);
$this->assign("SIMPLIFIED_PRESCRIPTIONS", $GLOBALS['simplified_prescriptions']);
$this->pconfig = $GLOBALS['oer_config']['prescriptions'];

if ($GLOBALS['inhouse_pharmacy']) {
Expand Down
6 changes: 6 additions & 0 deletions interface/globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
// True to omit insurance and some other things from the demographics form:
$GLOBALS['simplified_demographics'] = false;

// True to omit form, route and interval which then become part of dosage:
$GLOBALS['simplified_prescriptions'] = false;

// You may put text here as the default complaint in the New Patient form:
$GLOBALS['default_chief_complaint'] = '';

Expand All @@ -183,6 +186,9 @@
// status is set to "@" (arrived), then make this true.
$GLOBALS['auto_create_new_encounters'] = true;

// If you don't want employer information and country in patient demographics.
$GLOBALS['omit_employers'] = false;

// If you want Hylafax support then uncomment and customize the following
// statements, and also customize custom/faxcover.txt:
//
Expand Down
130 changes: 90 additions & 40 deletions interface/patient_file/summary/demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
include_once("$srcdir/pid.inc");
setpid($_GET['set_pid']);
}

function print_as_money($money) {
preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
$tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
$ccheck = strrev($tmp);
if ($ccheck[0] == ",") {
$tmp = substr($ccheck,1,strlen($ccheck)-1);
}
if ($moneymatches[2] != "") {
return "$ " . strrev($tmp) . "." . $moneymatches[2];
} else {
return "$ " . strrev($tmp);
}
}
?>
<html>

Expand Down Expand Up @@ -150,40 +164,88 @@ function imdeleted() {
<td valign='top'></td>
</tr>

<? if (!$GLOBALS['athletic_team'] && $result['hipaa_mail']) { ?>
<?php if (!$GLOBALS['athletic_team']) { ?>
<tr>
<td colspan='4' valign='top'>
<?
$result{"hipaa_mail"}=='YES' ? $opt_out='ALLOWS' : $opt_out='DOES NOT ALLOW' ;
<?php
$opt_out = ($result{"hipaa_mail"} == 'YES') ? 'ALLOWS' : 'DOES NOT ALLOW';
echo "<span class='text'>Patient $opt_out Mailed Information </span>";
?>
</td>
</tr>
<tr>
<td colspan='4' valign='top'>
<?
$result{"hipaa_voice"}=='YES' ? $opt_out='ALLOWS' : $opt_out='DOES NOT ALLOW' ;
<?php
$opt_out = ($result{"hipaa_voice"} == 'YES') ? 'ALLOWS' : 'DOES NOT ALLOW';
echo "<span class='text'>Patient $opt_out Voice Messages </span>";
?>
</td>
</tr>
<? } else { ?>
<tr>
<td colspan='4' valign='top'>
<?php
$opt_out = ($result{"hipaa_notice"} == 'YES') ? 'RECEIVED' : 'DID NOT RECEIVE';
echo "<span class='text'>Patient $opt_out Notice Information </span>";
?>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan='4' valign='top'>
<?php
if ( $result["hipaa_message"] == "" ) {
echo "<span class='text'><b>Leave a message with :</b> " .
$result{"fname"} . " " . $result{"mname"} . " " .
$result{"lname"} . "</span>";
}
else {
echo "<span class='text'><b>Leave a message with :</b> " .
$result{"hipaa_message"} . "</span>";
}
?>
</td>
</tr>

<?php } else { ?>
<tr>
<td colspan='4' valign='top'>
&nbsp;
</td>
</tr>
<? } ?>
<?php } ?>

<?php if ($GLOBALS['omit_employers']) { /////////////////////////////////// ?>

<tr>
<td valign='top'>
<table>
<tr>
<td><span class='bold'>Listed Family Members:</span></td><td>&nbsp;</td>
</tr>
<tr>
<td><?php if ($result{"genericname1"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericname1"}?></span><?php } ?></td>
<td><?php if ($result{"genericval1"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericval1"}?></span><?php } ?></td>
</tr>
<tr>
<td><?php if ($result{"genericname2"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericname2"}?></span><?php } ?></td>
<td><?php if ($result{"genericval2"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericval2"}?></span><?php } ?></td>
</tr>
</table>
</td>
<td valign='top'></td>
</tr>

<?php } else { ///// end omit_employers ///// ?>

<tr>
<td valign='top'>
<? if ($result{"occupation"} != "") {?><span class='bold'><? xl('Occupation','e'); ?>: </span><span class='text'><?echo $result{"occupation"}?></span><br><?}?>
<? if ($result2{"name"} != "") {?><span class='bold'><? xl('Employer','e'); ?>: </span><span class='text'><?echo $result2{"name"}?></span><?}?>
<?php if ($result{"occupation"} != "") {?><span class='bold'><? xl('Occupation','e'); ?>: </span><span class='text'><?echo $result{"occupation"}?></span><br><?}?>
<?php if ($result2{"name"} != "") {?><span class='bold'><? xl('Employer','e'); ?>: </span><span class='text'><?echo $result2{"name"}?></span><?}?>
</td>
<td valign='top'>
<? if (($result2{"street"} != "") || ($result2{"city"} != "") || ($result2{"state"} != "") || ($result2{"country"} != "") || ($result2{"postal_code"} != "")) {?>
<?php if (($result2{"street"} != "") || ($result2{"city"} != "") || ($result2{"state"} != "") || ($result2{"country"} != "") || ($result2{"postal_code"} != "")) {?>
<span class='bold'><? xl('Employer Address','e'); ?>:</span>
<? } ?>
<?php } ?>
<br>
<span class='text'>
<?echo $result2{"street"}?><br><?echo $result2{"city"}?><?if($result2{"city"} != ""){echo ", ";}?><?echo $result2{"state"}?>
Expand All @@ -193,7 +255,7 @@ function imdeleted() {
</span>
</td>
<td valign='top'>
<?
<?php
// This stuff only applies to athletic team use of OpenEMR:
if ($GLOBALS['athletic_team']) {
// blue dk green yellow red orange
Expand All @@ -220,41 +282,26 @@ function imdeleted() {
<option value='7'<? if ($fitness == 7) echo ' selected' ?>><? xl('International Duty','e'); ?></option>
</select>
</form>
<? } ?>
<?php } // end athletic team ?>
</td>
<td valign='top'></td>
</tr>
<tr>
<td valign='top'>
<? if (! $GLOBALS['athletic_team']) { ?>
<? if ($result{"ethnoracial"} != "") { ?><span class='bold'><? xl('Race/Ethnicity','e'); ?>: </span><span class='text'><?echo $result{"ethnoracial"};?></span><br><? } ?>
<? if ($result{"language"} != "") { ?><span class='bold'><? xl('Language','e'); ?>: </span><span class='text'><?echo ucfirst($result{"language"});?></span><br><? } ?>
<? if ($result{"interpretter"} != "") { ?><span class='bold'><? xl('Interpreter','e'); ?>: </span><span class='text'><?echo $result{"interpretter"};?></span><br><? } ?>
<? if ($result{"family_size"} != "") { ?><span class='bold'><? xl('Family Size','e'); ?>: </span><span class='text'><?echo $result{"family_size"};?></span><br><? } ?>
<? } ?>
<?php if (! $GLOBALS['athletic_team']) { ?>
<?php if ($result{"ethnoracial"} != "") { ?><span class='bold'><? xl('Race/Ethnicity','e'); ?>: </span><span class='text'><?echo $result{"ethnoracial"};?></span><br><? } ?>
<?php if ($result{"language"} != "") { ?><span class='bold'><? xl('Language','e'); ?>: </span><span class='text'><?echo ucfirst($result{"language"});?></span><br><? } ?>
<?php if ($result{"interpretter"} != "") { ?><span class='bold'><? xl('Interpreter','e'); ?>: </span><span class='text'><?echo $result{"interpretter"};?></span><br><? } ?>
<?php if ($result{"family_size"} != "") { ?><span class='bold'><? xl('Family Size','e'); ?>: </span><span class='text'><?echo $result{"family_size"};?></span><br><? } ?>
<?php } ?>
</td>
<td valign='top'>
<?
function print_as_money($money) {
preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
$tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
$ccheck = strrev($tmp);
if ($ccheck[0] == ",") {
$tmp = substr($ccheck,1,strlen($ccheck)-1);
}
if ($moneymatches[2] != "") {
return "$ " . strrev($tmp) . "." . $moneymatches[2];
} else {
return "$ " . strrev($tmp);
}
}
?>
<? if (! $GLOBALS['athletic_team']) { ?>
<? if ($result{"financial_review"} != "0000-00-00 00:00:00") {?><span class='bold'><? xl('Financial Review Date','e'); ?>: </span><span class='text'><?echo date("n/j/Y",strtotime($result{"financial_review"}));?></span><br><?}?>
<? if ($result{"monthly_income"} != "") {?><span class='bold'><? xl('Monthly Income','e'); ?>: </span><span class='text'><?echo print_as_money($result{"monthly_income"});?></span><br><?}?>
<? if ($result{"migrantseasonal"} != "") {?><span class='bold'><? xl('Migrant/Seasonal','e'); ?>: </span><span class='text'><?echo $result{"migrantseasonal"};?></span><br><?}?>
<? if ($result{"homeless"} != "") {?><span class='bold'><? xl('Homeless, etc','e'); ?>.: </span><span class='text'><?echo $result{"homeless"};?></span><br><?}?>
<? } ?>
<?php if (! $GLOBALS['athletic_team']) { ?>
<?php if ($result{"financial_review"} != "0000-00-00 00:00:00") {?><span class='bold'><? xl('Financial Review Date','e'); ?>: </span><span class='text'><?echo date("n/j/Y",strtotime($result{"financial_review"}));?></span><br><?}?>
<?php if ($result{"monthly_income"} != "") {?><span class='bold'><? xl('Monthly Income','e'); ?>: </span><span class='text'><?echo print_as_money($result{"monthly_income"});?></span><br><?}?>
<?php if ($result{"migrantseasonal"} != "") {?><span class='bold'><? xl('Migrant/Seasonal','e'); ?>: </span><span class='text'><?echo $result{"migrantseasonal"};?></span><br><?}?>
<?php if ($result{"homeless"} != "") {?><span class='bold'><? xl('Homeless, etc','e'); ?>.: </span><span class='text'><?echo $result{"homeless"};?></span><br><?}?>
<?php } ?>
</td>
<td valign='top'>
<table>
Expand All @@ -270,6 +317,9 @@ function print_as_money($money) {
</td>
<td valign='top'></td>
</tr>

<?php } ///// end not omit_employers ///// ?>

<?php
//////////////////////////////////REFERRAL SECTION
if ($result{"referrer"} != "" || $result{"referrerID"} != "")
Expand Down
71 changes: 49 additions & 22 deletions interface/patient_file/summary/demographics_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,15 @@ function set_insurance(ins_id, ins_name) {
</tr>

<tr>
<td><span class='required'><?php xl('Country','e'); ?>: </span></td>
<td><input tabindex="13" type='entry' size='10' name='country_code' value="<?php echo $result{"country_code"}?>"></td>
<td><span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
<?php xl('Country','e'); ?>: </span></td>
<td><input tabindex="13" type='entry' size='10' name='country_code'
value="<?php echo $result{"country_code"}?>"
<?php if ($GLOBALS['omit_employers']) echo "style='display:none'"; ?>></td>
<?php if (!$GLOBALS['weight_loss_clinic']) { ?>
<td><span class='bold' colspan='2'><?php xl('User Defined Fields','e'); ?></span></td>
<td><span class='bold' colspan='2'>
<?php echo $GLOBALS['omit_employers'] ? xl('List Immediate Family Members') : xl('User Defined Fields'); ?>:
</span></td>
<?php } ?>
</tr>

Expand Down Expand Up @@ -352,29 +357,44 @@ function set_insurance(ins_id, ins_name) {
<th colspan='4' align='left' class='bold'><?php xl('HIPAA Choices','e'); ?>:</th>
</tr>
<tr>
<td class='bold' width='10%' nowrap><?php xl('Allow Mail','e'); ?>:</td>
<td class='bold' width='10%' nowrap><?php xl('Did you receive a copy of the HIPAA Notice?','e'); ?> </td>
<td class='bold'>
<select name="hipaa_mail">
<?php
echo " <option>NO</option>\n";
$opt_sel = ($result['hipaa_mail'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_mail']))
? ' selected' : '';
echo " <option$opt_sel>YES</option>\n";
?>
<select name = "hipaa_notice">
<?php
echo " <option>NO</option>\n";
$opt_sel = ($result['hipaa_notice'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_notice']))
? ' selected' : '';
echo " <option$opt_sel>YES</option>\n";
?>
</select>
</td>
<td class='bold' width='10%' nowrap><?php xl('Allow Voice Msg','e'); ?>:</td>
<td class='bold'>
<select name="hipaa_voice">
<?php
echo " <option>NO</option>\n";
$opt_sel = ($result['hipaa_voice'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_voice']))
? ' selected' : '';
echo " <option$opt_sel>YES</option>\n";
?>
<?php
echo " <option>NO</option>\n";
$opt_sel = ($result['hipaa_voice'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_voice']))
? ' selected' : '';
echo " <option$opt_sel>YES</option>\n";
?>
</select>
</td>
</tr>
<tr>
<td class='bold' width='10%' nowrap><?php xl('Allow Mail','e'); ?>:</td>
<td class='bold'>
<select name="hipaa_mail">
<?php
echo " <option>NO</option>\n";
$opt_sel = ($result['hipaa_mail'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_mail']))
? ' selected' : '';
echo " <option$opt_sel>YES</option>\n";
?>
</select>
</td>
<td class='bold' width='10%' nowrap><?php xl('Who may we leave a message with?','e'); ?> </td>
<td><input name="hipaa_message" size='20' value="<?php echo $result['hipaa_message']; ?>" /></td>
</tr>
<tr>
<td colspan='4'>
<a href="javascript:document.demographics_form.submit();" class=link_submit>[<?php xl('Save Patient Demographics','e'); ?>]</a>
Expand All @@ -385,7 +405,7 @@ function set_insurance(ins_id, ins_name) {

<?php } ?>

<table width='100%'>
<table width='100%'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
<tr>
<td valign=top>
<input type=hidden size=30 name=referrer value="<?php echo ucfirst($result{"referrer"});?>">
Expand Down Expand Up @@ -576,15 +596,18 @@ function set_insurance(ins_id, ins_name) {
<tr>
<td><span class=required><?php xl('Group Number','e'); ?>: </span></td><td><input type=entry size=16 name=i<?php echo $i?>group_number value="<?php echo $result3{"group_number"}?>"></td>
</tr>
<tr>

<tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
<td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
(<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>): </span></td>
<td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer value="<?php echo $result3{"subscriber_employer"}?>"></td>
</tr>
<tr>

<tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
<td><span class=required><?php xl('SE Address','e'); ?>: </span></td><td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street value="<?php echo $result3{"subscriber_employer_street"}?>"></td>
</tr>
<tr>

<tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
<td colspan="2">
<table>
<tr>
Expand All @@ -602,6 +625,7 @@ function set_insurance(ins_id, ins_name) {
</table>
</td>
</tr>

</table>
</td>

Expand Down Expand Up @@ -640,7 +664,10 @@ function set_insurance(ins_id, ins_name) {
<span class=required><?php xl('City','e'); ?>: </span><input type=entry size=15 name=i<?php echo $i?>subscriber_city value="<?php echo $result3{"subscriber_city"}?>">
<span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'State' : 'Locality' ?>: </span><input type=entry size=15 name=i<?php echo $i?>subscriber_state value="<?php echo $result3{"subscriber_state"}?>"><br>
<span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'Zip' : 'Postal' ?> <?php xl('Code','e'); ?>: </span><input type=entry size=10 name=i<?php echo $i?>subscriber_postal_code value="<?php echo $result3{"subscriber_postal_code"}?>">
<span class=required><?php xl('Country','e'); ?>: </span><input type=entry size=10 name=i<?php echo $i?>subscriber_country value="<?php echo $result3{"subscriber_country"}?>"><br>
<span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
<?php xl('Country','e'); ?>:
<input type=entry size=10 name=i<?php echo $i?>subscriber_country
value="<?php echo $result3{"subscriber_country"}?>"><br></span>
<span class=bold><?php xl('Subscriber Phone','e'); ?>:
<input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' />
</span><br />
Expand Down
4 changes: 3 additions & 1 deletion interface/patient_file/summary/demographics_save.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
$_POST["hipaa_voice"],
$_POST["squad"],
$_POST["pharmacy_id"],
$_POST["drivers_license"]
$_POST["drivers_license"],
$_POST["hipaa_notice"],
$_POST["hipaa_message"]
);

newEmployerData(
Expand Down
6 changes: 5 additions & 1 deletion library/patient.inc
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ function newPatientData( $db_id="",
$hipaa_voice = "",
$squad = 0,
$pharmacy_id = 0,
$drivers_license = ""
$drivers_license = "",
$hipaa_notice = "",
$hipaa_message = ""
)
{
$DOB = fixDate($DOB);
Expand Down Expand Up @@ -406,6 +408,8 @@ function newPatientData( $db_id="",
pharmacy_id = '$pharmacy_id',
hipaa_mail = '$hipaa_mail',
hipaa_voice = '$hipaa_voice',
hipaa_notice = '$hipaa_notice',
hipaa_message = '$hipaa_message',
squad = '$squad',
fitness='$fitness',
referral_source='$referral_source',
Expand Down
4 changes: 3 additions & 1 deletion library/report.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ phone_biz => "Business Phone: ",
phone_contact => "Contact Phone: ",
contact_relationship => "Contact Person",
hipaa_mail => "Allows Mail: ",
hipaa_voice => "Allows Voice msgs: "
hipaa_voice => "Allows Voice msgs: ",
hipaa_notice => "Notice Received: ",
hipaa_message => "Leave Message With: "
);


Expand Down
Loading

0 comments on commit e9489f4

Please sign in to comment.