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 B6_BuildIG()
        {
            DateTime start = DateTime.Now;

            Trace.WriteLine("Starting B5_BuildIG");
            try
            {
                String outputDir = Path.Combine(this.guideDir, "input");

                IGBuilder p = new IGBuilder(outputDir);
                p.StatusErrors   += this.StatusErrors;
                p.StatusInfo     += this.StatusInfo;
                p.StatusWarnings += this.StatusWarnings;
                p.Start(Path.Combine(this.contentDir, "IGBreastRad.xml"));

                p.AddGrouping($"{ResourcesMaker.Group_BaseResources}", "Main Resources",
                              "This section contains the main top level resources that are used in a Breast Radiology Report.");

                p.AddGrouping($"{ResourcesMaker.Group_CommonResources}", "Common Resources",
                              "This section contains resources that are commonly used throughout a Breast Radiology Report");
                p.AddGrouping($"{ResourcesMaker.Group_CommonCodesVS}", "Common ValueSets ",
                              "This section contains value sets that are commonly used throughout a Breast Radiology Report");
                p.AddGrouping($"{ResourcesMaker.Group_CommonCodesCS}", "Common CodeSystems",
                              "This section contains code systems that are commonly used throughout a Breast Radiology Report");

                p.AddGrouping($"{ResourcesMaker.Group_MGResources}", "Mammography Resources",
                              "This section contains resources used specifically in a Mammography exam");
                p.AddGrouping($"{ResourcesMaker.Group_MGCodesVS}", "Mammography ValueSets",
                              "This section contains value sets used specifically in a Mammography exam");
                p.AddGrouping($"{ResourcesMaker.Group_MGCodesCS}", "Mammography CodeSystems",
                              "This section contains code systems used specifically in a Mammography exam");

                p.AddGrouping($"{ResourcesMaker.Group_MRIResources}", "MRI Resources",
                              "This section contains resources used specifically in a MRI exam");
                p.AddGrouping($"{ResourcesMaker.Group_MRICodesVS}", "MRI ValueSets",
                              "This section contains value sets used specifically in a MRI exam");
                p.AddGrouping($"{ResourcesMaker.Group_MRICodesCS}", "MRI CodeSystems",
                              "This section contains code systems used specifically in a MRI exam");

                p.AddGrouping($"{ResourcesMaker.Group_USResources}", "Ultra-Sound Resources",
                              "This section contains resources used specifically in a Ultra-Sound exam");
                p.AddGrouping($"{ResourcesMaker.Group_USCodesVS}", "Ultra-Sound ValueSets",
                              "This section contains value sets used specifically in a Ultra-Sound exam");
                p.AddGrouping($"{ResourcesMaker.Group_USCodesCS}", "Ultra-Sound CodeSystems",
                              "This section contains code systems used specifically in a Ultra-Sound exam");

                p.AddGrouping($"{ResourcesMaker.Group_NMResources}", "Nuclear Medicine Resources",
                              "This section contains resources used specifically in a Nuclear Medicine exam");
                p.AddGrouping($"{ResourcesMaker.Group_NMCodesVS}", "Nuclear Medicine ValueSets",
                              "This section contains value sets used specifically in a Nuclear Medicine exam");
                p.AddGrouping($"{ResourcesMaker.Group_NMCodesCS}", "Nuclear Medicine CodeSystems",
                              "This section contains code systems used specifically in a Nuclear Medicine exam");

                p.AddGrouping($"{ResourcesMaker.Group_AimResources}", "AIM Resources",
                              "This section contains resources used specifically by AIM");
                p.AddGrouping($"{ResourcesMaker.Group_AimCodesVS}", "AIM ValueSets",
                              "This section contains value sets used specifically by AIM");
                p.AddGrouping($"{ResourcesMaker.Group_AimCodesCS}", "AIM CodeSystems",
                              "This section contains code systems used specifically by AIM");

                p.AddGrouping($"{ResourcesMaker.Group_Fragments}", "Fragments",
                              "This section the fragments that are used to define the resources");

                p.AddGrouping($"{ResourcesMaker.Group_ExtensionResources}", "Extension",
                              "Extension Resource Definitions");

                p.AddGrouping($"{ResourcesMaker.Group_Examples}", "Examples",
                              "Example Definitions");

                p.AddResources(this.resourcesDir);
                p.AddResources(this.acrResourcesDir);

                p.AddFragments(this.fragmentsDir);
                p.AddFragments(this.acrFragmentsDir);

                p.AddPageContent(this.pageDir);
                p.AddPageContent(this.acrPageDir);
                p.AddPageContent(this.pageTemplateDir);
                p.AddIncludes(this.includesDir);
                p.AddExamples(this.examplesDir);
                p.AddImages(this.graphicsDir);
                p.AddImages(this.acrGraphicsDir);
                p.SaveAll();

                //if (p.HasErrors)
                //{
                //    StringBuilder sb = new StringBuilder();
                //    p.FormatErrorMessages(sb);
                //    Trace.WriteLine(sb.ToString());
                //    Debug.Assert(false);
                //}
            }
            catch (Exception err)
            {
                Trace.WriteLine(err.Message);
                Assert.IsTrue(false);
            }

            TimeSpan span = DateTime.Now - start;

            Trace.WriteLine($"Ending B6_BuildIG[{(Int32)span.TotalSeconds}]");
        }