Idea for pacs system

Im goining to use nextcloud as
Picture archiving and communication system (pacs),
We have MRI and CT in our clinic.
I used
But rightnow i trap in some part.
1, what is the best way for diractory?
My idea Somethibg like this:
2. How we can create automate diractory path when upload?