예제 #1
0
        protected Boolean ProcessResults(String[] resourcePaths, String validationPath)
        {
            if (resourcePaths is null)
            {
                throw new ArgumentNullException(nameof(resourcePaths));
            }

            FhirXmlParser parser = new FhirXmlParser();
            bool          retVal = true;

            if (resourcePaths.Length == 1)
            {
                OperationOutcome results      = parser.Parse <OperationOutcome>(File.ReadAllText(validationPath));
                String           resourceName = Path.GetFileName(resourcePaths[0]);
                this.ProcessOutcome(results, resourceName, this.FailOnWarnings, ref retVal);
            }
            else
            {
                Bundle resultsBundle = parser.Parse <Bundle>(File.ReadAllText(validationPath));
                foreach (Bundle.EntryComponent item in resultsBundle.Entry)
                {
                    OperationOutcome results      = item.Resource as OperationOutcome;
                    Extension        e            = results.GetExtension("http://hl7.org/fhir/StructureDefinition/operationoutcome-file");
                    String           resourceName = Path.GetFileName(((FhirString)e.Value).Value);
                    this.ProcessOutcome(results, resourceName, this.FailOnWarnings, ref retVal);
                }
            }
            return(retVal);
        }