hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.02k stars 1.32k forks source link

Pagination bug: Search with _history and _count does not include pagination #2114

Open kaoutarabbaha opened 4 years ago

kaoutarabbaha commented 4 years ago

It seems like a bug, when we do a normal search using _history and _count, we are expecting to have the pagination (link attribute should normally include a relation "next" refering to the next page).

P.S: this is tested on FHIR 4.0.1 and 5.1

For example : Executed query: http://hapi.fhir.org/baseR4/MedicationRequest/_history?_count=1 (knowing that if we increased the count, we will have extra resources)

The result is: { "resourceType": "Bundle", "id": "db37220d-b67d-4aeb-acc9-f080ea15200a", "meta": { "lastUpdated": "2020-10-02T16:45:54.501+00:00" }, "type": "history", "total": 8181, "link": [ { "relation": "self", "url": "http://hapi.fhir.org/baseR4/MedicationRequest/_history?_count=1&_pretty=true" } ], "entry": [ { "fullUrl": "http://hapi.fhir.org/baseR4/MedicationRequest/1495458", "resource": { "resourceType": "MedicationRequest", "id": "1495458", "meta": { "versionId": "1", "lastUpdated": "2020-10-01T13:19:24.698+00:00", "source": "#yslsxRY7OBkp3r9T" }, "status": "stopped", "intent": "order", "medicationCodeableConcept": { "coding": [ { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "1043400", "display": "Acetaminophen 21.7 MG/ML / Dextromethorphan Hydrobromide 1 MG/ML / doxylamine succinate 0.417 MG/ML Oral Solution" } ], "text": "Acetaminophen 21.7 MG/ML / Dextromethorphan Hydrobromide 1 MG/ML / doxylamine succinate 0.417 MG/ML Oral Solution" }, "subject": { "reference": "Patient/1495412" }, "encounter": { "reference": "Encounter/1495443" }, "authoredOn": "2011-02-17T01:27:51-05:00", "requester": { "reference": "Practitioner/1495414", "display": "Dr. Dagny669 Wyman904" }, "reasonReference": [ { "reference": "Condition/1495444" } ] }, "request": { "method": "POST", "url": "http://hapi.fhir.org/baseR4/MedicationRequest/1495458/_history/1" }, "response": { "status": "201 Created", "etag": "W/\"1\"" } } ] }

nschwertner commented 3 years ago

This issue was reported by Logica users after we upgraded to HAPI 5.2.0 from HAPI 4.