Hello Folks,
I’m unable to get the FHIR Validator availabel with the FHIR.NET SDK to work in validating against the US Core profile. I’m just starting to use the SDK for validation so I’m likely doing something stupid.
I Downloaded the US CORE Package and have it both in zipped and unzipped form present in folder “fhir-profiles”. However while trying to resolve I get the following errors from OerationOutcome:
- Unable to resolve reference to profile ‘…/StructureDefinition/Patient’ (removed full hyperlink to conform to forum rules)
- Unable to resolve reference to profile ‘…/StructureDefinition-us-core-patient’ (removed full hyperlink to conform to forum rules)
Any pointers would be appreciated.
Code Snippet
// Tried these combinations for source
/ var source = new CachedResolver(new MultiResolver(
new DirectorySource(@"…/fhir-profiles",
new DirectorySourceSettings() { IncludeSubDirectories = true }),
ZipSource.CreateValidationSource()));/
var source = new CachedResolver(
new DirectorySource(@"…/fhir-profiles",
new DirectorySourceSettings() { IncludeSubDirectories = true }));
var ctx = new ValidationSettings
{
ResourceResolver = source,
GenerateSnapshot = true,
Trace = false,
// EnableXsdValidation = true, // Tried both combinations
// ResolveExternalReferences = false // Tried both combinations
};
var poco = GetPatientPoco(…);
var validator = new Validator(ctx);
var result = validator.Validate(poco, @“http://hl7.org/fhir/us/core/StructureDefinition-us-core-patient”);
return result;