Ejemplo n.º 1
0
        IntroDoc CreateIntroDocVS(ValueSet binding)
        {
            IntroDoc doc = new IntroDoc();

            doc.TryAddUserMacro("TitleArticle", this.Article(binding.Title));
            doc.TryAddUserMacro("Title", binding.Title);
            doc.TryAddUserMacro("FocusPath", FocusMapMaker.FocusMapName(binding.Name));
            doc.Load("ValueSet",
                     Path.Combine(Self.pageDir, $"ValueSet-{binding.Name}-intro.xml"));
            return(doc);
        }
        public void D4_BuildGraphics()
        {
            DateTime start = DateTime.Now;

            Trace.WriteLine("Starting D4_BuildGraphics");
            try
            {
                {
                    ResourceMap map = new ResourceMap();
                    map.AddDir(this.acrResourcesDir, "*.json");
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.AlwaysShowChildren = true;
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("ImagingContextExtension"),
                                                Path.Combine(this.acrGraphicsDir, "ImagingContextOverview.svg"));
                    }
                    {
                        FocusMapMaker focusMapMaker = new FocusMapMaker(this.fc,
                                                                        map,
                                                                        this.acrGraphicsDir,
                                                                        this.acrPageDir);
                        focusMapMaker.Create();
                    }
                }

                {
                    ResourceMap map = new ResourceMap();
                    map.AddDir(this.acrFragmentsDir, "*.json");

                    FragmentMapMaker fragmentMapMaker = new FragmentMapMaker(this.fc,
                                                                             map,
                                                                             this.acrGraphicsDir,
                                                                             this.pageTemplateDir);
                    fragmentMapMaker.Create(false);
                }
            }
            catch (Exception err)
            {
                Trace.WriteLine(err.Message);
                Assert.IsTrue(false);
            }

            TimeSpan span = DateTime.Now - start;

            Trace.WriteLine($"Ending D4_BuildGraphics [{(Int32)span.TotalSeconds}]");
        }
Ejemplo n.º 3
0
        SDefEditor CreateEditor(String name,
                                String title,
                                String mapName,
                                String baseDefinition,
                                String groupPath,
                                String docTemplateName)
        {
            title = title.Trim();
            SDefEditor retVal = this.CreateEditor(name, title, mapName, baseDefinition, groupPath);

            retVal.IntroDoc = new IntroDoc();
            retVal.IntroDoc.TryAddUserMacro("FocusPath", FocusMapMaker.FocusMapName(retVal.SDef.Url.LastUriPart()));
            retVal.IntroDoc.TryAddUserMacro("TitleArticle", this.Article(title));
            retVal.IntroDoc.TryAddUserMacro("Title", title);
            retVal.IntroDoc.Load(docTemplateName, Path.Combine(this.pageDir, $"StructureDefinition-{name}-intro.xml"));

            return(retVal);
        }
        public void B4_BuildGraphics()
        {
            DateTime start = DateTime.Now;

            Trace.WriteLine("Starting B4_BuildGraphics");
            try
            {
                {
                    ResourceMap map = new ResourceMap();
                    map.AddDir(this.resourcesDir, "*.json");
                    {
                        FocusMapMaker focusMapMaker = new FocusMapMaker(this.fc,
                                                                        map,
                                                                        this.graphicsDir,
                                                                        this.pageDir);
                        focusMapMaker.Create();
                    }
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.AlwaysShowChildren = true;
                        // resourceMapMaker.SvgEditor.RenderTestPoint = "Tumor Satellite";
                        String svgPath = Path.Combine(this.graphicsDir, "TotalProfile.svg");
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("BreastRadComposition"),
                                                svgPath);

                        // Create PNG Image from SVG-File
                        //var svgDoc = Svg.SvgDocument.Open(svgPath);
                        //svgDoc.AspectRatio = new SvgAspectRatio();
                        //svgDoc.ShapeRendering = SvgShapeRendering.Auto;

                        //String pngPath = Path.Combine(this.graphicsDir, "TotalProfile.png");
                        //Int32 dpi = 1;
                        //Int32 width = 2748 * dpi;
                        //Int32 height = 38028 * dpi;

                        //Bitmap bmp = svgDoc.Draw(width, height);
                        //bmp.Save(pngPath, ImageFormat.Png);
                    }
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("BreastRadComposition"),
                                                Path.Combine(this.graphicsDir, "ProfileOverview.svg"));
                    }
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("MGFinding"),
                                                Path.Combine(this.graphicsDir, "MgFindings.svg"));
                    }
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("MRIFinding"),
                                                Path.Combine(this.graphicsDir, "MRIFindings.svg"));
                    }
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("NMFinding"),
                                                Path.Combine(this.graphicsDir, "NMFindings.svg"));
                    }
                    {
                        ResourceMapMaker resourceMapMaker = new ResourceMapMaker(this.fc, map);
                        resourceMapMaker.Create(ResourcesMaker.CreateUrl("USFinding"),
                                                Path.Combine(this.graphicsDir, "USFindings.svg"));
                    }
                }

                {
                    ResourceMap map = new ResourceMap();
                    map.AddDir(this.fragmentsDir, "*.json");

                    FragmentMapMaker fragmentMapMaker = new FragmentMapMaker(this.fc,
                                                                             map,
                                                                             this.graphicsDir,
                                                                             this.pageTemplateDir);
                    fragmentMapMaker.Create(true);
                }
            }
            catch (Exception err)
            {
                Trace.WriteLine(err.Message);
                Assert.IsTrue(false);
            }

            TimeSpan span = DateTime.Now - start;

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