Extending $Diff Operation

We are trying to implement reconciliation of x12 834 resources in FHIR . I am thinking of using FHIR Patch API to update resources with new changes received from x12 file .
I came across $diff operation which is generating a differential between two versions of a resource
https://hapifhir.io/hapi-fhir/docs/server_jpa/diff.html
But this operation only compares two versions of a resource that are already saved in FHIR.
Can this operation be somehow extended and used to compare two versions of EnrollmentRequest - latest version that is currently saved in FHIR and the version created with new changes but not saved in FHIR yet? If $diff operation can be extended to fulfill this criteria - then Parameters resource returned by differential generated can be directly used as input to Patch API.
If $diff operation can not be used like this , what are the suggestions to calculate diff to be applied to each resource so that patch update can be done ?

Thanks,
Ravneet

it could be done, sure. The underlying engine is solid. But HAPI is open source - so either make a PR to hapi to add that functionality, or talk to the smileCDR team about one of them doing on a commercial basis.

1 Like