Library : NHS ITK
This library is intended for use with the NHS ITK v3 standard provided by NHS Digital. The ITK message wrappers use a number of profiled FHIR resources to represent the message wrappers, all of which are held within a FHIR Bundle resource. A number of different extensions are used within the ITK standard.
The library makes it possible to create the message wrappers without any knowledge of the profiles, extensions of other FHIR identifiers within the standard.
The FHIR ITK standard is published at https://nhsconnect.github.io/ITK3-FHIR-Messaging-Distribution/
Installing The NuGet Library
The library is published as a NuGet package. This can be installed directly via Visual Studio or via the instructions on the NuGet website at https://www.nuget.org/packages/ClaroTech.NHSITK/
Creating the ITK Wrapper
The “ITKMessage” class can be created with a specified identifier. If the identifier is missing then one will be allocated.
Setting the messaging event
The ITK standard has a set of permissible events. In the library, these are exposed an enumeration. Select the appropriate one.
Setting the Source Endpoint
Setting the source endpoint is a single method
Setting Handling Specifications
The standard allows for a number of “handling specifications”. These are implemented via the means of a complex extension within the MessageHeader resource. The ITK Library will create the extension on your behalf.
Setting Message Focus (payload)
Within the ITK design, the payload of the message wrapper is always carried as a bundle of resources. The example here shows where the bundle would be inserted into the wrapper.
Generating the ITK Bundle
The bundle is generated using the ‘GenerateBundle’ method. The code shows how using the standard FHIR serialiser this can be converted to XML
Rounding it all up
Putting the code examples above together the resulting XML message generated is shown.