Skip to content

Duplicate uploads of binary content for externalized attachments #7183

@volodymyr-korzh

Description

@volodymyr-korzh

If externalizing binary content is configured, uploading same binary content several times results in new version of DocumentReference, new binary to be re-uploaded. Submitting same binary should be a no-op.

To Reproduce

  1. Register BinaryStorageInterceptor via InterceptorService, register BinaryAccessProvider, DatabaseBinaryContentStorageSvcImpl beans in jpa server context.
    (set MinimumBinarySize for DatabaseBinaryContentStorageSvcImpl to 1000)
  2. Create DocumentReference for Patient
Request Example:

POST {FHIR_ENDPOINT_URL}/DocumentReference

{
  "resourceType": "DocumentReference",
    "subject": {
        "reference": "Patient/1702"
    },
  "content": [
    {
      "attachment": {
        "contentType": "image/jpeg"
      }
    }
  ]
}
  1. execute $binary-access-write operation with attached file(any file with size over 1000 bytes):

POST /DocumentReference/1703/$binary-access-write?path=DocumentReference.content.attachment

  1. execute save $binary-access-write operation again or update DocumentReference resource with PUT operation and same attached binary.

Expected behaviour
Uploading same binary file again should not create new version of DocumentReference, new binary should not be re-uploaded by IBinaryStorageSvc

Actual behaviour
Uploading same binary file again creates new version of DocumentReference, new binary is re-uploaded by IBinaryStorageSvc

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions