Class FhirUtils
A fhir utilities.
Inheritance
Namespace: Microsoft.Health.Fhir.CodeGenCommon.Models
Assembly: Microsoft.Health.Fhir.CodeGenCommon.dll
Syntax
public abstract class FhirUtils : object
Fields
| Improve this Doc View SourceDefinitionalResourceNames
Declaration
public static readonly Dictionary<string, string> DefinitionalResourceNames
Field Value
Type | Description |
---|---|
Dictionary<System. |
ReplacementsPascal
(Immutable) The pascal.
Declaration
public static readonly Dictionary<char[], string> ReplacementsPascal
Field Value
Type | Description |
---|---|
Dictionary<System. |
ReplacementsWithUnderscores
(Immutable) The underscore.
Declaration
public static readonly Dictionary<char[], string> ReplacementsWithUnderscores
Field Value
Type | Description |
---|---|
Dictionary<System. |
Methods
| Improve this Doc View SourceSanitizedToConvention(String, FhirTypeBase.NamingConvention)
Sanitized to convention.
Declaration
public static string SanitizedToConvention(string sanitized, FhirTypeBase.NamingConvention convention)
Parameters
Type | Name | Description |
---|---|---|
System. |
sanitized | The sanitized. |
Fhir |
convention | The convention. |
Returns
Type | Description |
---|---|
System. |
A string. |
SanitizeForCode(String, HashSet<String>, out String, out String)
Sanitize for code.
Declaration
public static void SanitizeForCode(string input, HashSet<string> reservedWords, out string name, out string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
input | The input. |
Hash |
reservedWords | The reserved words. |
System. |
name | [out] The sanitized name for the code. |
System. |
value | [out] The sanitized value for the code. |
SanitizeForProperty(String, HashSet<String>, FhirTypeBase.NamingConvention, Dictionary<Char[], String>, Boolean)
Sanitize for property.
Declaration
public static string SanitizeForProperty(string value, HashSet<string> reservedWords, FhirTypeBase.NamingConvention convertToConvention = FhirTypeBase.NamingConvention.None, Dictionary<char[], string> replacements = null, bool checkForGmt = false)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value. |
Hash |
reservedWords | The reserved words. |
Fhir |
convertToConvention | |
Dictionary<System. |
replacements | (Optional) The replacements. |
System. |
checkForGmt | (Optional) True to check for GMT. |
Returns
Type | Description |
---|---|
System. |
A string. |
SanitizeForQuoted(String, Boolean, Boolean)
Sanitize for quoted.
Declaration
public static string SanitizeForQuoted(string input, bool escapeToHtml = false, bool condenseWhitespace = false)
Parameters
Type | Name | Description |
---|---|---|
System. |
input | |
System. |
escapeToHtml | (Optional) The input. |
System. |
condenseWhitespace | (Optional) True to condense whitespace. |
Returns
Type | Description |
---|---|
System. |
A string. |
SanitizeForValue(String)
Sanitize for value.
Declaration
public static string SanitizeForValue(string input)
Parameters
Type | Name | Description |
---|---|---|
System. |
input | The input. |
Returns
Type | Description |
---|---|
System. |
A string. |
SanitizeToAscii(String)
Sanitize to Printable ASCII.
Declaration
public static string SanitizeToAscii(string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value. |
Returns
Type | Description |
---|---|
System. |
A string. |
ToConvention(String, String, FhirTypeBase.NamingConvention, Boolean, String, HashSet<String>)
Converts this object to a convention.
Declaration
public static string ToConvention(string name, string path, FhirTypeBase.NamingConvention convention, bool concatenatePath = false, string concatenationDelimiter = "", HashSet<string> reservedWords = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The value. |
System. |
path | Full pathname of the file. |
Fhir |
convention | The convention. |
System. |
concatenatePath | (Optional) True to concatenate path. |
System. |
concatenationDelimiter | (Optional) The concatenation delimiter. |
Hash |
reservedWords | (Optional) The reserved words. |
Returns
Type | Description |
---|---|
System. |
The given data converted to a string. |