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

Sandbox environment warns user when providing default search responses #866

Open
Dunmail opened this issue Feb 23, 2023 · 0 comments
Open

Comments

@Dunmail
Copy link

Dunmail commented Feb 23, 2023

Is your feature request related to a problem? Please describe.
The Sandbox environment returns an empty Bundle in response to Patient searches where there is no predefined response. This leads to misleading behaviour. For example:
Patient?family=Sm* returns 2 matches
Patient?family=Smi* returns 0 matches
Patient?family=Smith returns 1 match

Describe the solution you'd like
Include an OperationOutcome within the default Bundle to indicate that there is no mock so that consumers understand that the response is a limitation with the environment rather than a problem with the processing of the request.

Describe alternatives you've considered
The case where there is no predefined response is handled in patient-searcher.js ln68, as follows:

delete response.entry 

Instead, add a warning outcome:

response.entry.push({
  search: {
    mode: 'outcome'
  },
  resource: {
    resourceType: 'OperationOutcome',
    issue: [
      {
        severity: 'warning',
        code: 'not-supported',
        diagnostics: 'This mock endpoint has no example response for this combination of search parameters'
      }
    ]
  }
})

Additional context
I would have provided a pull request but couldn't work out how to generate the branch name in accordance with the guidelines!

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

No branches or pull requests

1 participant