Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cel/K conversion fails #7

Open
kennethmyhra opened this issue Oct 27, 2018 · 0 comments
Open

Cel/K conversion fails #7

kennethmyhra opened this issue Oct 27, 2018 · 0 comments

Comments

@kennethmyhra
Copy link

I am trying to convert Celsius to its base unit Kelvin using the following code:

SystemOfUnits system = UCUM.Load();
Quantity quantity = new Quantity(39m, system.Metric("Cel"));
quantity = system.Canonical(quantity);

But it fails with the exception "Quantity could not be converted to base units" on the method call system.Canonical.

Debugging Fhir.Metrics I see that an exception is thrown on the following line UcumReader.cs#L132 since the unit definition in ucum-essence.xml#L311 is deviating a bit from the other unit definitions, lacking the value attribute on the node unit/value, maybe by design. Still the conversion is not loaded into memory, as far as I can see, because of the exception.

kennethmyhra added a commit to kennethmyhra/spark that referenced this issue Oct 28, 2018
* A temporarily workaround for converting Celsius to Kelvin
* Note: internal searchindex stores all UCUM units in its base unit
* See: FirelyTeam/Fhir.Metrics#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant