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

Parse bundle response and add errors to error modal #74

Closed
stefpiatek opened this issue Oct 10, 2022 · 0 comments · Fixed by #77
Closed

Parse bundle response and add errors to error modal #74

stefpiatek opened this issue Oct 10, 2022 · 0 comments · Fixed by #77
Assignees

Comments

@stefpiatek
Copy link
Collaborator

stefpiatek commented Oct 10, 2022

when submitting a bundle in the report form, we should parse the response bundle and then add any errors that exist from that bundle to the error modal.

  • using existing check method that we tested with, when "type: "batch-response", check the following:
  • For every resource response which doesn't have a response that starts with 2:
    • the error code, the resource type and the diagnostics - maybe in table?
    • display this in the modal with an error type like we do with a failed REST response
  • automated tests for this (wooohooo)
    • in ReportForm.test.ts we make a new test which (at the moment will already have a natural failure because we changed from transaction to batch and didn't quite catch everything)
      • delete patients and related data
      • go through the steps to submit a bundle from the front end
      • assert that there is a modal element with error in the title in there
  • Update the ReportForm response action to check for any batch responses which have a problem and if there are any, create an error modal
  • then we'll need to make a test case setup which makes one of the conditions error - possible ideas:
    • Send a POST request to create two practitioners with the same identifier?

other code suggestions:

  • create a testUtilities.ts file for shared resources
  • move the check method into the fhir api.ts?

example output of modal

There was an error submitting the bundle, for now you may need to manually correct this!

Error code resource type diagnostic message
404 Not Found Patient Organization/8274t6483.... not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants