@Test public void getDateTimeElementDate() { final Date date = new Date(); Assert.assertEquals( new DateTimeType( date, TemporalPrecisionEnum.MILLI ).getValueAsString(), Objects.requireNonNull( utils.getDateTimeElement( date ) ).getValueAsString() ); }
@Nullable @Override public IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ) { final LocalDateTime date = castDateTime( dateTime ); if ( date == null ) { return null; } return new DateTimeType( Date.from( date.atZone( zoneId ).toInstant() ), TemporalPrecisionEnum.MILLI ); }
R4DateTimeDhisToFhirTransformerUtils extends AbstractDateTimeDhisToFhirTransformerUtils { @Nullable @Override public IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ) { final LocalDateTime date = castDateTime( dateTime ); if ( date == null ) { return null; } return new DateTimeType( Date.from( date.atZone( zoneId ).toInstant() ), TemporalPrecisionEnum.MILLI ); } }
R4DateTimeDhisToFhirTransformerUtils extends AbstractDateTimeDhisToFhirTransformerUtils { @Nullable @Override public IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ) { final LocalDateTime date = castDateTime( dateTime ); if ( date == null ) { return null; } return new DateTimeType( Date.from( date.atZone( zoneId ).toInstant() ), TemporalPrecisionEnum.MILLI ); } R4DateTimeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); }
R4DateTimeDhisToFhirTransformerUtils extends AbstractDateTimeDhisToFhirTransformerUtils { @Nullable @Override public IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ) { final LocalDateTime date = castDateTime( dateTime ); if ( date == null ) { return null; } return new DateTimeType( Date.from( date.atZone( zoneId ).toInstant() ), TemporalPrecisionEnum.MILLI ); } R4DateTimeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nullable @Override IPrimitiveType<Date> getPreciseDateElement( @Nullable Object dateTime ); @Nullable @Override IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ); @Nullable @Override IPrimitiveType<Date> getDayDateTimeElement( @Nullable Object dateTime ); }
R4DateTimeDhisToFhirTransformerUtils extends AbstractDateTimeDhisToFhirTransformerUtils { @Nullable @Override public IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ) { final LocalDateTime date = castDateTime( dateTime ); if ( date == null ) { return null; } return new DateTimeType( Date.from( date.atZone( zoneId ).toInstant() ), TemporalPrecisionEnum.MILLI ); } R4DateTimeDhisToFhirTransformerUtils( @Nonnull ScriptExecutionContext scriptExecutionContext ); @Nonnull @Override Set<FhirVersion> getFhirVersions(); @Nullable @Override IPrimitiveType<Date> getPreciseDateElement( @Nullable Object dateTime ); @Nullable @Override IPrimitiveType<Date> getDateTimeElement( @Nullable Object dateTime ); @Nullable @Override IPrimitiveType<Date> getDayDateTimeElement( @Nullable Object dateTime );  }