Пример #1
0
 private object[] GenerateIncludeCodesValuesetHtml(ValueSetInclude include, bool isFirst)
 {
     return(new object[]
     {
         GetIncludeCodesDescription(isFirst, include.system.value),
         GenerateCodeTable(ValueSetCode.FromValueSetConcept1(include.concept), include.system, true)
     });
 }
Пример #2
0
 private object[] GenerateInlineValuesetHtml(ValueSetCodeSystem codeSystem)
 {
     return(new object[]
     {
         GetInlineDescription(true, codeSystem.system.value),
         GenerateCodeTable(ValueSetCode.FromValueSetConcept(codeSystem.concept), codeSystem.system, false)
     });
 }
Пример #3
0
        private XElement GenerateCodeExpansion(ValueSet valueset)
        {
            ValueSetCode[] expansion = new ValueSetCode[] { };

            bool showCodeSystem = true;

            // has already defined expansion
            if (valueset.expansion.WhenNotNull(t => t.contains.WhenNotNull(s => s.Length > 0)))
            {
                expansion = valueset
                            .expansion
                            .contains
                            .Select(t => new ValueSetCode()
                {
                    Code        = t.code.WhenNotNull(s => s.value),
                    DisplayName = t.display.WhenNotNull(s => s.value),
                    Definition  = t.system.WhenNotNull(s => s.value)
                })
                            .ToArray();

                showCodeSystem = (valueset
                                  .expansion
                                  .contains
                                  .DistinctBy(t => t.system.WhenNotNull(s => s.value)).Count() > 1);
            }

            if (valueset.compose != null)
            {
                if (valueset.compose.import != null)
                {
                    foreach (uri uri in valueset.compose.import)
                    {
                        // process valueset imports
                    }
                }

                if (valueset.compose.include != null)
                {
                    foreach (ValueSetInclude include in valueset.compose.include)
                    {
                        if (include.concept.WhenNotNull(t => t.Length > 0))
                        {
                            continue;
                        }

                        if (include.filter.WhenNotNull(t => t.Length > 0))
                        {
                            foreach (ValueSetFilter filter in include.filter)
                            {
                                // process filters
                            }
                        }
                        else
                        {
                            // process all
                        }
                    }
                }
            }

            object tableRows = Html.Tr(Html.Td(Html.I("(not available)")));

            if (expansion.Length > 0)
            {
                tableRows = expansion
                            .Select(t => Html.Tr(new object[]
                {
                    Html.Td(t.Code),
                    Html.Td(t.DisplayName),
                    Html.Td(showCodeSystem ? t.Definition : string.Empty)
                }))
                            .ToArray();
            }

            return(BootstrapHtml.Table(Styles.TableLayoutFixedClassName, new object[]
            {
                Html.THead(new object[]
                {
                    Html.Th(Styles.TableColumn20pcClassName, "Code"),
                    Html.Th(Styles.TableColumn20pcClassName, "Display"),
                    Html.Th(showCodeSystem ? "Code system" : string.Empty)
                }),
                Html.TBody
                (
                    tableRows
                )
            }));
        }
Пример #4
0
 public static ValueSetCode[] FromValueSetConcept1(ValueSetConcept1[] concepts)
 {
     return(concepts
            .Select(t => ValueSetCode.FromValueSetConcept1(t))
            .ToArray());
 }