Search in sources :

Example 6 with Quantity

use of org.opencds.cqf.cql.engine.runtime.Quantity in project quality-measure-and-cohort-service by Alvearie.

the class SparkTypeConverterTest method testToSparkRatio.

@Test
public void testToSparkRatio() {
    Ratio ratio = new Ratio().setNumerator(new Quantity().withValue(new BigDecimal(1.2)).withUnit("mg/mL")).setDenominator(new Quantity().withValue(new BigDecimal(5.9)).withUnit("mg/mL"));
    Object converted = typeConverter.toSparkRatio(ratio);
    assertTrue(converted instanceof scala.collection.Map);
}
Also used : Quantity(org.opencds.cqf.cql.engine.runtime.Quantity) Ratio(org.opencds.cqf.cql.engine.runtime.Ratio) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Aggregations

Quantity (org.opencds.cqf.cql.engine.runtime.Quantity)6 BigDecimal (java.math.BigDecimal)4 Test (org.junit.Test)4 IBaseDatatype (org.hl7.fhir.instance.model.api.IBaseDatatype)2 Ratio (org.opencds.cqf.cql.engine.runtime.Ratio)2 HashMap (java.util.HashMap)1 Period (org.hl7.fhir.r4.model.Period)1 Range (org.hl7.fhir.r4.model.Range)1 DateTime (org.opencds.cqf.cql.engine.runtime.DateTime)1 Interval (org.opencds.cqf.cql.engine.runtime.Interval)1