Note Development of this repository has been discontinued as of 2022-11-01. Yeovil District Hospital NHS Foundation Trust (YDH) and Somerset NHS Foundation Trust (SFT) are due to merge in 2023, and a deputy CCIO of the new trust has decided that a proprietary solution from a third-party supplier should be procured instead of building an open-source solution in-house.
Yeovil District Hospital NHSFT's ITK3 Transfer Of Care migration work logs
This repo outlines the steps that have been taken to migrate from Kettering XML to NHS Digital's ITK3 Transfer of Care FHIR resource bundles for sending clinical documents via MESH.
Yeovil District Hospital NHS Foundation Trust manages Yeovil District Hospital (YDH) in Yeovil, Somerset.
Yeovil is situated next to the Dorset county border and the hospital sees a sizeable amount of patients from Dorset every year (15.14% of A&E attendances and 13.7% of inpatients in 2021 were from Dorset).
Every encounter with a patient generates a document, usually an inpatient discharge summary, emergency discharge summary, or outpatient clinic letter. These documents are generated as PDFs and then converted to HTML (using Docsmith) for them to be placed in an XML payload using the Kettering XML format. The Kettering XML payloads are sent to a patient's primary care provider system electronically via NHS Digital's MESH.
Dorset GP Practices use TPP's SystmOne, whilst Somerset GP Practices use EMIS for their primary care system.
EMIS has no issue receiving these documents as HTML and presenting them in their system.
SystmOne however, strips a large amount of the HTML elements out (including all <img>
elements) and then saves the documents as .tif
files, which has led to several issues, including:
- Paragraphs overlapping each other, leading to unreadable documents
- All images removed from documents (cannot send scan results)
- The bottom third of each page is missing, and all the content with it
This all impacts patient care, with the issue of missing content being the most severe.
Multiple Dorset-based GP practices have reported one or more of these issues since 2018-10-09. Attempts to rectify this on YDH's end proved unsuccessful and so this was raised with Phil Mabey, Steve Howes, and Andy Hadley at Dorset CCG on 2020-06-19 for them to raise with TPP. At the time of writing (2022-05-25), this has still not been resolved.
It was noticed in an article in Digital Health that TPP was trialling the support of FHIR resources in Dorset. We are hoping that migrating to NHS Digital's ITK3 Transfer of Care FHIR resource bundles will resolve the aforementioned issues and, if not, at least future-proof us for the eventual full migration to the HL7 FHIR standards.
What was sent to a Dorset-based GP practice:
How the document was saved and presented by TPP's SystmOne, note the missing hospital logo:
What was sent to a Dorset-based GP practice:
How the document was saved and presented by TPP's SystmOne, note the missing text 'clopidogrel 75mg film coated tablets - Oral':
Luckily the practice pharmacist noticed it and raised this with us.
The ITK3 specification defines the structure and components of a FHIR resource bundle, but not the payload.
The Transfer of Care (ToC) specification defines FHIR resources that can be sent inside ITK3 structured bundles, such as eDocuments.
YDH will be looking at utilising the following Transfer of Care FHIR resources:
- Acute Inpatient Discharge
- Emergency Care Discharge
- Outpatient Clinic Letter
The ITK3 Transfer of Care FHIR resource bundles will need to be sent to GP surgeries in Somerset and Dorset, as well as other NHS trusts, via MESH.
YDH currently uses the Java-based MESH client, which utilises .dat
and .ctl
Kettering XML files, however, NHS Digital also provides a web-based RESTful API.
Documentation on how to send ITK3 FHIR resource bundles via MESH is sparse, and NHS Digital was contacted on 2021-11-15 to clarify the following queries:
- Whether the web-based RESTful API is required for sending FHIR payloads, or if the Java-based client can be used
- What content-types the API POST endpoints can accept, as ideally this would be sent as
application/json
The NHS Digital ITOC team (itoc.supportdesk@nhs.net) responded on 2021-11-16 stating that FHIR payloads can be sent by either method and that any type can be POSTed at the API endpoints. Whilst it would be easy to stay with the Java-based MESH client, for the sake of posterity the web-based RESTful API will be adopted.
Dr. Mike Moore, the ToC Project Manager at NHS Digital, was contacted on 2021-11-15 regarding supplier support, and provided the following details:
EMIS Health needs to deliver Emis Web v9.13.11 to fix a workflow annotation issue before Full Rollout Approval (FRA) can be granted. The target for FRA or EMIS is 2021-12-22, however, this may be delayed due to holidays. Post FRA, all of the GP practices using EMIS will need their MESH mailboxes reconfigured to send and receive ToC FHIR messages. This was completed on 2022-01-07.
TPP's SystmOne gained FRA in 2020-08 for inpatient, emergency, and outpatient ToC FHIR resources. Mike Moore approved FRA for Mental Health Discharge ToC FHIR resources on 2021-11-17.
At present, YDH's documents are generated from supplier systems (Intersystems' TrakCare for inpatient and emergency discharge summaries, BigHand for outpatient letters) as unstructured PDFs.
The hope was that PDFs could be placed into Binary resources inside of the ITK3 structured bundles, however, this is not allowed (see Note 1). Instead, they would have to be converted from PDF to HTML, and the resulting markup would need to be parsed to fit into the sections of an ITK Composition resource.
Our neighbouring trust, Somerset NHS Foundation Trust (SFT), is also looking to adopt ITK ToC FHIR bundles but will run into a similar issue as their documents are also generated from supplier systems (epro) as unstructured DOCX files.
Dorset County Hospital NHS Foundation Trust (DCH), an early adopter of ITK3 Toc FHIR bundles, was approached on 2021-11-22 to see if they could advise both YDH and SFT on how they achieved adoption. Unfortunately, DCH chose a third-party supplier for their ToC work, who were unwilling to share due to it being achieved with proprietary solutions.
Devon Partnership NHS Trust (DPT), Cambridge University Hospitals NHS Foundation Trust (CUH), Leeds Teaching Hospitals NHS Trust (LTH), and Oxford University Hospitals NHS Foundation Trust (OUH) are working with suppliers for their ToC implementation.
Essex Partnership University NHS Foundation Trust (EPUT) have built in-house and was happy to discuss their progress. On 2021-12-02 Marc Riding and George Fox from EPUT talked through their development over MS Teams, showing their Mental Health Discharge Summary ToC FHIR Bundle generation process. Marc shared the code they had developed alongside supporting documentation.
Northumbria Healthcare NHS Foundation Trust (NH) has also built in-house and, on 2022-01-18, Richard Leonard and Christopher Rouse talked through their development over MS Teams. NH has used the Java-based MESH client, which utilises .dat
and .ctl
Kettering XML files, for sending Transfer of Care documents, and shared their process.
As noted in the requirements section above, NHS Digital's documentation regarding MESH adoption is confusing.
NHS Digital's ITOC team (itoc.supportdesk@nhs.net) and API Management team (api.management@nhs.net) were contacted on 2022-07-21 in the hope they could clarify what we need to do to access the test MESH APIs.
The API Management team responded on 2022-08-03, pointing us to the Message Exchange for Social Care and Health (MESH) API page that we had already been looking at.
The ITOC team responded on 2022-08-10, directing us to the Connect to a Path to Live environment page.
From reviewing both pages, it appears that we need to request a test organisation and test mailbox before gaining access to the test APIs.
The Connect to a Path to Live environment page and adjacent Development Environments page state the need for a test organisation, so a test organisation was requested on 2022-08-10. The Test Data team responded on 2022-08-16 with a test organisation (B81008: DR KS TOMMINS' PRACTICE).
A test MESH mailbox was requested via the web form for both RA4 (YDHNSFT) and B81008 (test organisation) on 2022-08-24.
- Request test organisation to send test messages to, from testdata@nhs.net
- Fill in Excel spreadsheet sent by testdata@nhs.net and return
- Await test organisation creation (B81008) by NHS Digital's Test Data team, and the corresponding email
- Request test MESH mailbox for live organisation (RA4), with the following Transfer of Care (FHIR) workflow IDs:
- TOC_FHIR_EC_DISCH (EC Discharge Summary A and E Report)
- TOC_FHIR_IP_DISCH (Acute IP and Daycase Discharge)
- TOC_FHIR_MH_DISCH (MH IP and Daycase Mental Health Inpatient Discharge Summaries)
- TOC_FHIR_OP_ATTEN (Outpatient Clinic Letter - Outpatient Attendance)
- Request test MESH mailbox for the test organisation (B81008), with the following Transfer of Care (FHIR) workflow IDs:
- TOC_FHIR_EC_DISCH_ACK
- TOC_FHIR_IP_DISCH_ACK
- TOC_FHIR_MH_DISCH_ACK
- TOC_FHIR_OP_ATTEN_ACK
- Register FQDN for test (
local_id
.B81008.api.mesh-client.nhs.uk) and live (local_id
.RA4.api.mesh-client.nhs.uk) organisation MESH mailboxes
ydh-toc-itk3
is licensed under the Open Government Licence v3.0 license.