'Is there a way I can reduce time taken by the FHIR validator_cli jar to validate a resource file?
I'm using the official validator_cli jar provided by HL7 FHIR here:https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator to validate my FHIR resources and everything seems to be working as expected. However a major concern I'm facing is the time taken to validate 1 single resource file (.json) is ~1 minute. I've a huge bulk of data that needs to be validated and going at this pace is impractical.
Can anyone please help me in increasing the execution speed here? The validator seems to be sending out http requests in the background to fetch necessary resources for validating against them and this step is redundant (refer highlighted lines in below snap)
. Is there a way that I can download and store such resources and reuse them to validate subsequent resource files? Any input/pointers will be helpful and much appreciated. Let me know if additional details are needed here.
Thank you!
Solution 1:[1]
The bulk of the time for the validator is spent loading all of the resources from the core spec and any relevant IGs into memory. The actual validation process is typically a second or less. So when you launch the validator, you want to pass all instances to validate with it, not launch it repeatedly. If you're using it in production, then you should wrap it in a process that does the initial load once and then uses the loaded context for each validation call. The other thing you can do is pass a tx server of "na". That will keep it from calling external terminology services - though it'll have the consequence of not checking codes against the 'current' version of code systems and value sets, and if you're dealing with unexpanded value sets, might not allow code validation at all.
If you need to speed things up further, you'd need to customize the validator to limit what it checks - particularly reducing recursive checks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lloyd McKenzie |
