Adding Sunday as a working day in Appointment Scheduling UI

Where I’m implementing OpenMRS, working days are from Sunday to Thursday. Is there a way to change the working days in this calendar? or to make it include all week days like in here:

@mogoodrich Is there anyway the calendar can be made to include all week days?

This would be of great value here

Thank you

There’s no built-in way to do this right now, but taking a quick look, seems like whether or not the appointment blocks calendar widget shows weekend days or not is based on a simple parameter. Assumedly if we could make this configurable via a global property (or some other means) this would support your use case:

Take care, Mark

1 Like

Thank you!

Is there a way to include this update in the next release?

What is the next step?

Write up a ticket for it in the Appointment Scheduling module (and then @ me on the ticket so that I remember to take a look at it and add any comments).

If you’ve got someone who can work on it, after I mark it Ready for Work, feel free to have them take it on… otherwise, hopefully there is someone with spare time in the community who can help.

Once the code is ready, issue a pull request and I’ll review and merge.


Issue created:

1 Like

this issue was solved in this snapshot: is there a way to add it to the module?

@hossam is this a custom fork of the module? If so, do you have it in github and can you issue a pull request against the main repo?

Thanks, Mark

@mogoodrich Thank you for your reply.

I simply changed the parameter “weekends” from “false” to “true” and I compiled it and used it instead of the main Apppointment Scheduling UI module.

I don’t know how to create a global property. and now I’m updating to the reference application 2.7 so I was wondering if the issue was fixed.

Can you please guide me through the process of creating a global property? thank you

@hossam not sure how much development experience you have, but it shouldn’t be too hard.

You specify the global property in the config.xml file, and then you can fetch the global property via the getGlobalProperty method of the administration service.

Looks like there aren’t any global properties currently used in the Appointment Scheduling UI module, but if you look at the config.xml and search for getGlobalProperty in another module like EMR API you should find some examples of their usage.

Take care, Mark

I found this thread helpful when investigating why some of the selenium legacy tests in openmrs-distro-referenceapplication are failing UI master build plan on Sundays and Saturdays.

The solution is to ensure that on Manage Appointment Block page the calendar displays all the days of the week for the tests be able to pick the current day whenever building the plan through out the days of the week.

@samuel34 seemed to have worked around its resolution in this PR but seems to have not resolved the issue of availing these two days on the Calendar.

Have just raised a PR to openmrs-module-appointmentschedulingui repo cc: @dkayiwa @mogoodrich @samuel34 @ibacher

Thanks for the research @kdaud , good catch!

I commented on the ticket, but I think the change shold hopefully be just to change the "“appointmentschedulingui.includeWeekends” on that server to “true”… we shouldn’t actually be making a code change here.

Have updated the PR after setting the global property “appointmentschedulingui.includeWeekends” to a boolean value of true so as to include weekends on the calendar.

Am expecting the demo server to be updated with the changes once it enters into master though am not sure how qa-refapp.demo server will be updated with these changes too since its the server instances we are running against these tests in master !

Am of a thought that if the RefApp 2.12 has not been released yet (cc: @herbert24 @grace), we can have this functionality included in the release !
cc: @mogoodrich @dkayiwa

Setting the global property value for appointmentschedulingui.includeWeekends to true directly on the server made Sunday & Saturday available on the calendar, and now the tests are passing build plan on the weekends as well.

Thanks @mogoodrich @sharif @dkayiwa for the guidance :seedling:

Well done @kdaud , :muscle: Does this mean we close this Ticket :slightly_smiling_face:

1 Like

Hey devs, this is Daud again! For three consecutive weekends have noticed the server seems to synchronize with the default settings in openmrs-module-appointmentschedulingui and turns off the weekends from the calendar. I always have to change the value to true every weekend(this is pain) to have build plans for the PRs on distro-referenceapplication pass GitHub Actions and UI tests pass Bamboo.

What am guessing is to have the default setting of includeWeekends property value changed from false to true within the module at this line code. If the guess isn’t right, then what can be done so that we do not need to always set the value to true on every weekend?

cc: @mogoodrich @ibacher @dkayiwa

@kdaud if the test expects that value to be true, why don’t you set it from right within the test?

I’m going to go back to a suggestion I made months ago and point out that we should just update the code so that it isn’t tied to the “current day” as much. Here is a PR that implements this.

It’s a bad idea to update a module default value just because it’s making our QA process more annoying.

The alternative would be what @dkayiwa suggests and add logic to the test to ensure that the includeWeekends value is true.

1 Like

Thanks @ibacher for working on the fix to have the two selenium tests that were failing on weekends pass the build plan.

However, I observed the tests still fail the build plan on weekends and most likely the fix is sufficient but the changes are not yet deployed on the server.

One thing I would like to be guided is how to have these changes deployed unto the server to have them effected! What specific steps do I need to follow to achieve the goal?

cc: @dkayiwa @mogoodrich @mksd

I confirmed that the changes are already deployed on the server. Hopefully this followup commit will resolve the problem: Fix bug in clickOnNextWeekday · openmrs/openmrs-distro-referenceapplication@f570f92 · GitHub

1 Like