synthetichealth / synthea

Synthetic Patient Population Simulator
https://synthetichealth.github.io/synthea
Apache License 2.0
2.19k stars 655 forks source link

insuranceExpenses field malformed on json export #1425

Open hchorton opened 8 months ago

hchorton commented 8 months ago

What happened?

When generating a patient and exporting via json format, the coverage.planHistory.insuranceExpenses field appears to be malformed. In every instance, it is either represented with an uneccesary amount of decimal places appended to the end, or is coming as scientific notation.

Attached is an example of a patient that was generated with the malformed fields.

Melissia267_Bambi5_Collins926_414cf344-3bae-0b21-9efd-4780b36b0aa5.json

Environment

- OS: Microsoft Windows 11 Pro, Version 10.0.22621 Build 22621
- Java: java version 18.0.1.1

Relevant log output

No response

hchorton commented 8 months ago

Digging into this a little further, it looks like it has something to do with the payMonthlyPremium function; when the premium price is 0, and the condition for a private non-ACA plan is met, the premium price is multiplied by the employeeContribution and it returns 0E-53. If it returns this amount and doesn't add anything else this is the amount that saves on the json. So probably less malformed and more of a formatting thing.