예제 #1
0
        public CodeSystemTable(IObjectRepository tdb, Body documentBody, List <Template> templates, TableCollection tables)
        {
            this.tdb          = tdb;
            this.documentBody = documentBody;
            this.templates    = templates;
            this.tables       = tables;

            var implementationGuides = this.templates.Select(y => y.OwningImplementationGuideId).Distinct();

            this.codeSystems = (from igcs in this.tdb.ViewImplementationGuideCodeSystems
                                join ig in implementationGuides on igcs.ImplementationGuideId equals ig
                                select new CodeSystemTable.CodeSystem()
            {
                Name = igcs.Name,
                Identifier = igcs.Identifier
            })
                               .Distinct()
                               .OrderBy(y => y.Name);
        }
예제 #2
0
        public CodeSystemTable(IObjectRepository tdb, Body documentBody, List <Template> templates, TableCollection tables)
        {
            this.tdb          = tdb;
            this.documentBody = documentBody;
            this.templates    = templates;
            this.tables       = tables;

            var implementationGuides = this.templates.Select(y => y.OwningImplementationGuideId).Distinct();

            // Perform the query first, then determine the distinct values next. This is for performance. Without it being
            // done like this, the DB query hangs forever.
            var igCodeSytsems = (from igcs in this.tdb.ViewImplementationGuideCodeSystems
                                 join ig in implementationGuides on igcs.ImplementationGuideId equals ig
                                 select new CodeSystemTable.CodeSystem()
            {
                Name = igcs.Name,
                Identifier = igcs.Identifier
            }).ToList();

            this.codeSystems = igCodeSytsems
                               .GroupBy(y => new { y.Identifier, y.Name })
                               .Select(y => new CodeSystemTable.CodeSystem()
            {
                Name       = y.First().Name,
                Identifier = y.First().Identifier
            })
                               .OrderBy(y => y.Name);
        }
예제 #3
0
        private TemplateContextTable(IObjectRepository tdb, List <ViewTemplateRelationship> relationships, TableCollection tables, Body documentBody, Template template, List <Template> exportedTemplates, HyperlinkTracker hyperlinkTracker)
        {
            this.tdb               = tdb;
            this.relationships     = relationships;
            this.tables            = tables;
            this.template          = template;
            this.documentBody      = documentBody;
            this.exportedTemplates = exportedTemplates;
            this.hyperlinkTracker  = hyperlinkTracker;

            this.allConstraints = template.ChildConstraints;
        }
예제 #4
0
        public static void AddTable(IObjectRepository tdb, List <ViewTemplateRelationship> relationships, TableCollection tables, Body documentBody, Template template, List <Template> exportedTemplates, HyperlinkTracker hyperlinkTracker)
        {
            TemplateContextTable cot = new TemplateContextTable(tdb, relationships, tables, documentBody, template, exportedTemplates, hyperlinkTracker);

            cot.AddTemplateContextTable();
        }
예제 #5
0
        public void BuildImplementationGuide(ExportSettings aModel, IIGTypePlugin igTypePlugin)
        {
            this.exportSettings = aModel;
            this.igTypePlugin   = igTypePlugin;

            this.docStream = new MemoryStream();
            this.document  = WordprocessingDocument.Create(this.docStream, WordprocessingDocumentType.Document);
            this.document.AddMainDocumentPart();

            this.SetupStyles();

            this.document.MainDocumentPart.Document =
                new Document(
                    new Body());

            this.hyperlinkTracker         = new HyperlinkTracker();
            this.tables                   = new TableCollection(this.document.MainDocumentPart.Document.Body, this.hyperlinkTracker);
            this.constraintTableGenerator = new TemplateConstraintTable(this._tdb, this.constraintReferences, this.igSettings, igTypePlugin, this.templates, this.tables, exportSettings.SelectedCategories, this.hyperlinkTracker);
            this.figures                  = new FigureCollection(this.document.MainDocumentPart.Document.Body);
            this.valueSetsExport
                = new ValueSetsExport(
                      igTypePlugin,
                      this.document.MainDocumentPart,
                      this.hyperlinkTracker,
                      this.tables,
                      exportSettings.GenerateValueSetAppendix,
                      exportSettings.DefaultValueSetMaxMembers,
                      exportSettings.ValueSetMaxMembers);
            this.codeSystemTable = new CodeSystemTable(this._tdb, this.document.MainDocumentPart.Document.Body, this.templates, this.tables);

            this.AddTitlePage();

            this.AddTableOfContents();

            this.AddVolume1(false);

            this.AddTemplateTypeSections();

            if (exportSettings.GenerateDocTemplateListTable || exportSettings.GenerateDocContainmentTable)
            {
                Paragraph entryLevelHeading = new Paragraph(
                    new ParagraphProperties(
                        new ParagraphStyleId()
                {
                    Val = Properties.Settings.Default.TemplateTypeHeadingStyle
                }),
                    new Run(
                        new Text("Template Ids in This Guide")));
                this.document.MainDocumentPart.Document.Body.AppendChild(entryLevelHeading);

                if (exportSettings.GenerateDocTemplateListTable)
                {
                    // Add used template table
                    this.AddDocumentTemplateListTable();
                }

                if (exportSettings.GenerateDocContainmentTable)
                {
                    TemplateContainmentGenerator.AddTable(this._tdb, this.document, this.templateRelationships, this.templates, this.tables, this.hyperlinkTracker);
                }
            }

            this.valueSetsExport.AddValueSetsAppendix();

            this.codeSystemTable.AddCodeSystemAppendix();

            this.AddRetiredTemplatesAppendix();

            if (exportSettings.IncludeChangeList)
            {
                this.LoadChangesAppendix();
            }

            this.AddVolume1(true);
        }
 private TemplateContainmentGenerator(IObjectRepository tdb, WordprocessingDocument document, List <ViewTemplateRelationship> relationships, List <Template> allTemplates, TableCollection tables, HyperlinkTracker hyperlinkTracker)
 {
     this.tdb              = tdb;
     this.document         = document;
     this.relationships    = relationships;
     this.allTemplates     = allTemplates;
     this.tables           = tables;
     this.hyperlinkTracker = hyperlinkTracker;
 }
        public static void AddTable(IObjectRepository tdb, WordprocessingDocument document, List <ViewTemplateRelationship> relationships, List <Template> allTemplates, TableCollection tables, HyperlinkTracker hyperlinkTracker)
        {
            TemplateContainmentGenerator tcg = new TemplateContainmentGenerator(tdb, document, relationships, allTemplates, tables, hyperlinkTracker);

            tcg.GenerateTable();
        }