PDF document sending via MESH

Hi all
Got my test interface working for sending messages via MESH, checking inbox, ack responses, etc. The only thing I havent been able to do as of yet is to send a message with PDF attachment or to send a PDF to a mailbox. I have checked the API reference material and can’t seem to find an example or guide. Can anyone point me in the right direction please?

Is there an example showing headers, data type/encoding, etc?

Thanks

Hi Matthew

the standard headers are shown here .. ..
https://digital.nhs.uk/developer/api-catalogue/message-exchange-for-social-care-and-health-api#post-/messageexchange/-mailbox_id-/outbox

but, providing you’re using the v2 api using:

--header 'accept: application/vnd.mesh.v2+json'

then you can safely set the content-type: application/pdf ..
the content-encoding header can also be set if you’re compressing data before sending to the api

Hi, I’ll not be using chunking or compressing the data. I’ll be looking to use the interface I am writing to potentially send docs to GPs. Would I need to use the Transfer of Care Specification for this? If so, I have seen an XML format is required.

Use of Attachments | ITK-FHIR-eDischarge

To accomplish this would I need to including content of the message as XML with a base64 PDF, are there any examples of this to look at?

Thanks

This is not that simple :slight_smile:

First question is what kind of provider are you working for?

If your a pharmacy or online consultation provider, then NHS England is likely to say use this API GP Connect Send Document ← This is the best developer documentation I could find.

If not then you should look at using Kettering XML, this isn’t supported by NHS England but it does have a low onboarding cost. This link has all the documents I could find on it Kettering XML - Virtually Healthcare - IHE Patient Care Coordination (PCC) v0.1.1-current

If you have IM1 Transaction API’s or Partner Facing APIs, then this is an option for getting documents into a GP system. (You also have the option of sending structured data via this route)

We use all three :frowning:

p.s. the ITK-FHIR-Discharge is for secondary care trusts, if your not this type of provider you can’t use it. Most secondary care trusts went down the Kettering XML route instead.

GP Connect looks like the ticket. I have seen some documentation on Kettering XML but its quite sparse. GP Connect ‘Send Document’ does look like it supports a variety of file types so I shall explore that - thank you!

Just a word of warning. I’ve developed our code a month or two back and we are still waiting on permission to test.

We’re stuck at early stages of onboarding.

Any ideas why we cant just use the regular MESH api for sending to GPs. It looks like you can attach documents and it makes reference to large files being added in the documentation but no clear way to seemingly attach any file despite it looking like you can…

From a MESH API perspective, you can send whatever arbitrary blob of data you choose (large files being chunked into sub-100MB chunks). But whether or not a receiving mailbox will know how to process the data when it lands in their mailbox is down to them.

IS there an actual example on the docs area though? I have checked and cant see that being done. It references it is possible but nothing else…

Hi Matthew. The link that Matt posted near the top of this thread should contain the information you need to send the message. https://digital.nhs.uk/developer/api-catalogue/message-exchange-for-social-care-and-health-api#post-/messageexchange/-mailbox_id-/outbox. If that doesn’t answer your question, please let us know what you are trying to do so we can give your further guidance.

MESH is a transport service (like http, tcp, etc). You can use just this but you will need to arrange this with your intended recipient, agree on what is being sent (e.g. PDFs, XML, JSON, etc) and I believe get a workflow Id agreed with NHS England.

The services I mentioned work are a layer on top of that, so they have specific workflow Id’s and the format of the ‘document’ payload has been agreed between sender and recipient.