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

fhir_search returns entry: [ ] (an empty array) if search query doesn't return any results which is not valid according to fhir documentation #139

Open
bartek-sarul opened this issue Jun 27, 2016 · 0 comments
Assignees

Comments

@bartek-sarul
Copy link

Steps to reproduce:

select fhir_search('{"resourceType":"Patient", "queryString":"identifier=SOME_NON_EXISTING_IDENTIFIER"}');

This returns

{
  "resourceType":"Bundle",
  "type":"searchset",
  "total":0,
  "link":[{
    "relation":"self",
    "url":"Patient/search?identifier=SOME_NON_EXISTING_IDENTIFIER&_page=0"
  }],
  "entry":[]
}

According to fhir documentation https://www.hl7.org/fhir/json.html

Objects are never empty. If an element is present in the resource, it SHALL have properties as defined for its type, or 1 or more extensions

String property values can never be empty. Either the property is absent, or it is present with at least one character of content

This has also been confirmed on fhir implementers chat
https://chat.fhir.org/#narrow/stream/implementers/topic/returning.20search.20bundle.20with.20no.20result

Empty elements (arrays or strings) are not permitted.

Expected result:

{
  "resourceType":"Bundle",
  "type":"searchset",
  "total":0,
  "link":[{
    "relation":"self",
    "url":"Patient/search?identifier=SOME_NON_EXISTING_IDENTIFIER&_page=0"
  }]
}
@maksym maksym self-assigned this Nov 11, 2016
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

2 participants