From 03b7bef54e7cda3f67ef803c3047ea46483ec350 Mon Sep 17 00:00:00 2001 From: Cecilia Liu Date: Fri, 9 Aug 2024 07:58:52 -0500 Subject: [PATCH] MAT-7583 mapping issues --- pom.xml | 2 +- .../models/cqm/datacriteria/AssessmentPerformed.java | 2 +- .../models/cqm/datacriteria/EncounterPerformed.java | 11 ++++++++++- .../models/cqm/datacriteria/attributes/Entity.java | 3 +++ .../cqm/datacriteria/attributes/FacilityLocation.java | 3 +++ .../cqm/datacriteria/attributes/Identifier.java | 1 + 6 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b7d6a50..4d9a27d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ gov.cms.madie madie-java-models - 0.6.55-SNAPSHOT + 0.6.56-SNAPSHOT madie-java-models Java based models for MADiE microservices diff --git a/src/main/java/gov/cms/madie/models/cqm/datacriteria/AssessmentPerformed.java b/src/main/java/gov/cms/madie/models/cqm/datacriteria/AssessmentPerformed.java index ad0c17d..883e645 100644 --- a/src/main/java/gov/cms/madie/models/cqm/datacriteria/AssessmentPerformed.java +++ b/src/main/java/gov/cms/madie/models/cqm/datacriteria/AssessmentPerformed.java @@ -47,7 +47,7 @@ public class AssessmentPerformed extends DataElement { private Code interpretation; private List components; private Object[] relatedTo; - private Entity performer; + private Entity[] performer; private String qdmTitle = "Assessment, Performed"; private String hqmfOid = "2.16.840.1.113883.10.20.28.4.117"; private String qdmCategory = "assessment"; diff --git a/src/main/java/gov/cms/madie/models/cqm/datacriteria/EncounterPerformed.java b/src/main/java/gov/cms/madie/models/cqm/datacriteria/EncounterPerformed.java index 20c8823..0fa6ca9 100644 --- a/src/main/java/gov/cms/madie/models/cqm/datacriteria/EncounterPerformed.java +++ b/src/main/java/gov/cms/madie/models/cqm/datacriteria/EncounterPerformed.java @@ -2,6 +2,7 @@ import gov.cms.madie.models.cqm.datacriteria.basetypes.DataElement; import gov.cms.madie.models.cqm.datacriteria.attributes.Entity; +import gov.cms.madie.models.cqm.datacriteria.attributes.FacilityLocation; import gov.cms.madie.models.cqm.datacriteria.basetypes.Code; import gov.cms.madie.models.cqm.datacriteria.basetypes.Interval; import gov.cms.madie.models.cqm.datacriteria.basetypes.LocalDateTimeFormatConstant; @@ -39,7 +40,7 @@ public class EncounterPerformed extends DataElement { private Code clazz; private Interval relevantPeriod; private Code dischargeDisposition; - private List facilityLocations; + private List facilityLocations; private List diagnoses; private Quantity lengthOfStay; private Code priority; @@ -55,5 +56,13 @@ public class EncounterPerformed extends DataElement { public void shiftDates(int shifted) { this.authorDatetime = shiftDateByYear(this.authorDatetime, shifted); this.relevantPeriod = shiftIntervalByYear(this.relevantPeriod, shifted); + if (!org.springframework.util.CollectionUtils.isEmpty(this.facilityLocations)) { + this.facilityLocations.stream() + .forEach( + facilityLocation -> { + facilityLocation.setLocationPeriod( + shiftIntervalByYear(facilityLocation.getLocationPeriod(), shifted)); + }); + } } } diff --git a/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Entity.java b/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Entity.java index 960559e..e09592f 100644 --- a/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Entity.java +++ b/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Entity.java @@ -1,5 +1,7 @@ package gov.cms.madie.models.cqm.datacriteria.attributes; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import gov.cms.madie.models.cqm.datacriteria.basetypes.DataElement; import lombok.AllArgsConstructor; import lombok.Data; @@ -10,6 +12,7 @@ @SuperBuilder @NoArgsConstructor @AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) public class Entity implements Attribute { private DataElement dataElement; private String id; diff --git a/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/FacilityLocation.java b/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/FacilityLocation.java index 7a8582c..4da53c4 100644 --- a/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/FacilityLocation.java +++ b/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/FacilityLocation.java @@ -3,6 +3,7 @@ import org.springframework.format.annotation.DateTimeFormat; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import gov.cms.madie.models.cqm.datacriteria.basetypes.Code; import gov.cms.madie.models.cqm.datacriteria.basetypes.Interval; @@ -16,6 +17,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) public class FacilityLocation implements Attribute { private Code code; @@ -27,4 +29,5 @@ public class FacilityLocation implements Attribute { private Interval locationPeriod; private String qdmVersion = "5.6"; + private String _type = "QDM::FacilityLocation"; } diff --git a/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Identifier.java b/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Identifier.java index 0e6b455..96e8a83 100644 --- a/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Identifier.java +++ b/src/main/java/gov/cms/madie/models/cqm/datacriteria/attributes/Identifier.java @@ -13,6 +13,7 @@ public class Identifier implements Attribute { private String namingSystem; private String value; private String qdmVersion = "5.6"; + private String _type = "QDM::Identifier"; // CQM validates uniqueness of value with conditions // where namingSystem is CQM::Provider::NPI_OID