hospitalrun-frontend
hospitalrun-frontend copied to clipboard
Add `New Imaging Request` button on visits page
🚀 Feature Proposal
There should be a new button added to the patient visits page which allows a user to make a new imaging request quickly.
This button should navigate the user to the Imaging Request page when clicked and auto-populate the patient and visit information.
Can i be assigned for this ?
Yes, @Fibii! I've assigned this to you!
There are two ways to do this, since when we view a patient, the patient
state will store that patient, we can just use that state to populate the info for the imaging request
in NewImagingRequest
const { patient } = useSelector((state: RootState) => state.patient)
will get us the last patient that we we viewed, which is the patient we wanted to add an imaging for
The other way would be passing the patient as props to NewImagingRequest
and populate the fields with the passed props
which way should it be @jackcmeyer, i'm also interested in new ideas.
I think the best way is to pass the current patient id using react-router.
When doing history.push
you can pass state with the second param.
history.push('/imagings/new', { patientId: currentPatientId })
Then on the new imaging request we can read it like:
const location = useLocation()
const { patientId } = location.state
Hi @jackcmeyer , If no one is working currently, I would like to work on this.
Hi @Fibii , compliments of the season and best wishes for 2021! Just checking how this work is going.
Hi @blestab, i added a PR #2550 (tests are not implemented yet), i want a review on the changes before implementing the tests since the proposal didn't include any details
If everything's fine, maybe @dev-script can implement the tests if they want to?
have a nice day y'all and sorry for the late PR :)
Thank you @Fibii I have some feedback for the PR, do you want to tackle it or should i ask if @dev-script can take it over
@blestab @dev-script can take over if they want to
@blestab can you please assign me
@dev-script sure
@tehKapa can you please confirm once where to place the Imaging Request button exactly.
I would put it instead of "Add visits" button (that is redundant) when I open the detail of the visit
![Screenshot 2021-02-09 at 12 31 58](https://user-images.githubusercontent.com/6388707/107358051-3123b700-6ad3-11eb-9c59-884da85a0a3a.png)
@dev-script Hello. Are you still working on this issue?
@baoqchau you can take over
I have a lot of work recently so I can no longer work on this issue. Anyone else feel free to take it
@tehKapa @blestab @jackcmeyer Hello, could I be assigned this?
@gcrt0701 yes :)
Which fields should be auto-populated in the New Imaging Request form? The patient name seems obvious but I don't understand how the Visits field should be filled in.