Issues backporting HAPI FHIR Server HashmapResourceProvider bug fix to a previous version

24 views Asked by At

Due to project constraints, I'm using version 6.1.0 of the HAPI FHIR server. However, there is a bug in that version where a resource's deletion doesn't show up as an entry in the server history. Because of this, I need to backport a fix from a future version and manually update the source code for the v6.1.0 server.

E.g.

Expected Behaviour:

Actions taken:
Insert Patient A
Update Patient A
Delete Patient A

History log:
Insert Patient A
Update Patient A
Delete Patient A

Actual Behaviour:

Actions taken:
Insert Patient A
Update Patient A
Delete Patient A

History log:
Insert Patient A
Update Patient A

I've narrowed the fix down to the ca.uhn.fhir.rest.server.provider.HashmapResourceProvider in the hapi-fhir-server package in this commit and replaced the HashmapResourceProvider code used with the newer one.

To make the new code compatible with the older server, I modified the way resources are provided for ResourceMetadataKeyEnum. E.g.

// Bug fix code
ResourceMetadataKeyEnum.DELETED_AT.get(nextResource)

// Modified code to make compatible with v6.1.0 server.
ResourceMetadataKeyEnum.DELETED_AT.get((IAnyResource) nextResource)

The problem is that now, when a resource is deleted, the entire history of that resource doesn't appear in the server history any more.

Is there anything I am missing that is causing this issue?

0

There are 0 answers