MeasureAuthoringTool / health-data-standards

https://rubygems.org/gems/health-data-standards
Apache License 2.0
94 stars 93 forks source link

CDA extract_scalar doesnt play nice with floats #250

Open Wylan opened 9 years ago

Wylan commented 9 years ago

I recently noticed that when importing sections that have a scalar unit (such as the dosage for a medication) that the value is being converted to an integer.

It looks like the culprit is the to_i on line 193 of lib/health-data-standards/import/cda/section_importer.rb.

{'unit' => scalar_element['unit'], 'value' => scalar_element['value'].to_i}

Will it break anything if we change this to to_f instead?

okeefm commented 9 years ago

I ran a few tests, and it doesn't look like this should break anything. I'll bring it up to some of the other developers.