Frappe Health - Patient Portal

Hi Friends,

I’m trying to get the new Patient Portal from the patient-portal branch of Frappe Health

I’m stuck when it comes to showing the available slots. They don’t get displayed and console log shows an error:

The error:

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 91, in application
    response = frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
TypeError: get_availability_data() missing 1 required positional argument: 'appointment'

It looks like the function get_time_slots in book_patient_appointment.js is missing an argument. I tried adding appointment: null, but it still doesn’t work.

@akash_krishna is this a bug or i am doing something wrong?

1 Like

@wirpo032 let me check and will push a fix.
Thanks

1 Like

@wirpo032 I has pushed a fix to the same branch, can you please pull from the branch and try?

1 Like

First off, thank you so much for helping.

I pulled the files, but I believe the error is not totally solved, because between the lines 70-80 of health/healthcare/www/book_patient_appointment.js, there is not yet an appointment argument:

In order to test the rest, I set a fixed argument myself using an appointment type that I have set up beforehand (appointment type A), as you can see below:

The website now shows the appointment type as a dropdown, but the timeslots are not being shown. I set an frappe.errprint on the patient appointment function and can see that an output is requested, but it is not shown on the website.

In short: There is one argument missing in the book_patient_appointment.js file. I do not know why the slots are not being shown, though. Any ideas?

apologies. i gave it another shot today and it works. thank you so much.

there just a minor issue: when someone tries to book a meeting with an overlap, i get an error message (as I should), but afterwards, I cannot enter a new date?

Would it be possible to do the overlap check before the slot is being shown as available?

Yes sure I will push a fix for the issue you mentioned
Btw for ydays query - new field Appointment Type came in because in develop branch
we made appointment type field mandatory thats why…
Also argument appointment you mentioned missing is changed to an optional argument as it is only required while booking from form view.
Thanks…

2 Likes