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"/>
<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