class R4AddressFhirToDhisTransformerUtils extends AbstractAddressFhirToDhisTransformerUtils {

    @Nullable
    @Override
    public String getConstructedText( @Nullable ICompositeType address, @Nonnull String delimiter )
    {
        final Address convertedAddress = (Address) address;
        if ( address == null )
        {
            return null;
        }

        final StringBuilder sb = new StringBuilder();
        convertedAddress.getLine().stream().filter( l -> (l != null) && StringUtils.isNotBlank( l.getValue() ) )
            .forEach( l -> sb.append( delimiter ).append( l.getValue() ) );
        if ( StringUtils.isNotBlank( convertedAddress.getPostalCode() ) && StringUtils.isNotBlank( convertedAddress.getCity() ) )
        {
            sb.append( delimiter ).append( convertedAddress.getPostalCode() ).append( ' ' ).append( convertedAddress.getCity() );
        }
        else if ( StringUtils.isNotBlank( convertedAddress.getPostalCode() ) )
        {
            sb.append( delimiter ).append( convertedAddress.getPostalCode() );
        }
        else if ( StringUtils.isNotBlank( convertedAddress.getCity() ) )
        {
            sb.append( delimiter ).append( convertedAddress.getCity() );
        }
        if ( StringUtils.isNotBlank( convertedAddress.getState() ) )
        {
            sb.append( delimiter ).append( convertedAddress.getState() );
        }
        if ( sb.length() == 0 )
        {
            return convertedAddress.getText();
        }
        return sb.substring( delimiter.length() );
    }

    public  R4AddressFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext, @Nonnull R4DateTimeFhirToDhisTransformerUtils dateTimeTransformerUtils );

}