WIP: Proof of Concept of HL7 Validator Wrapper integration #396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
(Note: this is based off of the validator error handling change which was just reverted so the diff may look a little odd)
This PR demonstrates a proof of concept of using the HL7 validator wrapper instead of our wrapper for resource validation. There are a few other things we will want to do in practice but those should be straightforward to implement once we know whether this is the direction we want to go.
The key changes are as follows:
org.hl7.fhir.validation
library, so we will need to map our input and output appropriately. This is pretty straightforward, see new functionswrap_resource_for_hl7_wrapper
andoperation_outcome_from_hl7_wrapped_response
belowigs
, which takes a list of IG identifiers . For example for the US core 3 test suite it will look like this:If the IG isn't published yet, then you can pass in a filename here and it will work just fine. (See https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator#UsingtheFHIRValidator-LoadinganimplementationGuide for what's accepted) Filenames appear to be relative to the base directory of the HL7 validator wrapper but we will probably need to test different deployment scenarios to confirm.
There are other things we will want to make configurable, such as the terminology server and whether code display issues should be warnings - those can either be made separate DSL functions or we could just make the whole
cliContext
of the request configurableOther things we may want to do:
a. allow the validator to re-use a session for requests with the same cliContext . This would be much easier than implementing a session cache on our side. I'm not sure if that team will want to make this change though. A basic implementation of that is here: https://github.com/dehall/org.hl7.fhir.core/tree/session_by_clicontext . Diff: hapifhir/org.hl7.fhir.core@master...dehall:org.hl7.fhir.core:session_by_clicontext
To run this locally you'll need to install the fork to maven local with the new version, and update the wrapper to point to that new version. An easier method is to use the Dockerfile located in this fork of the HL7 wrapper:
https://github.com/dehall/org.hl7.fhir.validator-wrapper
b. allow modifying the validator session cache expire time. There is a constructor for the session cache that takes in an amount of time but it's not invoked by the validation service. Not a huge change but I'm not sure what the best way to make it is
Testing Guidance