I'm having trouble getting the standalone command-line HAPI validator (validator_cli.jar
) to validate resources with certain packages downloaded from simplifier.net.
The required packages and their dependencies have been installed in the FHIR Package Cache according to the usual instructions shown on simplifier.net package pages, i.e. via fhir install <package> <version>
. Manual inspection of the cache (@ %userprofile%/.fhir/packages) shows no abnormalities; the contents are shown at the end of this post. package.json
and fhirpkg.lock.json
are in the validator process working directory, even though the validator doesn't seem to care about it.
The command line used to invoke the validator is:
<java.exe> -jar <validator_cli.jar> <resource> -tx n/a -version 4.0.1 -ig [package]
The things in angle brackets are placeholders for the fully qualified paths of the files in question; quote characters are added automatically by the invoker if the filenames are found to contain whitespace. [package]
is the canonical packagename, optionally including the version.
With the invocation schema above the validation works as expected for some packages but not for others. An example that works is de.abda.eRezeptAbgabedaten#1.0.3 (project eRezeptAbgabedaten @ simplifier.net).
Examples that don't work are de.gematik.erezept-workflow.r4#1.0.2 and de.gkvsv.eRezeptAbrechnungsdaten#1.0.3. For these the validator loads all relevant packages and then it either terminates with exit code 1 or it hangs forever, without indication what it is doing. In any case the 'Validating' line does not appear, and the outcome is the same regardless of the presence of the -profile parameter.
FHIR Validation tool Version 5.3.14 (Git# d17a8da923f9). Built 2021-05-14T15:06:07.75Z (9 days old)
Java: 1.8.0_101 from C:\Program Files\Java\jre1.8.0_101 on amd64 (64bit). 7264MB available
Paths: Current = d:\dev\FHIR\CLI, Package Cache = C:\Users\KnightOwl\.fhir\packages
Params: d:\dev\CLR\ApoTI\E-Rezept-Beispieldaten\ABDA\eRezeptAbrechnungsdaten-1.0.3\529d741c-7ad8-41d8-97c3-9aabbdd084b2.xml -tx n/a -version 4.0.1 -debug -ig de.gkvsv.eRezeptAbrechnungsdaten#1.0.3
Loading
Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:05.0071)
Load hl7.terminology#2.1.0 - 3767 resources (00:01.0358)
Terminology server null - Version n/a: No Terminology Server (00:00.0000)
Load de.basisprofil.r4#0.9.13 - 128 resources (00:00.0161)
Load de.abda.eRezeptAbgabedaten#1.0.3 - 49 resources (00:00.0066)
Load KBV.Basis#1.1.3 - 68 resources (00:00.0081)
Load KBV.ITA.FOR#1.0.3 - 14 resources (00:00.0068)
Load KBV.ITA.ERP#1.0.1 - 28 resources (00:00.0051)
Load de.gematik.erezept-workflow.r4#1.0.2
-> exit code 1
The validator built into the Firely Terminal (fhir validate
) does not exhibit these problems, though, even though it uses the same package cache.
Note: it is possible that de.gematik.erezept-workflow.r4#1.0.2 is poisoned in some way and that it causes the other package to fail because it is among its dependencies.
Any tips on finding out what's wrong with the poisonous package, so I can clean it up for validation use? Unfortunately the validator itself doesn't give any hints, even with -debug
.
Note: the resource I used above is the first example resource from project eRezeptAbrechnungsdaten, package de.gkvsv.eRezeptAbrechnungsdaten#1.0.3. Here's the output of fhir cache
:
de.abda.eRezeptAbgabedaten@1.0.3
de.basisprofil.r4@0.9.13
de.gematik.erezept@workflow.r4#1.0.2
de.gkvsv.eRezeptAbrechnungsdaten@1.0.3
hl7.fhir.core@4.0.1
hl7.fhir.r4.core@4.0.1
hl7.fhir.r4.elements@4.0.1
hl7.fhir.r4.examples@4.0.1
hl7.fhir.r4.expansions@4.0.1
hl7.fhir.r5.core@current
hl7.fhir.xver@extensions#0.0.4
hl7.terminology@2.1.0
KBV.Basis@1.1.3
KBV.ITA.ERP@1.0.1
KBV.ITA.FOR@1.0.3
P.S.: binary search identified two poisonous files in package de.gematik.erezept-workflow.r4#1.0.2. createOperation.json causes the validator to abort with exit code 1 (without any error message) during the package load process. StructureDefinition-MedicationDispense-ERxMedicationDispense.json causes the validator to hang during the package load process. Validation works normally after removing these two files from the package cache and deleting .index.json
. However, we will have to validate ErxMedicationDispense
resources as well, so the removal of the two poisonous files is not a remedy; it has only diagnostic value.