-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) re-use upcoming appointment work to mark appointments as Checked In
#1743
Conversation
Size Change: +1.39 kB (0%) Total Size: 10.8 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know the background of this ticket, defer to @mogoodrich on that, but made a few comments within the PR.
export function saveAppointment(appointment: AppointmentPayload, abortController: AbortController) { | ||
return openmrsFetch(`${restBaseUrl}/appointment`, { | ||
export const updateAppointmentStatus = async (toStatus: string, appointmentUuid: string) => { | ||
const abortController = new AbortController(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this took in an abortController, now you are instantiating one. I think there is a useAbortController
hook in esm-framework. Perhaps you are meant to use that? @ibacher / @denniskigen ?
return openmrsFetch(`${restBaseUrl}/appointment`, { | ||
export const updateAppointmentStatus = async (toStatus: string, appointmentUuid: string) => { | ||
const abortController = new AbortController(); | ||
const statusChangeTime = dayjs(new Date()).format(omrsDateFormat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really need to instanatiate and format the date? Can you not just submit a new Date()
in the body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think you need to format the date into the OMRS date format, but you probably don't need to do the new Date(), ie you could just do dayjs().format(omrsDateFormat), but i might be wrong about that.
packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me, though note @mseaton 's questions on the abort controller and comments about the "checked" text.
return openmrsFetch(`${restBaseUrl}/appointment`, { | ||
export const updateAppointmentStatus = async (toStatus: string, appointmentUuid: string) => { | ||
const abortController = new AbortController(); | ||
const statusChangeTime = dayjs(new Date()).format(omrsDateFormat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think you need to format the date into the OMRS date format, but you probably don't need to do the new Date(), ie you could just do dayjs().format(omrsDateFormat), but i might be wrong about that.
8ca8215
to
3d6ba9e
Compare
Requirements
Summary
re-use upcoming appointment work to mark appointments as
Checked In
Screenshots
Related Issue
Other