-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle timezones in bulk uploader and Fhir converter #5985
Conversation
e9e126b
to
e1d4e6a
Compare
Use Z for system timestamps with setTimeZoneZulu
72cec4e
to
4fa2b6d
Compare
Created a new issue to track the time zone work specifically of referring to the bulk uploader test coverage issue. #6025 Will push some additional changes based on this soon |
… into Mike/5844-handle-fhir-timezones
@mpbrown are the datetime format requirements from the ticket up-to-date? If so, I'm encountering a problem with (at least) the |
Nathan and I messaged about this in Slack and we may have to check with ReportStream to see what datetime formats they consider valid. Test data csv includes:
FHIR bundle gets created successfully with the following Specimen entry, correctly parsing the datetime strings as Pacific Time with UTC offset during December as -8
|
Added a data transformation step for the covid csv pipeline that converts the user's uploaded datetime strings to an offset format that is accepted by ReportStream Re-deployed on dev7 with a successful ReportStream response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thank you for all this work
import java.io.Serial; | ||
|
||
public class InvalidAddressException extends RuntimeException { | ||
@Serial private static final long serialVersionUID = 1L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with @serial, what does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That particular @Serial
annotation was recommended by Intellij to allow compile-time checking of serialization-related declarations, similar to the checking enabled by the @Override
annotation type to validate method overriding
@@ -56,12 +55,11 @@ | |||
public class BulkUploadResultsToFhir { | |||
|
|||
private static final String ALPHABET_REGEX = "^[a-zA-Z\\s]+$"; | |||
private static final String SNOMED_REGEX = "(^[0-9]{9}$)|(^[0-9]{15}$)"; | |||
private final ResultsUploaderDeviceValidationService resultsUploaderDeviceValidationService; | |||
private static final String SNOMED_REGEX = "(^\\d{9}$)|(^\\d{15}$)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarLint complaining that the digits could be replaced by \d
, I could revert this if we prefer it to explicitly still use [0-9]
@@ -75,7 +77,8 @@ public static void assertJsonNodesEqual( | |||
fieldPath + "[" + i + "]"); | |||
} | |||
} else { // Otherwise assert values are equal | |||
assertThat(actualFieldValue.toString()).isEqualTo(expectedFieldValue.toString()); | |||
log.debug("Comparing " + fieldPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful when debugging the expected and actual JSON output for the FHIR bundler, but not necessary to keep in so I could comment out or remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I re-tried my test file in dev7 and the upload succeeded as expected. Thanks for investigating that issue! This LGTM 🚀
Kudos, SonarCloud Quality Gate passed! |
BACKEND PULL REQUEST
Related Issue
Changes Proposed
Z
suffix.2021-12-20T19:00:00Z
2021-12-20T14:00:00-05:00
TZ identifier
string defined by ICANN tz databaseUS/Eastern
FhirConverter
andBulkUploadResultsToFhir
Additional Information
Before we can convert it to a UTC timestamp, we need to convert the local
test_result_date
to the correct Date instant of time which requires knowing the data's time offset from UTC and whether it obeys daylight savings.This PR attempts to validate the address of the testing lab and use the time zone metadata returned from Smarty for the correct UTC offset.
Testing