prime-simplereport icon indicating copy to clipboard operation
prime-simplereport copied to clipboard

2.0 Form: Validate patient address with smarty

Open KeepAustinWired opened this issue 3 months ago • 0 comments

User Story

As a SimpleReport operator, I want to use Smarty to validate patient addresses, so that I can ensure data quality.

Acceptance Criteria

  • Integrate Smarty into the patient information section of the 2.0 form. Similar to the 1.0 new patient form
  • Upon hitting the Next button on the patient information page, we hit smarty to validate the address
  • If the address was invalid, we pop up a modal to show a suggested address. Similar to the 1.0 new patient form
  • If the address was valid, we continue with the form submission.

Scenarios

For example, this could look like:

[valid address]

  • User fills out all patient information, including a correct address
  • User submits the form, continues to the next section

[invalid address with suggestion]

  • User fills out all patient information, including an address with a misspelled street
  • Modal pops, giving the user the option to Use address as entered or Use suggested address
  • If the user picks one of the Use... options from the modal, we should update to use that address and not hit smarty again
  • <- Go back to edit address and Save changes should still be options in the modal.

[invalid address without suggestion]

  • User fills out all patient information, including an invalid address
  • Modal pops, giving the user the option to Use address as entered. The box usually containing Use suggested address should instead say "No Suggested address found".
  • There is an alert banner that reads "The address you entered could not be verified"
  • If the user picks the Use... options from the modal, we should use that address and not hit smarty again
  • <- Go back to edit address and Save changes should still be options in the modal.

Design Notes

Existing behavior from the 1.0 patient form:

Screenshot 2025-10-02 at 2.17.02 PM.png Screenshot 2025-10-06 at 10.17.30 AM.png

Additional context

In my experience with Smarty in lowers, using an incorrect street number will not find a suggested address. Using a slightly misspelled street name will frequently come back with a suggested address.

When in doubt refer to the behavior of the 1.0 form.

A problem for the leads to wrestle with: How does cost/benefit change if we do this on every single test report where we used to do it on every single patient (and didn't change it once patient was added)?

KeepAustinWired avatar Sep 16 '25 19:09 KeepAustinWired