Skip to content
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

Add New Patient -> Don't reset patient form if there's an error #307

Open
saratheneale opened this issue Jun 19, 2019 · 6 comments · May be fixed by #357
Open

Add New Patient -> Don't reset patient form if there's an error #307

saratheneale opened this issue Jun 19, 2019 · 6 comments · May be fixed by #357
Assignees
Labels
feature New or improved functionality help-wanted Ready for a volunteer to work on P2 Issues not fitting P0, P1, or P3

Comments

@saratheneale
Copy link

When there is an error creating the new patient, it would be good to keep showing the patient information instead of resetting everything.

Example Case 1:

  1. Click add new patient
  2. Note that the focused field highlighted is the Given Name. I thought perhaps ID was autogenerated and I did not fill it out.
  3. fill out names, sex, age
  4. Click OK

Result: Server Error 500 that didn't create user. All patient info I entered is gone. I need to re-enter everything via the Add New Patient button.
Expected: Some kind of form validation to indicate I need to fill it out ID field. Or at least, keep the patient box up with the info I typed.

Example Case 2:
This is also applicable when I create a patient with the same ID as an existing patient.

@saratheneale saratheneale added the feature New or improved functionality label Jun 19, 2019
@zestyping zestyping added help-wanted Ready for a volunteer to work on P2 Issues not fitting P0, P1, or P3 and removed help-wanted Ready for a volunteer to work on labels Jun 25, 2019
@daisuke-plangrid
Copy link

I tested this out in the dev branch (Jun 26th) and crashes the app.

@zestyping
Copy link
Contributor

Okay @daisuke-plangrid, could you report the crash as a separate new issue? It should be labelled P0 because it's a crash. Also, the version number of the app is visible in the title bar on the first screen—please include that number when you report an issue. Thanks!

@daisuke-plangrid
Copy link

Yeah sure!

@mjanes mjanes self-assigned this Jun 27, 2019
mjanes added a commit to mjanes/client that referenced this issue Jun 27, 2019
projectbuendia#307

Easy enough to not close the dialog on hitting submit. Question is tracing through to what needs to be listened to for either success or error response in order to close dialog.
@mjanes
Copy link
Contributor

mjanes commented Jun 27, 2019

Easy enough to not close the dialog on hitting submit. Question is tracing through to what needs to be listened to for either success or error response in order to close dialog.

@mjanes
Copy link
Contributor

mjanes commented Jun 28, 2019

@zestyping Is pointing me towards PatientSearchController.mCreationSubscriber for how this request is listened to.

@mjanes
Copy link
Contributor

mjanes commented Jun 28, 2019

And AddPatientTask.PatientAddFailedEvent and Update>PatientTask.PatientUpdateFailedEvent

mjanes added a commit to mjanes/client that referenced this issue Jun 28, 2019
projectbuendia#307

Do not close patient_dialog_fragment on hitting "Ok". Wait until ItemCreateEvent<Patient> or ItemUpdatedEvent<Patient> to dismiss dialog.

Also, disable the Ok button while request is in flight. Re-enable if submission failed.

Would like a second set of eyes to check the event bus wiring. I am concerned about the potential for leaks here.
@mjanes mjanes linked a pull request Jun 28, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New or improved functionality help-wanted Ready for a volunteer to work on P2 Issues not fitting P0, P1, or P3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants