Encounter Date Population Change

juggernautsei wrote on Friday, July 15, 2011:

Hi, We have a change we would like to make to the way the encounter is populated when it is automaticly created.

When the encounter was opened, the “Date of Service (From)” and “Onset/hosp. date” both defaulted to the current day’s date (in this instance it was 07-15-11) and the “Date of Service (To)”  was blank.

What we need to have happen is that the “Date of Service (From)” and the “Date of Service (To)” populate with the current day’s date and that the “Onset/hosp. date” default to “0000-00-00”.

Thanks for any help

yehster wrote on Saturday, July 16, 2011:

For Onset/hosp date.
The file you need to edit is
/interface/forms/newpatient/common.php
around line 276
change the value attribute of the text input such that the ternary operator when $viewmode isn’t set to return the current date instead of an empty string like it does now.
refer to the previous lines in the code which set the Date of Service as to the current date to see how that would work.

    <tr<?php if ($GLOBALS['ippf_specific'] || $GLOBALS['athletic_team']) echo " style='visibility:hidden;'"; ?>>
     <td class='bold' nowrap><?php xl('Onset/hosp. date:','e'); ?></td>
     <td class='text' nowrap><!-- default is blank so that while generating claim the date is blank. -->
      <input type='text' size='10' name='form_onset_date' id='form_onset_date'
       value='<?php echo $viewmode && $result['onset_date']!='0000-00-00 00:00:00' ? substr($result['onset_date'], 0, 10) : ''; ?>' 
       title='<?php xl('yyyy-mm-dd Date of onset or hospitalization','e'); ?>'
       onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
        <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
        id='img_form_onset_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
        title='<?php xl('Click here to choose a date','e'); ?>'>
     </td>

juggernautsei wrote on Saturday, July 16, 2011:

Thank you,

We will test this out on Monday.

juggernautsei wrote on Wednesday, July 20, 2011:

Thanks again,

I have applied the code given above and there are mixed reviews from the client and the billing person. The billing person says her part works. But the office manager says that the DOS To date is not populating anymore now. She says that the DOS From and To should auto populate with the same date.

I only changed the code that was given above. What triggered the DOS To: to now be a blank line?

Here is the code:

<tr>
     <td class=‘bold’ nowrap><?php xl(‘Date of Service (To):’,‘e’); ?></td>
     <td class=‘text’ nowrap>
      <input type=‘text’ size=‘10’ name=‘form_date_to’ id=‘form_date_to’ <?php echo $disabled ?>
       value=’<?php echo $viewmode ? substr($result, 0, 10) : date(‘Y-m-d’); ?>’
       title=’<?php xl(‘yyyy-mm-dd Date of service (To)’,‘e’); ?>’
       onkeyup=‘datekeyup(this,mypcc)’ onblur=‘dateblur(this,mypcc)’ />
        <img src=’…/…/pic/show_calendar.gif’ align=‘absbottom’ width=‘24’ height=‘22’
        id=‘img_form_date_to’ border=‘0’ alt=’’ style=‘cursor:pointer;cursor:hand’
        title=’<?php xl(‘Click here to choose a date’,‘e’); ?>’>
     </td>
    </tr>

    <tr<?php if ($GLOBALS || $GLOBALS) echo " style=‘visibility:hidden;’"; ?>>
     <td class=‘bold’ nowrap><?php xl(‘Onset/hosp. date:’,‘e’); ?></td>
     <td class=‘text’ nowrap><!- default is blank so that while generating claim the date is blank. ->
      <input type=‘text’ size=‘10’ name=‘form_onset_date’ id=‘form_onset_date’
       value=’<?php echo $viewmode && $result!=‘0000-00-00 00:00:00’ ? substr($result, 0, 10) : ‘’; ?>’
       title=’<?php xl(‘yyyy-mm-dd Date of onset or hospitalization’,‘e’); ?>’
       onkeyup=‘datekeyup(this,mypcc)’ onblur=‘dateblur(this,mypcc)’ />
        <img src=’…/…/pic/show_calendar.gif’ align=‘absbottom’ width=‘24’ height=‘22’
        id=‘img_form_onset_date’ border=‘0’ alt=’’ style=‘cursor:pointer;cursor:hand’
        title=’<?php xl(‘Click here to choose a date’,‘e’); ?>’>
     </td>
    </tr>

I do really appreciate your helping me. (US)