-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Conversation
@pete-the-pete missed appointments doesn't mean all appointments in the past, it means appointments that were scheduled and the patient didn't show up. The appointments missed should show all appointments that have a status of Missed, which will be a new status that will need to be added to hospitalrun/mixins/appointment-statuses. You can then pass a filterBy value of Missed to the _modelQueryParams defined for the route, eg: options: {
startkey: [startOfWeek, null, null],
endkey: [endOfWeek, endOfWeek, maxId],
filterBy: [
name: 'status',
value: 'Missed'
]
}, Also, it looks like the tests are failing. |
Ah...thanks for clarifying, and pointing me in the right direction. I'll try to get something up soon. |
@jkleinsc, finally back from vacation.... I don't understand how an appointment can be aware if a patient showed up or not. My thought was to see if a given appointment had any visits, but there isn't a relationships between the two. Should there be? I could add it, so that there is a hasMany relationship between appointments and visits. Appointments that have no visits, and the the current data is past the appointment date would then be set to "Missed" (the status would be updated when visiting the appointments route). Thoughts? |
@pete-the-pete the key here is instead of looking at this as something that the system automatically determines, the marking of an appointment as missed is something that requires human interaction. I suppose at some point we could make this an automated process, but at this point using the status already used on an appointment is an appropriate way to handle this. |
No, I agree @jkleinsc. Giving admins a way to manually set this for patients seems like the best path forward at this point. 👍 |
Setting that status is more straightforward. I filtered the data in the route's model hook. I couldn't get the filterBy property to actually accomplish things (I'd like to talk that through in slack and some point). Hopefully this is attempt is closer. |
@pete-the-pete to use the filterBy parameter on the couch view, you can pass it along by overriding the _modelQueryParams function in the route. For example: _modelQueryParams() {
let queryParams = this._super(...arguments);
queryParams.filterBy = [{
name: 'status',
value: 'Missed'
}];
}, This will pass along the filter value to couch view. |
@jkleinsc thanks for the help. I ignored the cors errors, and saw it working. Hopefully this is it. |
@pete-the-pete looks good... just one more thing. The controller and template for missed should just extend/use the controller and template from app/appointments/index because the code exactly them same. If you take a look at app/appointments/today/controller.js and app/appointments/today/template.hbs you will see how that route uses the index controller and template. If you don't have time to do this let me know and I'll do it. |
I updated the controller and template. Hopefully its good to go. |
Fixes #351 .
I didn't realize the other appointment routes already filter to the latest, so 'missed' doesn't require any filters.
I added a test, and modified the
createAppointment
helper function to accept params.cc @HospitalRun/core-maintainers