I’ve been thinking about this for a while. The diagram above represents a ‘simplified’ design. I’ve simplified the inputs to just being a document (FHIR Binary) and metadata (FHIR DocumentReference). In reality in a NHS trust it’s likely to be a custom XML format or HL7v2 message - however both normally contain the document and some metadata.
In a NHS trust we normally do something like this in the Trust Integration Engine (TIE) but also something like this will exist on the system/organisation sending or receiving the document.
So it’s looking like a standard pattern with maybe a standard app
For it to work in you scenario, you’d need to get the senders to use it. Here you would register what capabilities you support in the directory. So for PDF’s they would need to go to the ‘GP Connect Send Task’ route (when your supplier supports it) and HTML goes the Kettering XML route.
I believe an app like this can be done using open source components such as Apache Camel, HAPI, NHS CCRI, Rabbit/Artemis MQ, Angular 6, Activiti, spring boot (sounds like a lot but it’s mostly plugging it together).