Rest API for Provider Scheduling: Calculate Time Slot

From where you get the timeSlot uuid?

This timeSlot is the one you have created here: http://localhost:8080/openmrs/ws/rest/v1/appointmentscheduling/appointmentblockwithtimeslot?v=full1

{
	"location": "aff27d58-a15c-49a6-9beb-d30dcfc0c66e",
	"startDate": "2017-08-31T09:00:00.000+0100",
	"endDate": "2017-08-31T17:00:00.000+0100",
	"provider": "f4d6a64f-d996-4367-aa90-559c10db9b91",
	"types": [{
			"uuid": "7dd9ac8e-c436-11e4-a470-82b0ea87e2d8"
		}
	]
}

The Logic is first you create a block appointment slot and then you place appointment in that slot.

That the point I am raising It does not work in my case.It says Timeslot is empty.Sorry for repeatedly asking but this is not working with me.If possible do the example on Demo server to confirm it. Thanks

So you are saying that block time slot does exist in db and still you are getting exception TimeSlot empty? Can you please put the full stack trace here.

Ok wait I am posting it just in a minute.

Show this in response body. { “error”: { “message”: “Invalid Submission”, “code”: “webservices.rest.error.invalid.submission”, “globalErrors”: [], “fieldErrors”: { “timeSlot”: [ { “code”: “appointmentscheduling.Appointment.emptyTimeSlot”, “message”: “Empty appointment time slot” }, { “code”: “appointmentscheduling.Appointment.emptyTimeSlot”, “message”: “Empty appointment time slot” } ] } } }

From that post I can see type UUID is different. You are creating a block schedule for: this type “7dd9ac8e-c436-11e4-a470-82b0ea87e2d8”

But you are creating appointment for this type: “3ebab8cb-5d67-49d2-830d-f979e30a61f4”

Is this the reason.

I can double check this but I think this is not the reason because I checked with that too.But for confirmation I am creating with same.One thing which Url you are using for creating appointment.I am using this one. http://localhost:8080/openmrs/ws/rest/v1/appointmentscheduling/appointment

First I create the appointmentblockwithtimeslot as with JSON {
“location”: “c0937f0c-1691-11df-97a5-7038c432aabf”, “startDate”: “2017-09-08T00:00:00”,
“endDate”: “2017-09-07T01:00:00”,
“provider”: “9e7f18cb-23ed-4434-a807-086d2a1fda76”,
“types”: [{“uuid”: “3ebab8cb-5d67-49d2-830d-f979e30a61f4” }] }

Secondly I try to create the appointment with returned UUID from first one. {

“appointmentType”: “3ebab8cb-5d67-49d2-830d-f979e30a61f4”,//same appointmenttype “timeSlot”: “733b9839-f18d-4176-bb56-dfb931270800”,/////this one returned from first one “patient”: “dd73d468-1691-11df-97a5-7038c432aabf”,///patient exist in system “status”: “SCHEDULED”//status } But go the same response with of timeslot is empty.

@jaks80 how would you represent this as an enum in a GraphQl Schema ?

I have something like this

type uuid{
    uuid:String
}
enum TimeSlot{
    LOCATION
    START_DATE
    END_DATE
    PROVIDER
    TYPES
}
1 Like

@darius anyone know of the updated Appointment UI, where say for example, a patient specifically asks for a 4pm appointment. I am unable to choose the timeslot to complete this action. or am i missing something?

if anyone help how to write appoinment start time less than 30 minutes from current date