-
Notifications
You must be signed in to change notification settings - Fork 234
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
(fix) O3-2474 adding a patient to a queue should use active visit #1033
Conversation
Size Change: -55.8 kB (-2%) Total Size: 2.97 MB
ℹ️ View Unchanged
|
height: 100vh; | ||
z-index: 99999; | ||
height: calc(100vh - 3rem); | ||
z-index: 3; |
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.
This is an unrelated issue, but has been bothering me for a while, in that the buttons in the Add to queue overlay are barely visible on the screen. This adjustment here I copied from the appointments esm, which presumably had the same issue and was fixed there. Yet another reason not to have multiple overlay implementations all over the place.
return ( | ||
<div> | ||
{isTablet && ( | ||
<Row className={styles.headerGridRow}> |
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.
This form is really just a subset of the full visit-form, and uses the same extension slot to add in the queue fields.
const err = error?.responseBody?.error?.message; | ||
if (err && err === '[queue.entry.duplicate.patient]') { | ||
subtitle = t('patientAlreadyInQueue', 'Patient is already in the queue'); | ||
} |
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.
This is my admittedly somewhat hacky solution to the problem presented in https://openmrs.atlassian.net/browse/O3-2624 . In future refactors, we would not get to this point, but would have pre-submission validation in place, but this is an incremental improvement to at least inform the user of the error, which is caught in back end validation with a specific error message returned.
showSnackbar({ | ||
kind: 'success', | ||
isLowContrast: true, | ||
title: t('startAVisit', 'Start a visit'), |
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.
You can change this label to reflect the queue operation. I just picked it from the video
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.
Thanks @ojwanganto - looks like this PR was merged already by @makombe . I tried to apply this change last night, but am running into build errors at the moment that is preventing me from committing. @makombe maybe you can fix this for me since you merged the PR? Otherwise, I'll address it in a follow-up commit once I have my environment back.
Looks good, @mseaton. I have flagged just a simple label change. |
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.
LGTM. Just a few minor comments.
return null; | ||
} | ||
|
||
const handleSubmit = useCallback( |
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.
Don't really need useCallback here (see this). It makes it difficult to maintain with the list of dependencies.
closePanel: () => void; | ||
} | ||
|
||
const ExistingVisitForm: React.FC<ExistingVisitFormProps> = ({ visit, toggleSearchType, closePanel }) => { |
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.
Maybe add a comment here? Just from the name, it's hard to know that it's meant to be a form to start a queue entry for a patient that already has an existing visit .
Requirements
Summary
When using the service queues app, there is an option to "Add patient to queue", however the form this enables will always attempt to first start a visit before adding a new queue entry associated with that visit. This fails to correctly handle two scenarios:
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-2474
https://openmrs.atlassian.net/browse/O3-2624