Binary Access Write Operation ($binary-access-write)

The process of writing a binary payload using the Binary Access Write Operation is done in a two-step process.

First, the resource must be created on the server, with a placeholder Attachment that will be populated later.

Example: POST DocumentReference resource with a placeholder Attachment.

POST http://<HOST_NAME>:<PORT>/oracle-fhir-server/fhir/DocumentReference/DocumentReference
Content-Type: application/fhir+json
{
  "resourceType": "DocumentReference",
	"subject": {
		"reference": "Patient/P123"
	},
  "content": [
    {
      "attachment": {
        "contentType": "image/jpeg"
      }
    }
  ]
}

The server will reply with a content-location header containing the ID of the newly created resource.

content-location: http://localhost:7001/oracle-fhir-server/fhir/DocumentReference/499952/_history/1

This ID is then used in the Binary Access Write Operation to set the binary content.

Second, the Binary Access Write Operation is invoked to directly store the content.

The path parameter, that specifies a FHIRPath expression to the attachment element within the DocumentReference resource. It is important to provide the appropriate content type via the Content-Type header in the operation HTTP request.

POST : http://localhost:7001/oracle-fhir-server/fhir/DocumentReference/499952/$binary-access-write?path=DocumentReference.content.attachment

Content-Type: image/png

HTTP Body - (... binary content ...)

Note:

The below property decides whether to store the resource as plain text in the RES_TEXT_VC column of resource extended tables.

inline_resource_storage_below_size: 0

If the resource size is below the size as set in the above property, it goes RES_TEXT_VC column, otherwise it goes to RES_TEXT as compressed blob.