FHIR Chat · FHIR data types · dotnet

Stream: dotnet

Topic: FHIR data types


view this post on Zulip Dennis Brox (Feb 18 2022 at 01:39):

It appears that though the FHIR Datatype Specification does indicate primitive type names are lowercase, the .NET SDK conforms with Microsoft's C# Coding Conventions and Naming Conventions which results in the fields being representated in TitleCase. As Firely's .NET SDK doesn't explicitely define any BsonDiscriminators to indicate how values should be serialized/deserialized the default representation is what is used instead, which would be the TitleCase representation of the values. Firely appears to be look for camelCase representations of types which doesn't match what the MongoDB C# Driver is serializing the values to. As such, unless a Python program is converting from TitleCase to camelCase , mapping won't work either.

Is there anyway I can convert a class to camelCase in SDK?

view this post on Zulip Brian Postlethwaite (Feb 18 2022 at 02:06):

The SDK has specific serializer classes that handle all those translations to/from XML and json (as these representations are slightly different, which means the one model couldn't be used to do both at the same time)

view this post on Zulip Dennis Brox (Feb 18 2022 at 06:59):

I understand if you convert case you can't serialize but with object data bases like Mongo and probably Cosmos you write the class directly to the database and that has to be done in camelCase. I can do that conversion myself but it is tricky because I don't have the source code and don't know what wrinkles like _names, acronyms, or whatever that have to be allowed for. You must be converting from camelCase to TitleCase when you deserialize . I assume there are lots of people using C# to Mongo where the reverse is necessary. As an aside, I don't know why a Microsoft standard overrides a FHIR standard when the whole object of the library is to provide the latter.

view this post on Zulip Brian Postlethwaite (Feb 18 2022 at 22:27):

You coukd take a look at the source for the spark fhir server on github that has implemented storage using mongodb to see how they did it.

view this post on Zulip Gino Canessa (Feb 22 2022 at 16:45):

Also note that there are pretty significant changes to the serializers/parsers in the 4.0 branches (currently in beta). I have a todo on my list to work through this type of use-case, but it is a long list =).


Last updated: Apr 12 2022 at 19:14 UTC