cql_runner icon indicating copy to clipboard operation
cql_runner copied to clipboard

Unit conversion support

Open drthyl opened this issue 4 years ago • 0 comments

Does CQL runner support unit conversion? We expected an output of 'mg/d' unit for "Product" but the return is 'mL'. Thank you!

define "MedicationStrength":
  System.Quantity {value: 0.25, unit: 'mg/mL'}
    
define "Supply":
  System.Quantity {value: 15, unit: 'mL'}
    
define "DaysSupplied":
  System.Quantity {value: 29, unit: 'd'}
    
define "Product":
    ("Supply" * "MedicationStrength")/"DaysSupplied"
>> MedicationDose [1:1] 0.25 'mg/mL'
>> Supply [4:1] 15 'mL'
>> DaysSupplied [7:1] 29 'd'
>> Product [10:1] 0.12931034 'mL'

drthyl avatar Dec 20 '21 20:12 drthyl