Coding Period with LibreHealth — Week 8
During this week, I worked on one of my project deliverables which involved adding repeat parameters, as they were in event panel, to Calendar admin. First, I added the interface to admin as it was in event panel with three rows as shown in this PR and then I made some changes so that when a user selects an existing category or makes a new category in Calendar admin, he/she can also set values in repeat parameters and save them as default parameter values of that category which would show up in repeat parameters in event panel upon making a new event when the user selects that category. This works in a similar way that how duration of a category is set in admin and is shown in duration in event panel when user selects a category.
I also worked on a very cool feature involving Calendar events. This involved adding drag-drop, resize and copy-paste abilities to events and the first two were completed in this PR. EHR uses FullCalendar as the base for its Calendar and it provides many useful things including the ability to drag-drop and resize events. The only thing it lacked was an update in corresponding event’s database parameters whenever a drag-drop or resize happened. This update was achieved through using FullCalendar’s eventDrop, eventResize callbacks and AJAX. It basically involved passing new values of parameters from JavaScript (as a JS object) to a PHP file which would get these values by POST and run a SQL UPDATE query to save changed values after drag-drop or resize in database.
Get Apoorv Choubey’s stories in your inbox
Join Medium for free to get updates from this writer.
The Add Vacation/Holiday dialog box (PR) was not closing after submission of details of creation of event slots in Calendar. Finding close button element in DOM and simulating a click event on it was used to close dialog box after submission. A Calendar refresh was also added to be triggered when adding process is completed. Besides this, a check and an alert to user before creating event slots was added to prevent adding events when an event already exists on any of the requested dates.
A date range filtering was added to Audit feature (PR) so that a user may filter appointments in Track Appointments tab by entering From and To dates. A global was added to set number of appointments displayed per page in Track Appointments tab and some changes were done in the format of records in Log window. Some images of the Audit feature are shown below:
That’s all for the eight week. Until next time then!









