bool ILanguangeExporter.AppendValueSetCodeConcept( ref StringBuilder sb, string sanitizedValueSetName, string sanitizedCodeName, fhir.CodeSystemConcept concept, string systemUrl ) { string comment; // **** start with a comment **** if (!string.IsNullOrEmpty(concept.Definition)) { comment = FhirTypeManager.SanitizeComment(concept.Definition, _lineComment, _indentChar, 2); } else if (!string.IsNullOrEmpty(concept.Display)) { comment = FhirTypeManager.SanitizeComment(concept.Display, _lineComment, _indentChar, 2); } else { comment = $"Value for '{concept.Code}'</summary>\n"; } // **** coding is exported inline (before internal and external interfaces) **** sb.Append($"const {sanitizedValueSetName}_{sanitizedCodeName}: Coding = {{\n"); sb.Append($"\t\tcode: \"{concept.Code}\",\n"); if (!string.IsNullOrEmpty(concept.Display)) { sb.Append($"\t\tdisplay: \"{concept.Display.Replace("\"", "\\\"")}\",\n"); } sb.Append($"\t\tsystem: \"{systemUrl}\"\n"); sb.Append($"\t}};\n"); // **** add this code to our interface **** //_valueSetInterfaceSB.Append($"\t/**\n\t * {comment}\n\t */\n"); //_valueSetInterfaceSB.Append($"\t{sanitizedCodeName}: Coding,\n"); // **** add this code to our export **** _valueSetExportSB.Append($"\t/**\n\t * {comment}\n\t */\n"); _valueSetExportSB.Append($"\t{sanitizedCodeName}: {sanitizedValueSetName}_{sanitizedCodeName},\n"); return(true); }
bool ILanguangeExporter.AppendValueSetCodeConcept( ref StringBuilder sb, string sanitizedValueSetName, string sanitizedCodeName, fhir.CodeSystemConcept concept, string systemUrl ) { // **** start with a comment **** if (!string.IsNullOrEmpty(concept.Definition)) { sb.Append($"\t\t///<summary>{FhirTypeManager.SanitizeComment(concept.Definition, _lineComment, _indentChar, 2)}</summary>\n"); } else if (!string.IsNullOrEmpty(concept.Display)) { sb.Append($"\t\t///<summary>{FhirTypeManager.SanitizeComment(concept.Display, _lineComment, _indentChar, 2)}</summary>\n"); } else { sb.Append($"\t\t///<summary>Value for '{concept.Code}'</summary>\n"); } // **** start our coding **** sb.Append($"\t\tpublic static readonly Coding {sanitizedCodeName} = new Coding\n\t\t{{\n"); sb.Append($"\t\t\tCode = \"{concept.Code}\",\n"); if (!string.IsNullOrEmpty(concept.Display)) { sb.Append($"\t\t\tDisplay = \"{concept.Display.Replace("\"", "\\\"")}\",\n"); } sb.Append($"\t\t\tSystem = \"{systemUrl}\"\n"); sb.Append($"\t\t}};\n"); return(true); }