Handling of global periods in OpenEMR

Hello all,

I don’t think that global periods (following a procedure) are addressed in OpenEMR as of yet. However, it is a pretty simple update to consider and I would certainly recommend doing this to notify someone that a patient is within the global period. This is critical for any provider that performs any procedures.

First, a new column is needed in the codes table named “global”. It would be added to the Administration>Codes screen to be modified by the user. I added it as a text box “Global Period (days)” right after “Category” text box. The default is 0, but it can be changed for different procedures (some have 0, some 10, and some 90 days).

Once the table is changed, the following code can be added to the new.php file in Interface>Forms>Fee-Sheet, at around line 820 (just under the heading):

$visit_date = substr($enrow[‘date’], 0, 10);
$temp_query = "SELECT datediff(?, DATE(fe.date)) AS days FROM billing AS b, codes AS c, form_encounter AS fe " .
"WHERE b.code_type=‘CPT4’ AND b.activity = 1 AND b.pid = ? AND date(fe.date) < ? AND b.code=c.code " .
“AND c.global > 0 AND datediff(?, date(fe.date)) <= c.global AND fe.pid = b.pid AND fe.encounter = b.encounter " .
“LIMIT 1”;
$gres = sqlStatement($temp_query, array($visit_date, $pid, $visit_date, $visit_date));
$POD_msg = ‘’;
while ($grow = sqlFetchArray($gres)) {
$POD = $grow[‘days’];
$POD_msg = " (Note: Patient is within global period, post-op day #” . $POD . “)”;
}

Now, just under the heading, change the top div to the following:

<?php echo $oemr_ui->pageHeading() . "\r\n"; ?>

<?php //If within global period, display here echo text($POD_msg); ?>

That’s all that needs to be done. As a result, the system will be able to handle global periods. That is, when a visit is within the global period, a red note will appear in the Fee Sheet, informing the coder that the patient is within the global period. That will prompt the patient to consider either not billing for the visit (post-op visit) or bill with an appropriate modifier. Currently, if a procedure is performed, the provider has to try to remember how long ago it’s been and to remember to add a modifier.

Let me know what you think…

Cheers,
Alex.

Oops, that last part of the code, the div portion did not show up properly.

Here it is:

echo htmlspecialchars("
    <div class="row">
            <div class="col-sm-12">
                <div class="page-header clearfix">
                    <?php echo  $oemr_ui->pageHeading() . "\r\n"; ?>
                </div>
                <div class="clearfix" style=color:red><b><h4>
                        <?php
                        //ALB If within global period, display here
                        echo text($POD_msg);
                        ?></b></h4>
                </div>
            </div>
       </div>
")

Ok, I’m not sure how to post html code here without the browser converting it, so that’s why it’s not coming out right. Please let me know how to post a block of html code and I’ll upload it again.

Alex.

hi @cerber98, thanks for the nice posts, another way to share the code is by following the contributing guide and opening a PR

you can see added the backtics above the block of code, believe it follows markdown syntax, to end the block, use 3 more backtics