FHIR Chat · Mapping Enum Values · dotnet

Stream: dotnet

Topic: Mapping Enum Values


view this post on Zulip Stephen Lloyd (Apr 20 2018 at 13:48):

Hi,

Just wondering if there's an elegant way of us handling converting any specification defined enum values (such as http://hl7.org/fhir/ValueSet/action-grouping-behavior "visual-group" to ActionGroupingBehavior.VisualGroup)? Is it safe to assume that I can just parse my "spec-compliant" input data and create an enum value by removing the hypens, or is there other characters in the specification that might catch me out?

Thanks,
Stephen

view this post on Zulip Brian Postlethwaite (Apr 24 2018 at 01:16):

Assuming you mean the ones that have a generated enum, there is a function that does this in the project

Hl7.Fhir.Model.AdministrativeGender? gender = EnumUtility.ParseLiteral<Hl7.Fhir.Model.AdministrativeGender>("male");

view this post on Zulip Stephen Lloyd (May 01 2018 at 15:24):

@Brian Postlethwaite That look like just the thing, thanks a lot.


Last updated: Apr 12 2022 at 19:14 UTC