Stream: dotnet
Topic: setup the resolver
Jefferson (Jun 07 2019 at 20:13):
I am using a web that is creating FHIR data and I would like to validate it against the CustomProfile. Looks like it is having a hard time with the resolver to use specification.zip. Is there any other way to do this? Errror message is Cannot create a ZipSource for the core specification: 'specification.zip' was not found. // setup the resolver to use specification.zip, and a folder with custom profiles
var source = new CachedResolver(new MultiResolver(
new DirectorySource(CustomProfilesPath, true),
ZipSource.CreateValidationSource()));
Vadim Peretokin (Jun 07 2019 at 20:17):
Put specification.zip
where it can find it (alongside your .exe would work). There is also a different constructor where you can specify the location of the zip
Jefferson (Jun 07 2019 at 20:18):
I have specification.zip in the bin folder
Jefferson (Jun 07 2019 at 20:18):
what is the constructor where i can specify the location of the zip?
Vadim Peretokin (Jun 07 2019 at 20:22):
https://github.com/FirelyTeam/fhir-net-api/blob/develop-stu3/src/Hl7.Fhir.Specification/Specification/Source/ZipSource.cs#L45 - public ZipSource(string zipPath)
Grahame Grieve (Jun 10 2019 at 13:10):
https://stackoverflow.com/questions/56526263/hl7-validator-plandefinition-failed - looks like a question along the same line?
Michel Rutten (Jun 10 2019 at 23:46):
Hi @Tom MCDEVITT, specification.zip is part of the Hl7.Fhir.[STU3|R4].Specification package on Nuget. Visual Studio should copy this file to the binary output folder, but sometimes fails to do so. In that case, select specification.zip in your solution explorer, go to properties tab and change the file type to "Content", "Copy to output when newer". This ensures that VS actually includes the ZIP file in the output folder. Now the ZipSource should be able to resolve.
Last updated: Apr 12 2022 at 19:14 UTC