FHIR / FHIR/fhir-candle

Pagination missing

Open
#63 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
22
Forks
7
PR merge metrics
No merged PRs in 30d

Description

## Summary

fhir-candle does not appear to return a `Bundle.link` with `relation="next"` for a filtered search using `_count=1`, even when more than one resource matches the query.

This makes client-side pagination impossible for that search result set.

## Environment

- Image: `ghcr.io/fhir/fhir-candle:latest`
- FHIR base path: `/fhir/r4`
- Resource type tested: `Task`
- Comparison server: HAPI FHIR
- Behavior in HAPI: returns expected pagination links

## Example Request

```http
GET /fhir/r4/Task?_total=accurate&_count=1&status=ready&code=RPM_ALERT&patient={patient-id}&start-date=ge2026-06-30T19:01:53&start-date=le2026-07-02T19:01:53&due-date=ge2026-06-30T19:01:53&due-date=le2026-07-05T19:01:53&_sort=due-date,_id
```

## Expected Behavior
The response should include one matching Task resource because _count=1.
Since more matching resources exist, the response should also include a pagination link similar to:

```{
"resourceType": "Bundle",
"type": "searchset",
"link": [
{
"relation": "self",
"url": "..."
},
{
"relation": "next",
"url": "..."
}
]
}
```

Following the next link should return the next matching Task from the same filtered result set.

## Actual Behavior
The response returns one matching Task, but no next link is present in Bundle.link.
Because there is no next link, clients cannot page through the remaining matching resources.

## Why This Matters
FHIR clients commonly rely on Bundle.link[relation="next"] for paging. Without it, a client cannot distinguish between:
exactly one matching result, and
multiple matching results where only the first page was returned.
This breaks tests and application code that paginate through filtered search results.

## Notes
This was found while testing fhir-candle as a faster integration-test backend. The same test behavior passes against HAPI FHIR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.