You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is related to this issue. The goal was to be able to output round decimal value as integer for "Quantity" (ie. "400.0" should be presented as "400").
The solution of implementing a custom "BsonDecimalSerializer " works to format the decimal value as an integer when we get it from the Mongo DB.
While it works as intended when we get the final output as an XML, we still have an issue when we want to get the result as a JSON because the "FhirJsonSerializer" that is used to produce it adds the ".0" again.
XML output
JSON output
A solution would be to add a custom JSON converter for decimal values (like this), but I couldn't find a way of adding a custom converter to the FhirJsonSerializer.
Is there a way to adapt the FhirJsonSerializer to handle this scenario ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It is related to this issue. The goal was to be able to output round decimal value as integer for "Quantity" (ie. "400.0" should be presented as "400").
The solution of implementing a custom "BsonDecimalSerializer " works to format the decimal value as an integer when we get it from the Mongo DB.
While it works as intended when we get the final output as an XML, we still have an issue when we want to get the result as a JSON because the "FhirJsonSerializer" that is used to produce it adds the ".0" again.
XML output
JSON output
A solution would be to add a custom JSON converter for decimal values (like this), but I couldn't find a way of adding a custom converter to the FhirJsonSerializer.
Is there a way to adapt the FhirJsonSerializer to handle this scenario ?
Beta Was this translation helpful? Give feedback.
All reactions