Skip to main content

PDF document return

  • November 13, 2025
  • 0 replies
  • 0 views

When a consent form is completed, a PDF is generated and stored in the patient’s record. There are several ways to return this PDF to your hospital systems:

  • SFTP
  • JSON Webhook
  • HL7 MDM
  • JSON API

 

The document return process is event-driven. Specific events in the consent session—such as “patient complete” or “consent form complete”—can trigger actions. The method you choose will depend on your organisation’s internal capabilities.

 

SFTP

SFTP configuration is managed within the Consent Suite dashboard:

  1. Go to Settings in the main menu.
  2. Select SFTP Settings from the left-hand menu.
  3. Add a new SFTP connection by entering your server details.
  4. Under the Trigger Events tab, choose which events should initiate the transfer.

 

The PDF will be delivered to your specified folder on the SFTP server.

 

JSON Webhook

Webhooks allow third-party systems to extend the Consent Suite’s functionality. A webhook is a type of notification—also known as an HTTP request or callback—that sends a small payload of data to another system when a specific event occurs. That system can then take further action.

 

Webhooks are commonly used with tools like Zapier, IFTTT, Microsoft Power Automate, CRMs, and business software.

 

There are three webhook types available from the organisation dashboard under Settings > Webhooks:

  • Events Status
  • PDF Timing Report
  • PDF Consent Form

 

To create a webhook, provide a URL. When the selected event occurs, the Consent Suite will send a payload to that URL. For example, the PDF Consent Form webhook sends a payload like this:

Sample webhook payload

{
"id": 1234,
"ext": ".pdf",
"mime": "application/pdf",
"name": "112233-PatientNumber-Baker-LastName-1981-01-01-DateOfBirth-ConsentForm1",
"type": "full_consent",
"event": "CONSENT_FORM_COMPLETE",
"content": "JVBERi0xLj...",
"created_at": "2025-04-29T10:07:39.000000Z",
"patient_id": 4321,
"updated_at": "2025-04-29T10:07:39.000000Z",
"session_key": "84erzrwy0",
"webhook_ulid": "01jith8ehjmmevdez3079fa77s"
}

 

The PDF is base64 encoded and can be extracted from the content field. Alternatively, the webhook data can be used to query the JSON API for the document.

 

For more details, see the Webhooks knowledgebase article.

 

HL7 MDM

The HL7 MDM method uses AWS Lambda functions. A URL is created to receive webhook posts, which then trigger the Lambda to:

  1. Transform the payload into an MDM message.
  2. Embed the base64-encoded PDF.
  3. Send the message through the VPN tunnel to the Trust Integration Engine (TIE).

Each Lambda function is tailored to your organisation’s specific message requirements. To use this method, you’ll need to provide a sample MDM message and the destination IP address.

 

JSON API

The JSON API can be queried to retrieve documents related to a patient’s consent session. Due to security and commercial sensitivity, API documentation is not publicly available but can be shared on request.

 

PDF Filenames

PDF filenames can be customised using system variables. This can be configured globally or per consent form. Available variables include:

  • :PatientNumber – Patient Number
  • :MedicalNumber – Medical Number
  • :NhsNumber – NHS Number
  • :LastName – Last Name
  • :DateOfBirth – Date of Birth
  • :Postcode – Postcode
  • :CurrentDate – Current Date (format: YYYY-MM-DD_HHMM)
  • :SessionKey – Session Key
  • :ProcedureNames – Procedure Names
  • :ProcedureCodes – EIDO Procedure Codes

 

Example filename structure:

:LastName_:CurrentDate_:PatientNumber_:DateOfBirth-FinalConsentForm_CF01

 

Resulting filename:

BAKER_2023-01-31_1630_969709_09-04-1989-FinalConsentForm_CF01.pdf

0 replies

Be the first to reply!