@@ -241,9 +241,9 @@ public static IEnumerable<object[]> GetDataForEcr()
241241 // ]
242242 new [ ] { @"EICR" , @"eCR_full.xml" , @"eCR_full-expected.json" , "validation" , "9" } ,
243243 new [ ] { @"EICR" , @"eCR_RR_combined_3_1.xml" , @"eCR_RR_combined_3_1-expected.json" , "validation" , "13" } ,
244- new [ ] { @"EICR" , @"eCR_EveEverywoman.xml" , @"eCR_EveEverywoman-expected.json" , "validation" , "51 " } ,
244+ new [ ] { @"EICR" , @"eCR_EveEverywoman.xml" , @"eCR_EveEverywoman-expected.json" , "validation" , "37 " } ,
245245 new [ ] { @"EICR" , @"eicr04152020.xml" , @"eicr04152020-expected.json" , "validation" , "19" } ,
246- new [ ] { @"EICR" , @"CDAR2_IG_PHCASERPT_R2_D2_SAMPLE.xml" , @"CDAR2_IG_PHCASERPT_R2_D2_SAMPLE-expected.json" , "validation" , "25 " } ,
246+ new [ ] { @"EICR" , @"CDAR2_IG_PHCASERPT_R2_D2_SAMPLE.xml" , @"CDAR2_IG_PHCASERPT_R2_D2_SAMPLE-expected.json" , "validation" , "21 " } ,
247247 } ;
248248 return data . Select ( item => new [ ]
249249 {
@@ -398,6 +398,9 @@ protected void ConvertCCDAMessageAndValidateExpectedResponse(ITemplateProvider t
398398
399399 protected void ValidateConvertCCDAMessageIsValidFHIR ( ITemplateProvider templateProvider , string rootTemplate , string inputFile , string validationFailureStep , int numFailures )
400400 {
401+ System . Console . Out . WriteLine ( "#####################################################################################################" ) ;
402+ System . Console . Out . WriteLine ( inputFile ) ;
403+ System . Console . Out . WriteLine ( "-----------------------------------------------------------------------------------------------------" ) ;
401404 var validateFhir = Environment . GetEnvironmentVariable ( "VALIDATE_FHIR" ) ?? "false" ;
402405 if ( validateFhir . Trim ( ) == "false" ) return ;
403406
@@ -420,17 +423,34 @@ protected void ValidateConvertCCDAMessageIsValidFHIR(ITemplateProvider templateP
420423 actualContent ,
421424 serializerOptions
422425 ) ;
423- var packageSource = new FhirPackageSource (
426+ var ecrSource = new FhirPackageSource (
424427 ModelInfo . ModelInspector ,
425428 "https://packages2.fhir.org/packages" ,
426- new string [ ] {
427- "hl7.fhir.us.ecr@2.1.2" ,
428- }
429+ new string [ ] { "hl7.fhir.us.ecr@2.1.2" , }
429430 ) ;
430- var profileSource = new CachedResolver ( packageSource ) ;
431+ var coreSource = FhirPackageSource . CreateCorePackageSource (
432+ ModelInfo . ModelInspector ,
433+ FhirRelease . R4 ,
434+ "https://packages2.fhir.org/packages"
435+ ) ;
436+
437+ var profileSource = new CachedResolver ( ecrSource ) ;
438+ var loincClient = new FhirClient ( "https://fhir.loinc.org" ) ;
439+ loincClient . RequestHeaders . Authorization =
440+ new System . Net . Http . Headers . AuthenticationHeaderValue (
441+ "Basic" ,
442+ "am55Z2FhcmQ6M1hTQCFld2NBQWVMc1pN"
443+ ) ;
444+ var loincTerminologyService = new ExternalTerminologyService ( loincClient ) ;
431445 var terminologyService = new LocalTerminologyService ( profileSource ) ;
446+ var baseTermSer = LocalTerminologyService . CreateDefaultForCore ( coreSource ) ;
447+ var mulTermSer = new MultiTerminologyService (
448+ terminologyService ,
449+ baseTermSer ,
450+ loincTerminologyService
451+ ) ;
432452
433- var validator = new Validator ( profileSource , terminologyService ) ;
453+ var validator = new Validator ( profileSource , mulTermSer ) ;
434454 var result = validator . Validate ( poco ) ;
435455 var outcomeText = result . ToString ( ) ;
436456 var numFailed = result . Issue . Count ( ) ;
0 commit comments