Search in sources :

Example 6 with ParameterDefinition

use of org.hl7.fhir.r4b.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.

the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testAttachment__shouldThrowException.

@Test(expected = UnsupportedFhirTypeException.class)
public void testAttachment__shouldThrowException() {
    ParameterDefinition parameterDefinition = getBaseParameterDefinition("Attachment");
    Attachment fhirValue = new Attachment();
    parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
    R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition);
}
Also used : Attachment(org.hl7.fhir.r4.model.Attachment) ParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition) Test(org.junit.Test)

Example 7 with ParameterDefinition

use of org.hl7.fhir.r4b.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.

the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testTime__shouldReturnTimeParameter.

@Test
public void testTime__shouldReturnTimeParameter() {
    ParameterDefinition parameterDefinition = getBaseParameterDefinition("time");
    String timeString = "12:30:00";
    TimeType fhirValue = new TimeType(timeString);
    parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
    assertEquals(new TimeParameter(timeString), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
Also used : TimeParameter(com.ibm.cohort.cql.evaluation.parameters.TimeParameter) ParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition) DateTimeType(org.hl7.fhir.r4.model.DateTimeType) TimeType(org.hl7.fhir.r4.model.TimeType) Test(org.junit.Test)

Example 8 with ParameterDefinition

use of org.hl7.fhir.r4b.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.

the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testDate__shouldReturnDate.

@Test
public void testDate__shouldReturnDate() {
    ParameterDefinition parameterDefinition = getBaseParameterDefinition("date");
    String dateString = "2020-01-01";
    DateType fhirValue = new DateType(dateString);
    parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
    assertEquals(new DateParameter(dateString), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
Also used : DateParameter(com.ibm.cohort.cql.evaluation.parameters.DateParameter) DateType(org.hl7.fhir.r4.model.DateType) ParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition) Test(org.junit.Test)

Example 9 with ParameterDefinition

use of org.hl7.fhir.r4b.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.

the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testAnnotation__shouldThrowException.

@Test(expected = UnsupportedFhirTypeException.class)
public void testAnnotation__shouldThrowException() {
    ParameterDefinition parameterDefinition = getBaseParameterDefinition("Annotation");
    Annotation fhirValue = new Annotation();
    parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
    R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition);
}
Also used : Annotation(org.hl7.fhir.r4.model.Annotation) ParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition) Test(org.junit.Test)

Example 10 with ParameterDefinition

use of org.hl7.fhir.r4b.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.

the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testBoolean__shouldReturnBooleanParameter.

@Test
public void testBoolean__shouldReturnBooleanParameter() {
    ParameterDefinition parameterDefinition = getBaseParameterDefinition("boolean");
    BooleanType fhirValue = new BooleanType(true);
    parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
    assertEquals(new BooleanParameter(true), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
Also used : BooleanType(org.hl7.fhir.r4.model.BooleanType) BooleanParameter(com.ibm.cohort.cql.evaluation.parameters.BooleanParameter) ParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition) Test(org.junit.Test)

Aggregations

ParameterDefinition (org.hl7.fhir.r4.model.ParameterDefinition)32 Test (org.junit.Test)26 Extension (org.hl7.fhir.r4.model.Extension)14 DatetimeParameter (com.ibm.cohort.cql.evaluation.parameters.DatetimeParameter)9 ArrayList (java.util.ArrayList)9 DateTimeType (org.hl7.fhir.r4.model.DateTimeType)9 QuantityParameter (com.ibm.cohort.cql.evaluation.parameters.QuantityParameter)8 StringParameter (com.ibm.cohort.cql.evaluation.parameters.StringParameter)8 Quantity (org.hl7.fhir.r4.model.Quantity)8 Range (org.hl7.fhir.r4.model.Range)8 CodeParameter (com.ibm.cohort.cql.evaluation.parameters.CodeParameter)7 IntervalParameter (com.ibm.cohort.cql.evaluation.parameters.IntervalParameter)7 Period (org.hl7.fhir.r4.model.Period)7 BooleanParameter (com.ibm.cohort.cql.evaluation.parameters.BooleanParameter)6 ConceptParameter (com.ibm.cohort.cql.evaluation.parameters.ConceptParameter)6 DateParameter (com.ibm.cohort.cql.evaluation.parameters.DateParameter)6 DecimalParameter (com.ibm.cohort.cql.evaluation.parameters.DecimalParameter)6 IntegerParameter (com.ibm.cohort.cql.evaluation.parameters.IntegerParameter)6 RatioParameter (com.ibm.cohort.cql.evaluation.parameters.RatioParameter)6 TimeParameter (com.ibm.cohort.cql.evaluation.parameters.TimeParameter)6