@Test public void isValidNowEndPast() { Assert.assertFalse( utils.isValidNow( new Period().setEnd( Date.from( ZonedDateTime.now().minusDays( 2 ).toInstant() ) ) ) ); }
@Override public boolean isValidNow( @Nullable ICompositeType period ) { if ( period == null ) { return true; } final Period p = (Period) period; final Date now = new Date(); return (p.getEnd() == null) || !now.after( p.getEnd() ); }
Dstu3DateTimeFhirToDhisTransformerUtils extends AbstractDateTimeFhirToDhisTransformerUtils { @Override public boolean isValidNow( @Nullable ICompositeType period ) { if ( period == null ) { return true; } final Period p = (Period) period; final Date now = new Date(); return (p.getEnd() == null) || !now.after( p.getEnd() ); } }
Dstu3DateTimeFhirToDhisTransformerUtils extends AbstractDateTimeFhirToDhisTransformerUtils { @Override public boolean isValidNow( @Nullable ICompositeType period ) { if ( period == null ) { return true; } final Period p = (Period) period; final Date now = new Date(); return (p.getEnd() == null) || !now.after( p.getEnd() ); } Dstu3DateTimeFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); }
Dstu3DateTimeFhirToDhisTransformerUtils extends AbstractDateTimeFhirToDhisTransformerUtils { @Override public boolean isValidNow( @Nullable ICompositeType period ) { if ( period == null ) { return true; } final Period p = (Period) period; final Date now = new Date(); return (p.getEnd() == null) || !now.after( p.getEnd() ); } Dstu3DateTimeFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override boolean hasDayPrecision( @Nullable IPrimitiveType<Date> dateTime ); @Override boolean isValidNow( @Nullable ICompositeType period ); }
Dstu3DateTimeFhirToDhisTransformerUtils extends AbstractDateTimeFhirToDhisTransformerUtils { @Override public boolean isValidNow( @Nullable ICompositeType period ) { if ( period == null ) { return true; } final Period p = (Period) period; final Date now = new Date(); return (p.getEnd() == null) || !now.after( p.getEnd() ); } Dstu3DateTimeFhirToDhisTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Override boolean hasDayPrecision( @Nullable IPrimitiveType<Date> dateTime ); @Override boolean isValidNow( @Nullable ICompositeType period );  }