nhsdigitalmait / TKW-x

NHS Digital Toolkit Workbench. Supersedes the ITK workbench and sunsets legacy protocols. Positioning for Micro Services/Distributed Execution environments.
Apache License 2.0
0 stars 1 forks source link

HttpInterceptWorker needs to be updated to dynamically parse requests as per their declared FHIR Versions #24

Open rprobinson opened 3 years ago

rprobinson commented 3 years ago

The HttpInterceptorWorker class parses incoming FHIR XML requests based upon the tks.fhir.version configuration value. This is static for the instance. The FHIR validation Server config can accept STU3 or R4 messages and so it may give a lenient parse failure when a request is not aligned with the version. The fhirConvertXml2Json method in FHIRJsonXmlAdapter is called from validateXmlAsFhir in HttpInterceptorWorker. Can the FHIR version be dynamically detected from the incoming request and the appropriate parser used?

SimonFarrowNHS commented 3 years ago

This is arguably not possible to be done rigorously and it might be better if this kind of thing was done using a reverse proxy routing to multiple services statically allocated to specific FHIR versions according to values in the context path.

SimonFarrowNHS commented 3 years ago

Not sure this can be described as a bug.