Stream: implementers
Topic: Package validation with Java validator
Matthijs van der Wielen (Oct 19 2020 at 08:00):
So I'm playing around with package based validation with the Java Validator, but I haven't figured out how to get it to work yet.
What I did:
- Dowload the uk.core.r4-1.3.0.tgz package from Simplifier.net. https://simplifier.net/packages/uk.core.r4/1.3.0
- Download the example resourece Richard Smith from the UK Core project. https://simplifier.net/ukcore/ukcore-patient-richardsmith-example
- Run the following in the command prompt:
java -jar validator_cli.jar UKCore-Patient-RichardSmith-Example.json -ig uk.core.r4-1.3.0.tgz
But the output is:
FHIR Validation tool Version 5.1.16 (Git# ea0b4c0c1c10). Built 2020-10-01T04:39:09.65Z (18 days old)
Java: 1.8.0_261 from C:\Program Files (x86)\Java\jre1.8.0_261 on x86 (32bit). 247MB available
Paths: Current = C:\Git\R4\Packagevalid, Package Cache = C:\Users\Matthijs\.fhir\packages
Params: UKCore-Patient-RichardSmith-Example.json -ig uk.core.r4-1.3.0.tgz
Scanning for versions (no -version parameter):
Package uk.core.r4-1.3.0.tgz: 4.0
-> use version 4.0
Loading
Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:06.0553)
Terminology server http://tx.fhir.org - Version 1.0.353 (00:01.0877)
2020-10-19 10:05:25.296 [main] INFO o.h.f.u.npm.BasePackageCacheManager [BasePackageCacheManager.java:79] Failed to resolve package uk.core.r4-1.3.0.tgz#null from server: http://packages.fhir.org
2020-10-19 10:05:25.797 [main] INFO o.h.f.u.npm.BasePackageCacheManager [BasePackageCacheManager.java:79] Failed to resolve package uk.core.r4-1.3.0.tgz#null from server: http://packages2.fhir.org/packages
Exception in thread "main" org.hl7.fhir.exceptions.FHIRException: Unable to resolve package id uk.core.r4-1.3.0.tgz#null
at org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.fetchTheOldWay(FilesystemPackageCacheManager.java:675)
at org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.loadFromPackageServer(FilesystemPackageCacheManager.java:222)
at org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager.loadPackage(FilesystemPackageCacheManager.java:494)
at org.hl7.fhir.validation.ValidationEngine.loadIg(ValidationEngine.java:1010)
at org.hl7.fhir.validation.cli.services.ValidationService.getValidator(ValidationService.java:203)
at org.hl7.fhir.validation.Validator.main(Validator.java:188)
Can anyone tell me how to do this correctly? Validating this example patient against the package on Simplifier works fine.
Kevin Mayfield (Oct 19 2020 at 08:31):
The examples I have working are on this page (slightly out of date ... I'll correct this morning).
https://simplifier.net/guide/NHSDigitalSpine/TestingandValidation
Kevin Mayfield (Oct 19 2020 at 08:33):
I've been using the full url. So my ig parameter would be:
https://packages.simplifier.net/uk.core.r4/-/uk.core.r4-1.3.0.tgz
Matthijs van der Wielen (Oct 19 2020 at 08:45):
@Kevin Mayfield Thanks! That was really helpful.
Last updated: Apr 12 2022 at 19:14 UTC