From 648c00c42321815fe9b1fc59081ba0cc52198314 Mon Sep 17 00:00:00 2001 From: Joseph Kotanchik Date: Thu, 29 Aug 2024 14:38:10 -0400 Subject: [PATCH] MAT-7570: Update the QDM Date Shift lower limit to 1900. --- pom.xml | 2 +- .../madie/models/cqm/datacriteria/basetypes/DataElement.java | 4 ++-- .../models/cqm/datacriteria/basetypes/DataElementTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e83ba29..ab6f8d5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ gov.cms.madie madie-java-models - 0.6.59-SNAPSHOT + 0.6.60-SNAPSHOT madie-java-models Java based models for MADiE microservices diff --git a/src/main/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElement.java b/src/main/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElement.java index fd0f17e..f179027 100644 --- a/src/main/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElement.java +++ b/src/main/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElement.java @@ -133,8 +133,8 @@ public ZonedDateTime shiftDateByYear(ZonedDateTime dateTime, int year) { if (shiftedDateTime.getYear() > 9999) { return shiftedDateTime.withYear(9999); } - if (shiftedDateTime.getYear() < 0) { - return shiftedDateTime.withYear(0); + if (shiftedDateTime.getYear() < 1900) { + return shiftedDateTime.withYear(1900); } return shiftedDateTime; } diff --git a/src/test/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElementTest.java b/src/test/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElementTest.java index 5e45316..62c7122 100644 --- a/src/test/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElementTest.java +++ b/src/test/java/gov/cms/madie/models/cqm/datacriteria/basetypes/DataElementTest.java @@ -26,6 +26,6 @@ void shiftDateByYearBeforeYear0() { ZonedDateTime dateTime = ZonedDateTime.ofInstant(Instant.now(), ZoneId.of("UTC")); encounterPerformed.setAuthorDatetime(dateTime); ZonedDateTime shiftedDateTime = encounterPerformed.shiftDateByYear(dateTime, -100000); - assertThat(shiftedDateTime).isEqualTo(dateTime.withYear(0)); + assertThat(shiftedDateTime).isEqualTo(dateTime.withYear(1900)); } }