private void AddValuesetListTable() { string[] headers = new string[] { "Name", "OID", "URL" }; Table t = this.tables.AddTable("Value Sets", headers); foreach (ValueSet cValueSet in this.appendixValueSets.Keys.OrderBy(y => y.Name)) { string cAnchor = Helper.GetCleanName(cValueSet.Name, 39); OpenXmlElement urlRun = DocHelper.CreateRun("N/A"); if (!string.IsNullOrEmpty(cValueSet.Source)) { urlRun = DocHelper.CreateUrlHyperlink(this.mainPart, cValueSet.Source, cValueSet.Source, Properties.Settings.Default.TableLinkStyle); } TableRow newRow = new TableRow( new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateAnchorHyperlink(cValueSet.Name, cAnchor, Properties.Settings.Default.TableLinkStyle))), new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun(cValueSet.Oid))), new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), urlRun))); t.Append(newRow); } }
private void AddValueSetDetailTable(ValueSet valueSet, DateTime bindingDate) { string bookmarkId = this.GetValueSetBookmark(valueSet); List <ValueSetMember> members = valueSet.GetActiveMembers(bindingDate); if (members == null || members.Count == 0) { return; } TableCell headingCell = new TableCell( new TableCellProperties() { GridSpan = new GridSpan() { Val = 4 } }, new Paragraph( new ParagraphProperties(new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun( string.Format("Value Set: {0} {1}", valueSet.Name, valueSet.Oid)))); if (!string.IsNullOrEmpty(valueSet.Description)) { headingCell.Append( new Paragraph( new ParagraphProperties(new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun(valueSet.Description))); } if (!string.IsNullOrEmpty(valueSet.Source)) { headingCell.Append( new Paragraph( new ParagraphProperties(new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun("Value Set Source: "), DocHelper.CreateUrlHyperlink(this.mainPart, valueSet.Source, valueSet.Source, Properties.Settings.Default.LinkStyle))); } Table t = DocHelper.CreateTable( new TableRow(headingCell), DocHelper.CreateTableHeader("Code", "Code System", "Code System OID", "Print Name")); int maximumMembers = this.defaultMaxMembers; if (this.valueSetMaximumMembers != null && this.valueSetMaximumMembers.ContainsKey(valueSet.Oid)) { maximumMembers = this.valueSetMaximumMembers[valueSet.Oid]; } int count = 0; foreach (ValueSetMember currentMember in members) { if (count >= maximumMembers) { break; } TableRow memberRow = new TableRow( new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun(currentMember.Code))), new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun(currentMember.CodeSystem.Name))), new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun(currentMember.CodeSystem.Oid))), new TableCell( new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun(currentMember.DisplayName))) ); t.Append(memberRow); count++; } if (count <= members.Count - 1 || valueSet.IsIncomplete) { TableRow moreMembersRow = new TableRow( new TableCell( new TableCellProperties() { GridSpan = new GridSpan() { Val = 4 } }, new Paragraph( new ParagraphProperties( new ParagraphStyleId() { Val = Properties.Settings.Default.TableContentStyle }), DocHelper.CreateRun("...")))); t.Append(moreMembersRow); } this.tables.AddTable(valueSet.Name, t, bookmarkId); }