Stream: tooling
Topic: Fetching references using the Validator
Pieter Edelman (Sep 30 2021 at 14:32):
Hi,
I'm trying to validate an instance of a profile that uses slicing by target profile, using the HL7 Validator. However, the Validator cannot resolve the referenced instance:
Error @ Encounter.participant[0] (line 16, col17) : Slicing cannot be evaluated: Problem evaluating slicing expression for element in profile http://nictiz.nl/fhir/StructureDefinition/nl-core-Encounter path Encounter.participant[0] (fhirPath = true and individual.resolve().conformsTo('http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthProfessional-PractitionerRole')): The URL 'PractitionerRole/nl-core-HealthProfessional-PractitionerRole-01' is not known to the FHIR validator, and has not been provided as part of the setup / parameters
So I'd like to provide the target instance as part of the setup / parameters, but unfortunately this section on the Confluence page is marked "TODO". I tried supplying the target as an additional instance to validate and tried to include it as an -ig
, but the error persists. Could someone point me in the right direction?
Lloyd McKenzie (Sep 30 2021 at 17:20):
@Grahame Grieve
Grahame Grieve (Sep 30 2021 at 19:44):
how do I reproduce this?
Pieter Edelman (Oct 01 2021 at 06:46):
The command I use is java -jar /path/to/validator_cli.jar -version 4.0 -ig resources/ -recurse examples/nl-core-Encounter-01.xml
The "resources" dir (resources.zip) contains a set of conformance resources, including the profile containing the slicing logic. The "examples" dir (examples.zip) contains all examples, including the filed "nl-core-Encounter-01.xml" and "nl-core-HealthProfessional-PractitionerRole-01.xml", which both have the .id
's identical to the file names.
Variants I tried:
java -jar /path/to/validator_cli.jar -version 4.0 -ig resources/ -recurse examples/nl-core-Encounter-01.xml examples/nl-core-HealthProfessional-PractitionerRole-01.xml
java -jar /path/to/validator_cli.jar -version 4.0 -ig resources/ -ig examples/ -recurse examples/nl-core-Encounter-01.xml
- From the examples dir
java -jar /path/to/validator_cli.jar -version 4.0 -ig /full/path/to/resources/ -recurse nl-core-Encounter-01.xml
Pieter Edelman (Oct 01 2021 at 06:48):
I don't know if references to files on disk even work for the Validator, but they work for the IG Publisher so I kinda assumed that it would work similarly.
Grahame Grieve (Oct 04 2021 at 05:31):
if references to files on disk even work for the Validator
No, they don't. Which is why I wondered how you were doing it
Grahame Grieve (Oct 04 2021 at 05:32):
it's a todo, as you saw
Pieter Edelman (Oct 04 2021 at 10:58):
Ah ... I just thought the documentation was "TODO" ;)
Grahame Grieve (Oct 04 2021 at 11:03):
sadly no
David Simons (Dec 15 2021 at 13:26):
Also running into
- error at Observation.hasMember[0] (38, 16):
Slicing cannot be evaluated: Problem evaluating slicing expression for element in profile <cut>/TNMStaging path Observation.hasMember[0] (fhirPath = true and (resolve() is Observation)): The URL 'Observation/ils-test-TumorStage' is not known to the FHIR validator, and has not been provided as part of the setup / parameters
where we reference Resources on local disk/folder, adjacent to the being-validated Resource
<hasMember>
<reference value="Observation/ils-test-TumorStage"/>
</hasMember>
Pieter Edelman (Dec 15 2021 at 19:41):
There's a ticket for this feature request: https://github.com/hapifhir/org.hl7.fhir.core/issues/644
Last updated: Apr 12 2022 at 19:14 UTC