DicomPackage::Middleware it's a rack middleware to parse multipart/related requests with DICOM data and rebuild it to Rails compatible params.
Using this middleware, params is parsed and rebuilt like the code below:
{"files"=>{"<[email protected]>"=>#<ActionDispatch::Http::UploadedFile:0x0000000109bd2ab8 @tempfile=#<Tempfile:/var/folders/4d/k113_9r544nfj8k0bfxtjx0m0000gn/T/1.dcm20220411-56599-34wg47>, @original_filename="1.dcm", @content_type="application/dicom", @headers=nil>, "<[email protected]>"=>#<ActionDispatch::Http::UploadedFile:0x0000000109bd20e0 @tempfile=#<Tempfile:/var/folders/4d/k113_9r544nfj8k0bfxtjx0m0000gn/T/2.dcm20220411-56599-aa96ex>, @original_filename="2.dcm", @content_type="application/dicom", @headers=nil>, "<[email protected]>"=>#<ActionDispatch::Http::UploadedFile:0x0000000109bd2018 @tempfile=#<Tempfile:/var/folders/4d/k113_9r544nfj8k0bfxtjx0m0000gn/T/3.dcm20220411-56599-89pzin>, @original_filename="3.dcm", @content_type="application/dicom", @headers=nil>}}
In your Gemfile:
gem 'dicom-package'
In your environment.rb:
config.middleware.use DicomPackage::Middleware