API PUT request -SQLcommand issue

For requests or help with our API
Post Reply
darcockerell
Posts: 10
Joined: Mon Jan 31, 2022 8:51 am

API PUT request -SQLcommand issue

Post by darcockerell » Wed Jan 25, 2023 10:26 am

We have experienced an issue with the PUT Request for patients when there are more than 100 results.

example query: {"SqlCommand": "select p.FName from patient as p where p.LName = 'Brown'"}

The Use case is searching for a patient whose last name is "Brown" - the patient does not show in the results list because the list only provides 100 results.

Is there a way around this restriction without introducing paging?

SLeon
Posts: 299
Joined: Mon Mar 01, 2021 10:00 am

Re: API PUT request -SQLcommand issue

Post by SLeon » Wed Jan 25, 2023 11:10 am

Good morning,

Could you please clarify if
  • You are looking for a specific patient whose last name is Brown and they are not in the returned list, but 100 other patients with LName Brown are?
  • Or generally speaking, are you not getting any results with this query despite there being a patient matching this criteria?
If it is the former is the case and you do not want to implement paging in your application, there are four things you can do instead:
  1. If you know you are searching for a specific patient, use their PatNum in your query or Patients GET (single).
  2. Otherwise refine your query. If you are able to see that the result set from your query does not have the patient you are looking for, include the field(s) you are using to make this determination.
  3. Use the Local API or API Service. The Limit for these two API Modes is 1000.
  4. Use Queries POST instead of Queries PUT ShortQuery. This requires use of your own SFTP site but the returned data is not truncated; the entire result is written to a file.
Depending on your implementation, the easier solutions are likely to refine your query or utilize paging.

Post Reply