Stream: implementers
Topic: Validator: Does not resolve errors
Robert Scalfani (Jul 30 2020 at 20:27):
Hello. I am trying to validate Capability Statements using the HL7 FHIR Validator version 5.0.17. When using the validator with the US Core Server Capability statement, (https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.json) I’m getting many errors involving URL value “http://hl7.org/fhir/us/core/...” does not resolve.
Command used:
java -jar org.hl7.fhir.validator.jar -version 4.0.1 CapabilityStatement-us-core-server.json`
Output:
FHIR Validation tool Version 5.0.17 (Git# a375f58c8288). Built 2020-07-30T04:40:26.642Z (15 hours old)
Detected Java version: 11.0.8 from /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home on x86_64 (64bit). 8192MB available
Arguments: -version 4.0.1 CapabilityStatement-us-core-server.json
Directories: Current = /Users/rscalfani/Documents/OneDrive MITRE/validator, Package Cache = /Users/rscalfani/.fhir/packages
.. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1
.. connect to tx server @ http://tx.fhir.org
(v4.0.1)
.. validate [CapabilityStatement-us-core-server.json]
Terminology server: Check for supported code systems for urn:iso:std:iso:3166
*FAILURE* validating CapabilityStatement-us-core-server.json: error:100 warn:0 info:45
Error @ CapabilityStatement.url (line 8, col75) : URL value "http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server" does not resolve
Error @ CapabilityStatement.implementationGuide[0] (line 49, col4) : URL value "http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.1.0" does not resolve
With many more additional errors of the same type following.
I’ve seen this issue with other resources, but am using US Core as an example.
I was unable to find any requirements in the FHIR spec that urls, including canonical urls, must resolve. I can understand why these would be warnings, but can someone explain why these are errors?
Any help would be much appreciated!
Lloyd McKenzie (Jul 30 2020 at 20:43):
If you're going to validate content that references artifacts from an IG, you need to use the -ig
parameter to indicate the ig (or igs) that are in scope. Otherwise, the validator just looks at the core spec
Reece Adamson (Jul 30 2020 at 20:57):
Should these really be errors though?
For example if I validate against the vonk CapabilityStatement at http://vonk.fire.ly/r4/metadata
. I get
java -jar validator_cli.jar -version 4.0.1 metadata
FHIR Validation tool Version 5.0.17 (Git# a375f58c8288). Built 2020-07-30T04:40:26.642Z (16 hours old)
Detected Java version: 14.0.2 from /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home on x86_64 (64bit). 4096MB available
Arguments: -version 4.0.1 metadata
Directories: Current = /Users/radamson/Downloads, Package Cache = /Users/radamson/.fhir/packages
.. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1
.. connect to tx server @ http://tx.fhir.org
(v4.0.1)
.. validate [metadata]
..Detect format for metadata
*FAILURE* validating metadata: error:1 warn:1 info:0
Error @ CapabilityStatement.rest[0].operation[0].definition (line 29864, col88) : URL value "http://hl7.org/fhir/OperationDefinition/CodeSystem-compose" does not resolve
Warning @ CapabilityStatement (line 1, col1) : cpb-0: Name should be usable as an identifier for the module by machine processing applications such as code generation [name.matches('[A-Z]([A-Za-z0-9_]){0,254}')]
This OperationDefinition is actually defined in base FHIR (I can resolve it in my browser), but I imagine a CapabilityStatement could just as likely include OperationDefinitions which are not publicly available.
Is there language in the FHIR spec that backs up these being errors? I'd imagine it being a warning, similar to an unknown CodeSystem, unless its actually mandatory for these to resolve.
Grahame Grieve (Jul 30 2020 at 23:46):
the java validator calls that an error if the target is in hl7.org/fhir, since it knows all about that space
Reece Adamson (Jul 31 2020 at 10:43):
I can understand that from an IG Publisher perspective, but when validating resource instances created by others than myself its not feasible to know which -ig
parameters to use.
As @Lloyd McKenzie indicated for @Robert Scalfani's example, the validator doesn't know about http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server
, which is in hl7.org/fhir, unless us core is loaded via the -ig
parameter. There may be an IG artifact that contains a definition for the offending URL in the vonk example as well, but realistically I'm not sure how I would know which to use.
In these cases I'm not sure whether the resource actually has errors or that the validator does not have the proper resources loaded via the -ig
flag.
Lloyd McKenzie (Jul 31 2020 at 13:46):
@Grahame Grieve
Michael Lawley (Aug 03 2020 at 02:47):
Since CapabilityStatement.url
is not required to resolve:
This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this capability statement is (or will be) published.
I would think this should not be reported as an error of the resource being validated, and at worst it is an error of the invocation of the validator itself (i.e., I could not resolve this because you didn't provide it to me, eg via a -ig parameter).
Grahame Grieve (Aug 03 2020 at 02:48):
what context is this in?
Michael Lawley (Aug 03 2020 at 02:56):
The quote is from https://www.hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.url
and I'm looking at the Output from @Robert Scalfani 's example at the start of the thread
Grahame Grieve (Aug 04 2020 at 01:49):
for now, I've changed the way we check canonical URLs; they are not a reference. I'll think about whether there's more checks I can do
Robert Scalfani (Aug 07 2020 at 14:20):
Hi Grahame, thanks for your response and help! It looks like this has been resolved for CapabilityStatement.url
, but not CapabilityStatement.implementationGuide
. I’m still getting the same issue
java -jar validator_cli.jar -version 4.0.1 uscoreexample.json
FHIR Validation tool Version 5.0.22 (Git# 5c4c5ce1c872). Built 2020-08-07T03:52:06.975Z (10 hours old)
Detected Java version: 11.0.8 from /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home on x86_64 (64bit). 8192MB available
Arguments: -version 4.0.1 uscoreexample.json
Directories: Current = /Users/rscalfani/Documents/CapabiltyStatement-mCODE-SearchRequirements/build/input/capabilities, Package Cache = /Users/rscalfani/.fhir/packages
.. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1
.. connect to tx server @ http://tx.fhir.org
(v4.0.1)
.. validate [uscoreexample.json]
Terminology server: Check for supported code systems for urn:iso:std:iso:3166
*FAILURE* validating uscoreexample.json: error:1 warn:0 info:45
Error @ CapabilityStatement.implementationGuide[0] (line 49, col4) : URL value "http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.1.0" does not resolve
Is there a reason why URLs for CapabilityStatement.implementationGuide
are still causing failures?
Grahame Grieve (Aug 07 2020 at 21:36):
well, that's a reference rather than a definition, and it looks wrong to me
Robert Scalfani (Aug 12 2020 at 18:24):
Is it required that the reference CapabilityStatement.implementationGuide
must resolve? I don't see this requirement that a canonical URL must resolve in the spec, could you point me to that requirement?
Grahame Grieve (Aug 12 2020 at 22:39):
the validator doesn't require it to resolve, but if you refer into the hl7.org/fhir space, the validator requires the references to be correct
Last updated: Apr 12 2022 at 19:14 UTC