Appointment scheduling module, appointments with query params

querrying appointments with params is not working as expected http://localhost:8900/openmrs/ws/rest/v1/appointmentscheduling/appointment?visit=77009090-4015-11e4-8e9b-2939a1809c7e&v=full returns for me all the appointments instead of of only those with the specified visit @mogoodrich @adamz

These are the recognised parameters:

I would support adding “visit” as a parameter… @jecihjoy would you want to ticket and/or add this?

yes kindly

@jecihjoy feel free to go ahead and create that ticket.

hello. I created this ticket

I have worked at it and i’m yet to create a pull request. I was hoping you could look at it and maybe change it’s status to ‘Ready for work’, kindly.

Also I don’t have writes to create tickets and add information to a ticket, I was requesting for some rights.


Did you write to helpdesk asking for JIRA access?

I did sometime back and i’m able to login, I’m only missing the rights

Did you ask helpdesk for those rights?

okay i’ll do that. Thank you

kindly help me here, how exactly do you use the visit column in the appointment table

for appointment a1:

  1. Is to store visit_id of the visit that was active when the appointment was being booked? or
  2. Is to store the visit_id of the visit that fulfilled that appointment, a1 when patient came back to clinic?

@mogoodrich @dkayiwa

Good question @jecihjoy, we should likely document that better… it’s #2, the visit that fulfilled the appointment.

You can see a couple places where it is used, visit in the “old” UI added in the Appointment Scheduling module (we don’t use this, so I’m not too familiar with the details):

And here in the “newer” UI we add an HTML form entry tag that can be used to “check-in” a patient to an appt as part of an HTML Form:

Take care, Mark

does that mean when I create the appointment the visit column will be null but when i’ll be updating the status of the appointment to ACTIVE ( ie when a patient comes for the appointment and the visit is started) ill also be updating the visit column to the visit_id of the visit that was just started?

@jecihjoy that’s what I believe we do in our implementation, and that makes the most logical sense to me, but I don’t think the module itself enforces that you handle this in any particular way.

this is fair enough,

thank you


kindly review pr

for ticket

I added ability to query appointments via visit id

Also linked appointment types to visit types, to enable querying of booked appointments of given visit types. This will help know things like the number of expected patient visits in a certain visit type

thank you

Thanks @jecihjoy… I will review in the next day or two… if you haven’t heard from me by Thursday, feel free to ping me again… :slight_smile:

noted Thank you

kindly check

and advice?

Also with regard to your comment on me creating new methods instead of changing existing ones for backward compatibility, will it entail all these

a) creating a new DAO method getAppointmentsByConstraints with VisitType as it’s additional parameter

or in the DAO layer i can reuse existing method and add my additional visit type query criteria on it

b) Creating additional getAppointmentsByConstraints method in the service layer with one additional parameter, visit type

c) creating a new AppointmentResource2_0 that overrides AppointmentResource1_9 and exposes only this method??