Skip to content

Quantity comparisons for "unconvertible" units when they are the same #350

@hossenlopp

Description

@hossenlopp

A recent fqm-execution issue (#352)[https://github.com/projecttacoma/fqm-execution/issues/352]. Uncovered an issue with comparison of unconvertible units in a GreaterOrEqual comparison of Quantity for [IU]/mL. ex logic:

Dalteparin.dosage ( ) >= 10000 '[IU]/mL'

The result of Datleparin.dosage ( ) is a Quantity 10000 '[IU]/mL'. It seems like this logic should result in true for the comparison, but it results in null. On deeper inspection this is occurring because the comparison logic for Quantity in the engine is converting the units even though they are the "same". The UCUM library we use refuses to convert [IU]/mL to [IU]/mL with the response "Attempt to convert arbitrary unit international unit per milliliter". This appears to be considered arbitrary because [IU] is different depending on the chemical.

This raises two questions?

  • Is this actually correct that it should throw a fit here and return null for this Quantity comparison of [IU]/mL to [IU]/mL?
  • Should Quantity comparisons of the same exact unit actually skip past the conversion stop?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions