sfbrigade / sf-lifeline

GNU Affero General Public License v3.0
7 stars 4 forks source link

[Closes #97, #44] Admin/Staff/Volunteer user can register a new Patient from an unused QR code #109

Closed samau3 closed 2 months ago

samau3 commented 3 months ago

Closes #97, closes #44.

This PR adds the ability for an authorized user to register a new patient after loading a URL tied to a new patient ID.

Some things to note:

francisli commented 2 months ago

@samau3 I just pushed up a change to the Procfile so that it lauches Prisma Studio with the rest of the server, so that you can inspect changes to the database at http://localhost:5555 if you want...

francisli commented 2 months ago

@samau3 I just updated the seeds script to seed Hospital records... we'll need to create an API endpoint for Hospitals so that the form can pull it and populate the selection...

samau3 commented 2 months ago
  • I think it would be great to sit down with Tyler who designed this flow to see how well it matches what he was thinking of. One thing that feels weird for me is the Register button at the bottom, and the lack of any explicit call to action between sections- i.e. is it clear that user's are expected to tap on each section to open them up and complete them? I wonder if having a submit button in each section would help with the UX... would you be able to demo this to the design team on Weds night?

I've incorporated the feedback from Weds night when I demoed it, but let me know if I missed anything else! I think any other major form changes can be moved to a new PR so we can use this registration form to start user testing with

  • Once you advance to the next section, you can't go back because the form validation complains about empty required fields...

I've reduced the strictness regarding which fields are required for form validation to only the information needed for Basic Information for now

  • Combo boxes like Gender, Language, etc don't seem to support autocomplete typing... that is, I can't start typing "MA..." and get MALE or "EN..." and get "ENGLISH"... ?

I made adjustments to these inputs by adding a searchable prop to allow a user to type into the field to narrow down the options

  • If I refresh the browser at any point, I'm restarted back at the first section and all the data is lost. Could we use routing to manage section visibility state, so that a refresh would bring you back to the same section? And can we check if the record has started and have previously entered data available to edit?

I've added a GET patient/:id route that is called when the form is opened to prepopulate the form with existing data for a patient (if there is any)

  • When I fill out the Basic Information section then tap on section 2, I get both a success and a failure toast notification:

Fixed the conditional logic check to prevent this!

  • If I fill out the Basic Information section, and press ENTER in the last date of birth field, it advances to the next section, with all of the required fields shown in error. No network request was made to POST the initial data.

Made some adjustments to the form to prevent enter triggering a form submission