Open seanmcilvenna opened 4 years ago
I found (using Smile CDR v2022.11.PRE-13) that Bundle.total includes the deleted entries in a search for all Resources of a type. If I subsequently do a search with ?_total=accurate
, then do a search without _total
, Bundle.total remains accurate.
I suspect that HAPI maintains a counter somewhere, updating it for creates but not deletes and that the counter is updated when a request for an accurate total is made.
Describe the bug In the UI, when looking at the list of resources (on the left), it shows a little colored bubble next to each resource that indicates how many instances of that resource exist on the server. It appears that the number which shows there includes deleted resources, and I don't think it should.
To Reproduce Open the UI and take note of the number of resources for the FHIR server. Delete one of the resources. Compare the number before and after, and it doesn't seem to have changed.
If using a MySQL database, you can run this query:
select * from hfj_resource join hfj_forced_id on hfj_forced_id.resource_pid = hfj_resource.res_id where hfj_resource.RES_DELETED_AT IS NULL and res_type = 'StructureDefinition';
This will tell you have many undeleted resources exist on the server. The bubble/count in the UI should match that number.This query includes deleted resources, which seems to be what the bubble/count currently represents:
select * from hfj_resource join hfj_forced_id on hfj_forced_id.resource_pid = hfj_resource.res_id where res_type = 'StructureDefinition';
Expected behavior The count/bubble should not include deleted resources.
Environment (please complete the following information):