Improve Date Time support and _lastUpdated behavior #255 #258 #437#506
Improve Date Time support and _lastUpdated behavior #255 #258 #437#506
Conversation
- Update the ParameterValue to use Instants versus DateTime - Add Lower and Upper Bound value and the original value - Update the Parameter toString to reflect the use of Instant and serialize it properly - Introduce DateTimeHandler to properly parse and test the parsing of dates/times, and add DateTimeHandlerTest - Supports yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm] defined in spec - Supports microseconds - Supports TimeZones in Textual Format and +/- HH:MM - Also ZonedDateTime / LocalDateTime have granular precision for lower and upper bounds - Update SearchUtil from DateTime.Builder to DateTimeHandler.Parser to use TemporalAccesors - Update SearchExceptionUtil to support a DateTime Format Exception - Add tests for the various Parsing successes and failures. - Introduce DateParmBehaviorUtil to treat date/time ranges based on the level of precision in the passed time parameter - Add Tests to support the DateParmBehaviorUtil - Refactor JDBCQueryBuilder to break out Date Behaviors into the utility - Update Precision to 1000 nanos (we're up to 6 places of precision on the second) - Change DerbyMaster to log values from a static final Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- refactored _lastUpdated Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- Merge with master - Remove unused StringParmVal from ResourceDAO.java - Update FHIRPersistenceEvent to use non-deprecated API isStandardType from FHIRUtil Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
|
Are you still planning to tests in AbstractSearchDateTest? We had listed that as acceptance criteria for #437 |
No, this class is somewhat final. |
- Update the behavior for _lastUpdated treatment - Change DEBUGGING to DEBUG for DerbyMaster - Update a href quoting on DateParmBehaviorUtil and LastUpdatedParmBehaviorUtil - Warning found in ValueTypesR4Impl, and refactored to support the special parameter 'near' and the Location.Position - convert compareTo to equals for review Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- logging - Query Updates to limit the time it takes to run by using covered indices. Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- change to use min and max timestamps as defined in the local timezone and are translatable to UTC Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
|
The latest commits as of 7:47 bring the code up to the level that is in master, and further enhance the support for lower bound and upperbound timestamps. |
- refactor the _lastUpdated - SUM/COUNT Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- turn off logging in the PR Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- lastUpdated is implemented - Remove bad formatting (spaces at end of lines) Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- Remove AbstractJDBCQueryBuilder and JDBCQueryBuilder getPrefix from Interface and Impl - Refactor NumberParmBehaviorUtil per JDBCOperator removal - Refactor DateParmBehaviorUtil per JDBCOperator removal - Refactor DateParmBehaviorUtilTest to remove UTC/Z formatting issues in the tests - Refactor DateTimeHandlerTest to remove UTC/Z formatting issues in tests - Refactor DateTimeHandler to remove unused unit and simplify code - Add test for LastUpdatedParmBehaviorUtilTest - Refactor LastUpdatedParmBehaviorUtil to remove references to JDBCOperator - Refactor SortedQuerySegmentAggregator to simplify Constants and JDBCOperators - Refactor UriModifierUtil / UriModifierUtilTest to simplify constants and JDBCConstants and JDBCOperators - Refactor JDBCConstants remove JDBCOperators and the prefix map - Refactor QuantityParmBehaviorUtil and LocationParmBehaviorUtil to simplify SQL operators. - Refactor out JDBCOperator from AbstractQueryBuilder / JDBCQueryBuilder - Refactor InclusionQuerySegmentAggregator / QuerySegmentAggregator query segments - Refactor CacheUtilTest to keep from printing useless output (added assertNotNull) - Tune down logging to FINE only (and reset minimum level to FINE) - Update JDBCParameterBuildingVisitor to reflect UTC - Update AbstractSearchDateTest to reflect UTC changes and more accurate precision - Resolve DateTimeHandler with Z test issues Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
- Add missing tests in testng.xml - Remove references to Timezone - Update DateTimeHandler - Update logging properties Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
| */ | ||
| public static Timestamp convertToTimestamp(java.time.ZonedDateTime zdt) { | ||
| return new Timestamp(zdt.toInstant().toEpochMilli()); | ||
| return Timestamp.from(zdt.withZoneSameInstant(ZoneId.of("UTC")).toInstant()); |
There was a problem hiding this comment.
This one still confuses me. An Instant doesn't have a timezone, so why do we need to convert the ZonedDateTime to UTC before calling toInstant?
There was a problem hiding this comment.
this step ensures it is UTC. when it's converted to an instant
There was a problem hiding this comment.
Instant = 1576849840146
Converted to Timestamp
Fri Dec 20 2019 13:51:08
however that instant is actually the time EST
so we need to adjust UP
Instant = 1576859840146
Fri Dec 20 2019 16:37:20
Now, it's actually in UTC (edited)
and serialize it properly
dates/times, and add DateTimeHandlerTest
and upper bounds
use TemporalAccesors
level of precision in the passed time parameter
the second)
Signed-off-by: Paul Bastide pbastide@us.ibm.com