API RESTful query string to pull all claims in a record

165 views
Skip to first unread message

Chris Burrow

unread,
Mar 26, 2018, 5:58:25 PM3/26/18
to Developer Group for CMS Blue Button API

Is max number of claims retrievable with one API call 50 claims for a single BBUser account or is there a RESTful query string to pull all claims in a single user account?

Thanks for your help on this,

Chris

redixfhir

unread,
Mar 29, 2018, 9:43:17 AM3/29/18
to Developer Group for CMS Blue Button API
I raised a similar question in a separate thread and it was not answered yet. My test shows that each API query will return 10 EOBs at a time, whether you use "_count" or not. However, the API does return the total number of EOBs. For example, for the user BBuser21826, there are 635 EOBs. My test shows that in order to get all of the 635 claims, one has to call the API repeatedly using "_startIndex". I am not sure if this is the right way of doing this.

Thanks.

neoc...@aol.com

unread,
Mar 29, 2018, 1:53:34 PM3/29/18
to Developer Group for CMS Blue Button API
There is a total that comes back on each request (regardless of where you are in pagination).  Also, you can request up to 50 EOBs per request.  Just add a parameter count and set it to 50.  What I did was create a while loop and set claimCount =1 (I check for claimCount > 0 in my while condition).  On the first request, I set claimCount = Total - 50 (cause I'm always requesting 50).  Then if it's greater than 0, it keeps calling with a new startIndex value until I have fetched all the claims.

redixfhir

unread,
Mar 29, 2018, 2:38:20 PM3/29/18
to Developer Group for CMS Blue Button API
OK. I understand. However, this results in an interesting question. The search parameters defined in the FHIR (https://www.hl7.org/fhir/search.html) have a  prefix "_", e.g., "_count". Here in the blue button API, if we use "_count=50", the count will be ignored and we will always get 10 records. To get records between 1 and 50, one has to use "count=nn" (no underscore).

Thanks.

sc...@jackson-fitzpatrick.com

unread,
Apr 12, 2018, 7:21:37 PM4/12/18
to Developer Group for CMS Blue Button API
There is also a "link" array in the json response that contains the pagination urls - ex. "self" "next" "previous" and "last".  Use the "next" url to get the next request/page.  Note, that the last request/page will NOT contain a "next" url.   

So, you could code it as:    do (get json response, parse json, do stuff with json)  loop while "next" url exists in parsed json.
Reply all
Reply to author
Forward
0 new messages