[英]HL7 Validator PlanDefinition failed:
I had to upgrade Hl7.Fhir.STU3 and Hl7.Fhir.Specification.STU3 library and now I am getting error message that it can't resolution PlanDefinition profile. 我不得不升级Hl7.Fhir.STU3和Hl7.Fhir.Specification.STU3库,现在我收到错误消息,它无法解析PlanDefinition配置文件。 I can see within the debugger that the specification.zip is being Extracted Extracted to 'C:\\Users\\dev\\AppData\\Local\\Temp\\FhirArtifactCache-1.2.1-Hl7.Fhir.STU3.Specification\\specification'}
我可以在调试器中看到规范.zip被提取为'C:\\ Users \\ dev \\ AppData \\ Local \\ Temp \\ FhirArtifactCache-1.2.1-Hl7.Fhir.STU3.Specification \\ specification'}
Why will this not finding PlanDefinition?
为什么这不会找到PlanDefinition?
{"Overall result: FAILURE (1 errors and 0 warnings)\r\n\r\n[ERROR] Resolution of profile at 'http://hl7.org/fhir/StructureDefinition/PlanDefinition' failed: Cannot prepare ZipSource: file 'D:\\Users\\mcdevitt\\Documents\\Visual Studio 2015\\FHIRValidatorFile\\FHIRValidatorFile\\FHIRValidatorFile\\bin\\Debug\\CustomProfiles' was not found (at PlanDefinition)"}
var HL7obj = new FhirXmlParser().Parse<PlanDefinition>(HL7FileData);
var coreSource = ZipSource.CreateValidationSource();
var cachedResolver = new CachedResolver(
new DirectorySource(CustomProfilesPath, includeSubdirectories: true));
var combinedSource = new MultiResolver(cachedResolver, coreSource);
var ctx = new ValidationSettings()
{
ResourceResolver = combinedSource,
GenerateSnapshot = true,
Trace = false,
EnableXsdValidation = true,
ResolveExteralReferences = false
};
var HL7validator = new Validator(ctx);
var result = HL7validator.Validate(HL7obj);
This error comes from the ZipSource not being able to find a zipped file at the listed path. 此错误来自ZipSource无法在列出的路径中找到压缩文件。 Instead of the path to a folder, please indicate the zipfile that you want to use as source.
请指明要用作源的zipfile,而不是文件夹的路径。
From the 'coreSource' name, I assume that you want to point to the base FHIR specification. 从'coreSource'名称,我假设你想指向基本的FHIR规范。 Instead of supplying your own zipfile for that, you can change it to this line:
您可以将其更改为以下行,而不是为此提供自己的zip文件:
var coreSource = ZipSource.CreateValidationSource();
The library will locate the specification.zip that comes with it, and will then be able to use it for validation against the core spec. 该库将找到随附的specification.zip,然后可以使用它来验证核心规范。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.