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
Is your feature request related to a problem? Please describe. 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
Describe the solution you'd like
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 solution to adapt the FhirJsonSerializer to handle this scenario ?
Describe alternatives you've considered
Storing integer values as "Integer" instead of "Quantity" but the issue is that the fhir Integer resource does not have some fields such as a "unit".
Creating a custom JsonFhirFormatter that doesn't rely on the FhirJsonSerializer
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
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
![image](https://private-user-images.githubusercontent.com/8789213/241953331-896bac13-c430-4737-b64e-ee565111330a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2Mjc1MjEsIm5iZiI6MTcyMTYyNzIyMSwicGF0aCI6Ii84Nzg5MjEzLzI0MTk1MzMzMS04OTZiYWMxMy1jNDMwLTQ3MzctYjY0ZS1lZTU2NTExMTMzMGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNy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ZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Gvb6s0j38EdvFOipm00HjnFKnnGg0kwAvX7IlKBIQ60)
JSON output
Describe the solution you'd like
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 solution to adapt the FhirJsonSerializer to handle this scenario ?
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: