Response JSON is missing Time Slot properties. It is sending bellow properties:
private Date startDate;
private Date endDate;
private Provider provider;
private Location location;
private Set types;
@jaks80 I suggest that you use your browser’s javascript console to inspect the REST calls being made from the current code. If those calls aren’t returning a time slot length, then maybe it’s being calculated from the start and end date.
One other thing: in the Appointment Scheduling module, appointment block and time slot are not the same thing. You can have multiple TimeSlot in one AppointmentBlock. I assume this is documented somewhere, at the very least in the design notes for when this module was built. I suggest you look for that documentation and make sure you’re doing the right thing, as the module expects it.
Both URL books provider schedule only difference is:
First URL books between date range and allow to split this range in Provider time slot(60 Minutes slot etc) and appointments for multiple patients can be booked in this time slot . Second one books only for one day and whole day is one Provider itime slot.
I am taking second approach as this is the only rest based service. That is why I was thinking first approach may have been deprecated.
Regards
Thanks for your reply.Jaks it’s created the appointment block with time slot but not what we required.Actually we want that in one appointment block we have several appointment slots.
For example if we have an appointment block between
{
//other inputs are assumed
startDate:2017-08-24T12:00:00.000+0500,
endDate:2017-08-25T12:00:00.000+0500
}
what it does it just created one time slot from 12:00:00 to 12:00:00 but actually we want that between these Dates we want many timeslots of 20 minutes…For example if we want a timeslot of 20 minutes it will provider us startDate-EndDate/20=10 just for example So,we will have 10 timeslot between these dates of 20minutes.That what openmrs does on Demo application But I think this is not possible through Rest API?
Hi, Naveed,
You are correct. I did not find it using rest api. The example I have shown in an work around I am using.
I did not find any documentation how appointment scheduling suppose to work. If any one has any link of documentation pass it here please.
It uses the old user interface, but it explains the relationship between appointments, appointment blocks, and timeslots, and I believe that information is still fairly accurate.
After watching the video related to appointment Module.Things clear to me but problem remain unsolved.
There are three main things in appointment Module.
1.Appointment Block (A provider scheduled block created between start and End Date)
2.Time Slot (A time slot length that will be created inside the Appointment Block for example 60)
3.duration(duration of appointment type for example neurology duration is 20)
In appointment module actually happen is that duration is an input to scheduled algorithm on the basis of duration that many appointment is created in one slot.For example if we have a slot of 60minutes then there will be three appointment type of neurology (20minutes).If we try to created 4th one it’s not gonna create for us.But through API this is not working It seems scheduled algorithm is not working properly with Rest API?
Hi darius! I think it’s not calculated from start date minus date.There is an algorithm behind the scene which take duration as input and create that many appointment in any given slot.Does Rest API support the schedule algorithm or it does not?
Block booking slot does not save slots in database. What it does is breaks down dateFrom and dateTo and save it as multiple slots.
For example:
{
startDate:2017-08-24T09:00:00.000
endDate:2017-08-25T17:00:00.000
}
and If you specify 60 minute slot than backend will create 8 block appointments.
Yes thanks you are right.But when I try to used that slot for appointment it does not work.It show’s error that empty.timeslot.But it worked fine with interface.
For example during appointment I pass these objects
{
“appointmentType”: “3ebab8cb-5d67-49d2-830d-f979e30a61f4”,
“timeSlot”: “6c3afe83-ce18-4a8f-be58-afebd5e00a7e”,
“patient”: “dd662071-1691-11df-97a5-7038c432aabf”,
“status”: “SCHEDULED”
}
It show this Error that timeslot.empty
> One thing more you said If you specify 60minute than backend will create 8 block appointments.
My query is where I can specify timeslot in appointmentblock.I there is not supported property for timeslot while creating appointmentblockwithtimeslot.
This is the JSON working for me:
{
“timeSlot”: “ef467379-fd83-4c4e-b283-53fb90a75212”,
“patient”: “1e9caea5-d31e-4436-80ec-2b10b88a5739”,
“status”: “SCHEDULED”,
“reason”: “”,
“appointmentType”: “4da187c6-c436-11e4-a470-82b0ea87e2d8”
}
Change appointmentType json structure.
As we have been discussing there is no restAPI to specify time slot. I was talking about this URL:
openmrs/module/appointmentscheduling/appointmentBlockForm.form?redirectedFrom=appointmentBlockList.list