@Test public void isSupportedValueType() { Assert.assertTrue( utils.isSupportedValueType( "integer" ) ); }
@ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) public boolean isSupportedValueType( @Nonnull Object valueType ) { final ValueType convertedValueType = NameUtils.toEnumValue( ValueType.class, valueType ); switch ( convertedValueType ) { case TEXT: case EMAIL: case LETTER: case ORGANISATION_UNIT: case PHONE_NUMBER: case TRACKER_ASSOCIATE: case URL: case USERNAME: case LONG_TEXT: case INTEGER: case INTEGER_POSITIVE: case INTEGER_NEGATIVE: case INTEGER_ZERO_OR_POSITIVE: case NUMBER: case PERCENTAGE: case UNIT_INTERVAL: case DATETIME: case AGE: case DATE: case TIME: case BOOLEAN: case TRUE_ONLY: return true; } return false; }
AbstractValueTypeDhisToFhirTransformerUtils extends AbstractTransformerUtils implements DhisToFhirTransformerUtils { @ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) public boolean isSupportedValueType( @Nonnull Object valueType ) { final ValueType convertedValueType = NameUtils.toEnumValue( ValueType.class, valueType ); switch ( convertedValueType ) { case TEXT: case EMAIL: case LETTER: case ORGANISATION_UNIT: case PHONE_NUMBER: case TRACKER_ASSOCIATE: case URL: case USERNAME: case LONG_TEXT: case INTEGER: case INTEGER_POSITIVE: case INTEGER_NEGATIVE: case INTEGER_ZERO_OR_POSITIVE: case NUMBER: case PERCENTAGE: case UNIT_INTERVAL: case DATETIME: case AGE: case DATE: case TIME: case BOOLEAN: case TRUE_ONLY: return true; } return false; } }
AbstractValueTypeDhisToFhirTransformerUtils extends AbstractTransformerUtils implements DhisToFhirTransformerUtils { @ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) public boolean isSupportedValueType( @Nonnull Object valueType ) { final ValueType convertedValueType = NameUtils.toEnumValue( ValueType.class, valueType ); switch ( convertedValueType ) { case TEXT: case EMAIL: case LETTER: case ORGANISATION_UNIT: case PHONE_NUMBER: case TRACKER_ASSOCIATE: case URL: case USERNAME: case LONG_TEXT: case INTEGER: case INTEGER_POSITIVE: case INTEGER_NEGATIVE: case INTEGER_ZERO_OR_POSITIVE: case NUMBER: case PERCENTAGE: case UNIT_INTERVAL: case DATETIME: case AGE: case DATE: case TIME: case BOOLEAN: case TRUE_ONLY: return true; } return false; } protected  AbstractValueTypeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); }
AbstractValueTypeDhisToFhirTransformerUtils extends AbstractTransformerUtils implements DhisToFhirTransformerUtils { @ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) public boolean isSupportedValueType( @Nonnull Object valueType ) { final ValueType convertedValueType = NameUtils.toEnumValue( ValueType.class, valueType ); switch ( convertedValueType ) { case TEXT: case EMAIL: case LETTER: case ORGANISATION_UNIT: case PHONE_NUMBER: case TRACKER_ASSOCIATE: case URL: case USERNAME: case LONG_TEXT: case INTEGER: case INTEGER_POSITIVE: case INTEGER_NEGATIVE: case INTEGER_ZERO_OR_POSITIVE: case NUMBER: case PERCENTAGE: case UNIT_INTERVAL: case DATETIME: case AGE: case DATE: case TIME: case BOOLEAN: case TRUE_ONLY: return true; } return false; } protected  AbstractValueTypeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); @Nonnull @Override String getScriptAttrName(); @ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) boolean isSupportedValueType( @Nonnull Object valueType ); @ScriptMethod( description = "Returns the DHIS2 value as FHIR value. The value is converted according to the specified value type.", args = { @ScriptMethodArg( value = "dhisValue", description = "The DHIS2 typed value." ), @ScriptMethodArg( value = "valueType", description = "The DHIS2 value from which the FHIR value should be converted." ), @ScriptMethodArg( value = "optionSet", description = "The DHIS2 option when the code belongs to a DHIS2 option set." ) }, returnDescription = "The DHIS2 value as FHIR value converted to a FHIR datatype." ) @Nullable IBaseDatatype convert( @Nullable Object dhisValue, @Nonnull Object valueType, @Nullable OptionSet optionSet ); }
AbstractValueTypeDhisToFhirTransformerUtils extends AbstractTransformerUtils implements DhisToFhirTransformerUtils { @ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) public boolean isSupportedValueType( @Nonnull Object valueType ) { final ValueType convertedValueType = NameUtils.toEnumValue( ValueType.class, valueType ); switch ( convertedValueType ) { case TEXT: case EMAIL: case LETTER: case ORGANISATION_UNIT: case PHONE_NUMBER: case TRACKER_ASSOCIATE: case URL: case USERNAME: case LONG_TEXT: case INTEGER: case INTEGER_POSITIVE: case INTEGER_NEGATIVE: case INTEGER_ZERO_OR_POSITIVE: case NUMBER: case PERCENTAGE: case UNIT_INTERVAL: case DATETIME: case AGE: case DATE: case TIME: case BOOLEAN: case TRUE_ONLY: return true; } return false; } protected  AbstractValueTypeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull ValueConverter valueConverter ); @Nonnull @Override String getScriptAttrName(); @ScriptMethod( description = "Returns if the specified DHIS2 value type is supported.", args = @ScriptMethodArg( value = "valueType", description = "The DHIS2 value type that should be checked." ), returnDescription = "A boolean value that indicates if the value is supported." ) boolean isSupportedValueType( @Nonnull Object valueType ); @ScriptMethod( description = "Returns the DHIS2 value as FHIR value. The value is converted according to the specified value type.", args = { @ScriptMethodArg( value = "dhisValue", description = "The DHIS2 typed value." ), @ScriptMethodArg( value = "valueType", description = "The DHIS2 value from which the FHIR value should be converted." ), @ScriptMethodArg( value = "optionSet", description = "The DHIS2 option when the code belongs to a DHIS2 option set." ) }, returnDescription = "The DHIS2 value as FHIR value converted to a FHIR datatype." ) @Nullable IBaseDatatype convert( @Nullable Object dhisValue, @Nonnull Object valueType, @Nullable OptionSet optionSet ); static final String SCRIPT_ATTR_NAME; }