Skip to content

Commit

Permalink
Handle timezones in bulk uploader and Fhir converter
Browse files Browse the repository at this point in the history
  • Loading branch information
mpbrown committed Jun 14, 2023
1 parent 3e572e6 commit e1d4e6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,8 @@ public DiagnosticReport convertToDiagnosticReport(
.setEffective(new DateTimeType(dateTested))
.setIssued(dateUpdated);

diagnosticReport.getEffectiveDateTimeType().setTimeZoneZulu(true);
diagnosticReport.getIssuedElement().setTimeZoneZulu(true);
diagnosticReport.getEffectiveDateTimeType().setTimeZone(TimeZone.getTimeZone("utc"));
diagnosticReport.getIssuedElement().setTimeZone(TimeZone.getTimeZone("utc"));

diagnosticReport.setId(id);
if (StringUtils.isNotBlank(code)) {
Expand Down Expand Up @@ -938,7 +938,7 @@ public Bundle createFhirBundle(CreateFhirBundleProps props) {
.setTimestamp(props.getCurrentDate())
.setIdentifier(new Identifier().setValue(props.getDiagnosticReport().getId()));

bundle.getTimestampElement().setTimeZoneZulu(true);
bundle.getTimestampElement().setTimeZone(TimeZone.getTimeZone("utc"));

entryList.forEach(
pair ->
Expand All @@ -963,7 +963,7 @@ public Provenance createProvenance(
.setDisplay(EVENT_TYPE_DISPLAY);
provenance.addAgent().setWho(new Reference().setReference(organizationFullUrl));
provenance.setRecorded(dateTested);
provenance.getRecordedElement().setTimeZoneZulu(true);
provenance.getRecordedElement().setTimeZone(TimeZone.getTimeZone("utc"));
return provenance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"value": "123"
},
"type": "message",
"timestamp": "2023-05-24T19:33:06.472Z",
"timestamp": "2023-05-24T19:33:06.472+00:00",
"entry": [
{
"fullUrl": "MessageHeader/00000000-0000-0000-0000-000000000010",
Expand Down Expand Up @@ -70,7 +70,7 @@
"resource": {
"resourceType": "Provenance",
"id": "00000000-0000-0000-0000-000000000009",
"recorded": "2023-05-24T19:33:06.472Z",
"recorded": "2023-05-24T19:33:06.472+00:00",
"activity": {
"coding": [
{
Expand Down Expand Up @@ -116,8 +116,8 @@
"subject": {
"reference": "Patient/1234"
},
"effectiveDateTime": "2021-12-20T19:00:00Z",
"issued": "2023-05-24T19:33:06.472Z",
"effectiveDateTime": "2021-12-20T19:00:00+00:00",
"issued": "2023-05-24T19:33:06.472+00:00",
"specimen": [
{
"reference": "Specimen/00000000-0000-0000-0000-000000000004"
Expand Down

0 comments on commit e1d4e6a

Please sign in to comment.