NHS UK FHIR Terminology Server - HAPI FHIR Remote Terminology Service Validation

249 views
Skip to first unread message

Richard Robinson

unread,
Oct 25, 2021, 8:23:30 AM10/25/21
to HAPI FHIR
HAPI FHIR Version: 5.4.0
FHIR version: R4
OS: Ubuntu 18

I work for NHS Digital and develop a tool which suppliers use for testing their systems. It uses the HAPI FHIR Validation library to validate incoming requests and I am expanding its functionality to use the remote NHS UK FHIR terminology Server.
I am experiencing an issue with the HAPI FHIR Validation library whereby the periodUnit value="h" (as part of the dosageInstruction in a MedicationDispense resource - attached) fails validation in certain circumstances. The example message used is from the NHS Digital examples for Interoperability Medicines.

Problem:
When I use the following Validation Support Modules:
  • DefaultProfileValidationSupport
  • PrePopulatedValidationSupport
  • InMemoryTerminologyServerValidationSupport
  • CommonCodeSystemsTerminologyService
  • SnapshotGeneratingValidationSupport

The validation succeeds with no issues.

However when I add the RemoteTerminologyServiceValidationSupport module (using the NHS UK FHIR Terminology Server) the validation of the periodUnit fails with:
    <issue>
        <severity value="error"/>
        <code value="processing"/>
        <diagnostics value="The value provided ('h') is not in the value set http://hl7.org/fhir/ValueSet/units-of-time|4.0.1 (http://hl7.org/fhir/ValueSet/units-of-time), and a code is required from this value set) (error message = Unknown code 'h')"/>
        <location value="MedicationDispense.dosageInstruction[0].timing.repeat.periodUnit"/>
        <location value="Line 1, Col 798"/>
    </issue>

On the Remote Terminology Server, all the Snomed and medication dispense status codes otherwise pass.

Evidence:

I have been in discussion with those who run the UK FHIR Terminology Server who have provided server-side evidence for this issue (also in viewing my HTTP traffic locally):

For each snomed code the RemoteTerminologyServiceValidationSupport module makes 3 outbound requests made to the remote terminology server:
  • GET /staging/fhir/CodeSystem?url=http%3A%2F%2Fsnomed.info%2Fsct ...
  • GET /staging/fhir/ValueSet?url=http%3A%2F%2Fsnomed.info%2Fsct ...
  • POST /staging/fhir/CodeSystem/$validate-code ...

However for the units-of-measure it makes just one:
  • GET /staging/fhir/CodeSystem?url=http%3A%2F%2Funitsofmeasure.org ...

Is it relevant that the unitsofmeasure CodeSystem doesn’t have an implicit ValueSet specified as part of the resource (it is valid to not specify one but most do have one)?


Is the order of adding the validation support modules to the ValidationSupportChain significant? (I have followed the recipes on the documentation but it seems that the remote terminology support module is called before the CommonCode systems module irrespective of order)

Am I missing a configuration? (I guess I'm asking is this a bug or my bad?)

Thanks for your help
Best regards
Richard Robinson
MedicationDispenseExample.xml

Kevin Mayfield

unread,
Oct 25, 2021, 8:31:35 AM10/25/21
to Richard Robinson, HAPI FHIR
What is in the order of your ValidationSupportChain?

We have 

DefaultProfileValidationSupport(fhirContext),
CommonCodeSystemsTerminologyService(fhirContext),
terminologyValidationSupport, // InMemoryTerminologyServerValidationSupport(fhirContext)
SnapshotGeneratingValidationSupport(fhirContext)

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/bf8fe4fa-4f0e-4a25-8054-ff30298105a7n%40googlegroups.com.

Richard Robinson

unread,
Oct 25, 2021, 8:44:21 AM10/25/21
to HAPI FHIR
Hi Kev,
This is the support chain order:

Validation Support Chain created
Default Profile Validation Support created and added to the support chain
PrePopulated Validation Support created and added to the support chain
Common Code Systems Terminology Service Validation Support created and added to the support chain
In Memory Terminology Validation Support created and added to the support chain
Snapshot Generating Validation Support created and added to the support chain
Remote Terminology Validation Support created and added to the support chain

The Common Code and In Memory modules were switched so I changed them to match yours, but unfortunately it didn't change the outcome.

Cheers
Richard


Kevin Mayfield

unread,
Oct 31, 2021, 7:07:44 AM10/31/21
to HAPI FHIR
Could I have a copy of your client interceptor? 

I presume you have one?

I'd like to recreate on the service I'm using.

Thanks

Richard Robinson

unread,
Nov 1, 2021, 2:04:22 PM11/1/21
to HAPI FHIR
Hi Kev,
Yes I've just updated the GIt and Docker hub repos for TKW Validation Server:

Git:

DockerHub:



Thanks
Richard

Reply all
Reply to author
Forward
0 new messages