Can I expand the list of providers in the Schedule view?

elandau1260 wrote on Thursday, February 13, 2014:

Hello: I am wondering if there is a way to make the list of providers in the Schedule view longer so that I do not have to scroll if I have more than 4 providers?

Thanks
-Ed

pfwilliams wrote on Saturday, February 22, 2014:

I’ve been doing the following mods to every patch that has come out for more than a year. It addresses something that, within 60 seconds of first laying my eyes upon OpenEMR, had me saying “That’s pretty cheesy…”. A provider named “Rupert Schnitzeldinger” would get 3 times the real estate, a calendar column 2 or 3 times wider, than a provider named “Bob Lee”. This mod forces a standard calendar column width upon the day view of the Outlook style calendar.

I’ve tested it with as few as 4, and as many as 12, providers defined. When necessary, it will collapse first names down to first initial on providers with long names, or drop the entire first name if required. I’d intended to make an improvement to replace the hard-coded value given the variable representing how many monospaced characters will fit across the entire calendar. Detecting a user’s screen resolution and then adjusting the value of that static variable would be a better solution. We’ve a mix of 16:9 and 16:10 monitors and it has worked well for us using wide-screen resolutions of 1280x800, 1440x900,

1600x900, up to 1920x1080. One can nitpick that it is not a perfect solution, but for minimal code changes, it yields a much more professional-appearing and flexible calendar that can accommodate a larger number of providers.

Two modules require changes, back them up, then:

In openemr\interface\themes\ajax_calendar.css modify .providerheader to these settings:

/* for the header row with provider names */
.providerheader {
font-family: “Lucida Console”, Monaco, monospace;
font-size: 0.7em;
text-align: center;
background-color: #EDEAFF;
width: 100%;
overflow: hidden;
border-bottom: 1px solid lightgrey;
white-space: pre;
}

This switches to a monospaced font, changes how whitespace is handled, and reduces the unnecessarily large MARQUEE-SIZED font currently displaying the provider names.

In \interface\main\calendar\modules\PostCalendar\pntemplates\default\views\day\ajax_template, delete the three lines of code between these two lines:

// row with the dates or day-of-week (DOW)

And:

echo “<div class=‘calendar_day’>”;

And replace those 3 deleted lines with these 12 lines:

$pname_display = htmlspecialchars($provider[‘fname’],ENT_QUOTES)." “.htmlspecialchars($provider[‘lname’],ENT_QUOTES);
If (strlen($pname_display) > $pname_max) { // if full name exceeds $pname_max, collapse first name to first initial
$pname_display = htmlspecialchars(substr($provider[‘fname’], 0, 1),ENT_QUOTES).” “.htmlspecialchars($provider[‘lname’],ENT_QUOTES);
If (strlen($pname_display) > $pname_max) { // if full name still exceeds $pname_max, remove first initial
$pname_display = htmlspecialchars($provider[‘lname’],ENT_QUOTES);
}
}
$pname_len = ($pname_max - strlen($pname_display)) / 2;
$pname_display = substr(” “, 0, $pname_len).$pname_display.substr(” “, 0, $pname_len + .5);
echo “<td class=‘schedule’ title=’”.$pname_display.”’ date=’".date(“Ymd”,$caldate )."’ provider=’$providerid’>";
echo “<div class=‘providerheader’>”;
echo $pname_display."</div>";

Edit:
About 10 lines above the “// row with the dates or day-of-week (DOW)” comment is the start of a foreach loop, above that insert these two lines:

$pname_max = 136 / count($providers); // tune for resolution?
If ($pname_max < 13) { $pname_max = 13; }; // tune for resolution?

bradymiller wrote on Tuesday, February 25, 2014:

Hi Paul,

Would be much better if you can you get this into git/github. See here for a tutorial:
http://www.open-emr.org/wiki/index.php/Git_for_dummies

thanks,
-brady
OpenEMR

pfwilliams wrote on Thursday, May 01, 2014:

I may or may not have just accomplished something using GitHub (other than the greying or loss of hairs). I still need to modify the users table edit for the calendar column to allow a range of numeric values (representing calendar column position). To date, I’ve just poked the values in manually using MySQL Workbench. We now have 10 providers on the calendar and it still looks great. A users.calendar value of 0 means what it always did, a non-zero value gets them on the calendar, and the value determines the column order. So, say we have 5 MD’s wanting a specific order (seniority, etc), 2 physical therapists, and 3 RN’s doing minor procedures, I might set the users.calendar values, respectively, to: 1, 2, 3, 4, 5, 11, 11, 21, 21, 21. Those with equal values will display alphabetically by name (as we were forced to display all providers in the past).

cmswest wrote on Friday, May 02, 2014:

cool, what’s the name of your github fork?

i.e., GitHub - stephenwaite/openemr: Mirror of official OpenEMR Sourceforge repository

pfwilliams wrote on Monday, May 05, 2014:

Is that all you need?

cmswest wrote on Monday, May 05, 2014:

yes, thanks, found your branch here:

bradymiller wrote on Sunday, May 11, 2014:

Hi,

This can now be tested in the following “Up For Grabs” demo:
http://www.open-emr.org/wiki/index.php/Development_Demo#192.168.1.133

Looks like you are basing this on codebase from a year ago. Will want to base it on most recent codebase. To allow selection of the priority setting, could place a input field in the Administration->Users gui module.

-brady
OpenEMR

mdsupport wrote on Thursday, May 15, 2014:

To make calendar usable on tablets our approach was -

  1. Hide date-selector, provider list and facilities.
  2. Dates are now selected in a popup calendar by hover/click on date navigation area.
  3. Provider(s) are selected in a popup list of providers by hover/click on provider name displayed on top of calendar.
  4. Remember user choices so each user has display that they last used.

With my staff clamoring to be able to change the order providers are displayed on the Calendar, I came across this thread.
Has anyone else applied this code modification? I ask because of Brady’s comment:
“Looks like you are basing this on codebase from a year ago. Will want to base it on most recent codebase. To allow selection of the priority setting, could place a input field in the Administration->Users gui module.”
Also, this mod was written 3 years ago; is it possible for me to find out if this mod will still work on v.5.0?
Thanks in advance for any help.

hi @ptalerico ,
Do any of these mods in this thread address the issue of selecting the ordering providers on the calendar? If so, I can take a quick look at the code to give you an idea of whether it will work.
-brady

Yes, sir, the mod allows changes to the order that the providers are displayed and also looks to make all columns of equal width, rather than having the width be based on the length of the provider’s name.