public void Z_ValidateInputResources()
        {
            FhirValidator fv = new FhirValidator(Path.Combine(this.cacheDir, "validation.xml"));

            fv.StatusErrors   += this.StatusErrors;
            fv.StatusInfo     += this.StatusInfo;
            fv.StatusWarnings += this.StatusWarnings;
            bool success = fv.ValidateDir(this.resourcesDir, "*.json", "4.0.0");

            //StringBuilder sb = new StringBuilder();
            //fv.FormatMessages(sb);
            //Trace.WriteLine(sb.ToString());
            //Assert.IsTrue(success);
            Trace.WriteLine("Validation complete");
        }
        public void G_ValidateAcrExamples()
        {
            FhirValidator fv = new FhirValidator(Path.Combine(this.cacheDir, "validation.xml"));

            fv.StatusErrors   += this.StatusErrors;
            fv.StatusInfo     += this.StatusInfo;
            fv.StatusWarnings += this.StatusWarnings;
            fv.ValidatorArgs   = $" -ig {resourcesDir} -ig {acrResourcesDir}";
            // C:\Development\HL7\BreastRadiologyProfilesV2\IG\Guide\input
            bool          success = fv.ValidateDir(this.acrExamplesDir, "*.json", "4.0.0");
            StringBuilder sb      = new StringBuilder();

            fv.FormatMessages(sb);
            Trace.WriteLine(sb.ToString());
            Assert.IsTrue(success);
        }
Esempio n. 3
0
        void RunValidate()
        {
            Console.Clear();
            Thread.Sleep(500);

            Console.WriteLine("Starting validation");
            FhirValidator fv = new FhirValidator(ValidationPath);

            fv.JarPath         = this.JarPath;
            fv.StatusErrors   += this.StatusErrors;
            fv.StatusInfo     += this.StatusInfo;
            fv.StatusWarnings += this.StatusWarnings;
            fv.ValidatorArgs   = $" -ig {this.ResourcesPath} ";
            fv.ValidateDir(this.ExamplesPath, "*.json", "4.0.0");
            Console.WriteLine("Validation complete");
            Console.WriteLine("Press 'q' to quit the sample.");
        }
        public void D5_ValidateAcr()
        {
            //
            IGBuilder.RemoveFragmentExtensions(this.acrResourcesDir);
            FhirValidator fv = new FhirValidator(Path.Combine(this.cacheDir, "validation.xml"));

            fv.StatusErrors   += this.StatusErrors;
            fv.StatusInfo     += this.StatusInfo;
            fv.StatusWarnings += this.StatusWarnings;
            bool          success = fv.ValidateDir(this.acrResourcesDir, "*.json", "4.0.0");
            StringBuilder sb      = new StringBuilder();

            fv.FilterMessages("not resolve");
            fv.FormatMessages(sb);
            Trace.WriteLine(sb.ToString());
            Assert.IsTrue(success);
            Trace.WriteLine("Validation complete");
        }
        public void Z_ValidateOutputResources()
        {
            String rDir = Path.Combine(this.guideDir,
                                       "input",
                                       "resources");
            FhirValidator fv = new FhirValidator();

            fv.StatusErrors   += this.StatusErrors;
            fv.StatusInfo     += this.StatusInfo;
            fv.StatusWarnings += this.StatusWarnings;

            bool          success = fv.ValidateDir(rDir, "*.json", "4.0.0");
            StringBuilder sb      = new StringBuilder();

            //fv.FormatMessages(sb);
            //Trace.WriteLine(sb.ToString());
            Assert.IsTrue(success);
            Assert.IsTrue(fv.HasErrors == false);
            Trace.WriteLine("Validation complete");
        }