Add DISMISSED Note on patient demographics page

Hi All,

I would like to share a modification that I did to openemr. Currently, if you have a patient that is deceased, it prints the word Deceased in RED after the patient’s name so it let’s whoever that is looking at that patient’s records that they are deceased. If you put down that someone is dismissed as a patient and you put the reason down, you can’t see offhand that the person is dismissed, unless you go to Misc tab to see if they are or not. Well, i added a few lines after the deceased line to put in RED letters the person is dismissed and the reason they were dismissed.

Here is code: (/interface/patient_file/summary/demographics.php)

after these lines:
$days_deceased = is_patient_deceased($pid);
if ($days_deceased != null): ?>


<?php
if ($days_deceased == 0) {
echo xlt(“DECEASED (Today)”);
}
else if ($days_deceased == 1) {
echo xlt(“DECEASED (1 day ago)”);
}
else {
echo xlt(“DECEASED”) . " (" . text($days_deceased) . " " . xlt(“days ago”) . “)”;
} ?>

<?php endif; **note took out the ?>

now add the following lines:
$output_dismissed = sqlQuery(“select Dismissal, dismissal_reason from patient_data where pid=?”,array($pid));
$dismissed_status = $output_dismissed[‘Dismissal’];
$dismissed_reason = $output_dismissed[‘dismissal_reason’];

   if ($dismissed_status != null): ?>
       <td class="dismissed" style="padding-left:1em;font-weight:bold;color:red">
        <?php if ($dismissed_reason != null) { ?>
        <?php echo xlt("DISMISSED") . ": " . text($dismissed_reason). "."; ?>
        <?php } else {
              echo xlt("DISMISSED");
        } ?>
       </td>
   <?php endif; ?>

Now when someone brings up their chart, they will be aware that the patient was dismissed and should not be allowed to make an appointment.

1 Like

@Edward_Sears This is a good one it will go a long way.

Elijah Wisdom

Hi @Edward_Sears ,

Thanks for sharing your code.

Suggest posting code on github. See here for tutorial on setting up a githup openemr repository(this makes it easier to test, review, and bring into the main codebase, if pertinent):
http://www.open-emr.org/wiki/index.php/Git_for_dummies

-brady