Show / Hide Table of Contents

Class FhirEnumExtensions

A FHIR enum extensions.

Inheritance
System.Object
FhirEnumExtensions
Namespace: Microsoft.Health.Fhir.CodeGenCommon.Extensions
Assembly: Microsoft.Health.Fhir.CodeGenCommon.dll
Syntax
public static class FhirEnumExtensions : object

Methods

| Improve this Doc View Source

ParseFhir<T>(String)

A Type extension method that parses a FHIR string literal to a FHIR-Literal tagged enum value.

Declaration
public static T ParseFhir<T>(string literal)
    where T : struct
Parameters
Type Name Description
System.String literal

The literal.

Returns
Type Description
T

An Enum.

Type Parameters
Name Description
T

Generic type parameter.

| Improve this Doc View Source

ToFhirEnum<T>(String)

A string extension method that converts a FHIR string literal to a FHIR-Literal tagged enum value.

Declaration
public static T ToFhirEnum<T>(this string literal)
    where T : struct
Parameters
Type Name Description
System.String literal

The literal.

Returns
Type Description
T

Literal as an Enum.

Type Parameters
Name Description
T

Generic type parameter.

| Improve this Doc View Source

ToLiteral(Enum)

An Enum extension method that converts a value to a literal.

Declaration
public static string ToLiteral(this Enum fhirEnum)
Parameters
Type Name Description
Enum fhirEnum

The fhirEnumValue to act on.

Returns
Type Description
System.String

Value as a string.

| Improve this Doc View Source

TryFhirEnum<T>(IEnumerable<String>, out IEnumerable<T>)

A string extension method that attempts to to FHIR enum a T from the given string.

Declaration
public static bool TryFhirEnum<T>(this IEnumerable<string> source, out IEnumerable<T> values)
    where T : struct
Parameters
Type Name Description
IEnumerable<System.String> source

The source to act on.

IEnumerable<T> values

[out] The values.

Returns
Type Description
System.Boolean

True if it succeeds, false if it fails.

Type Parameters
Name Description
T

Generic type parameter.

| Improve this Doc View Source

TryFhirEnum<T>(String, out T)

A string extension method that attempts to to FHIR enum a T from the given string.

Declaration
public static bool TryFhirEnum<T>(this string literal, out T value)
    where T : struct
Parameters
Type Name Description
System.String literal

The literal.

T value

[out] The value.

Returns
Type Description
System.Boolean

True if it succeeds, false if it fails.

Type Parameters
Name Description
T

Generic type parameter.

| Improve this Doc View Source

TryParseFhir<T>(String, out T)

A Type extension method that attempts to parse a FHIR string literal to a FHIR-Literal tagged enum value.

Declaration
public static bool TryParseFhir<T>(string literal, out T value)
    where T : struct
Parameters
Type Name Description
System.String literal

The literal.

T value

[out] The value.

Returns
Type Description
System.Boolean

True if it succeeds, false if it fails.

Type Parameters
Name Description
T

Generic type parameter.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX