use of org.hl7.fhir.r5.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.
the class MeasureEvaluatorTest method createMeasureParameter.
private Extension createMeasureParameter(String name, Type defaultValue) {
Extension measureParameter = new Extension();
measureParameter.setUrl(MEASURE_PARAMETER_URL);
ParameterDefinition parameterDefinition = new ParameterDefinition();
parameterDefinition.setName(name);
measureParameter.setValue(parameterDefinition);
Extension defaultValueExtension = new Extension();
defaultValueExtension.setUrl(PARAMETER_DEFAULT_URL);
defaultValueExtension.setValue(defaultValue);
parameterDefinition.addExtension(defaultValueExtension);
return measureParameter;
}
use of org.hl7.fhir.r5.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testString__shouldReturnStringParameter.
@Test
public void testString__shouldReturnStringParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("string");
String expectedValue = "data";
StringType fhirValue = new StringType(expectedValue);
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
assertEquals(new StringParameter(expectedValue), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
use of org.hl7.fhir.r5.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testPeriod__shouldReturnIntervalParameterOfDateTimeParameter.
@Test
public void testPeriod__shouldReturnIntervalParameterOfDateTimeParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("Period");
Period fhirValue = new Period();
fhirValue.setStartElement(new DateTimeType("2020-01-01T12:00:00.0"));
fhirValue.setEndElement(new DateTimeType("2020-02-04T11:00:00.0-05:00"));
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
IntervalParameter expectedParameter = new IntervalParameter(new DatetimeParameter("2020-01-01T12:00:00.0"), true, new DatetimeParameter("2020-02-04T11:00:00.0-05:00"), true);
assertEquals(expectedParameter, R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
use of org.hl7.fhir.r5.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testBase64Binary__shouldReturnStringParameter.
@Test
public void testBase64Binary__shouldReturnStringParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("base64Binary");
String base64String = "AAA";
Base64BinaryType fhirValue = new Base64BinaryType(base64String);
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
assertEquals(new StringParameter(base64String), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
use of org.hl7.fhir.r5.model.ParameterDefinition in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testInstant__shouldReturnDateTimeParameter.
@Test
public void testInstant__shouldReturnDateTimeParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("instant");
String instantString = "2020-01-01T12:30:00.0Z";
InstantType fhirValue = new InstantType(instantString);
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
assertEquals(new DatetimeParameter(instantString), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
Aggregations