Skip to content

Commit

Permalink
Merge pull request #141 from MeasureAuthoringTool/develop
Browse files Browse the repository at this point in the history
Release version 0.5.1
  • Loading branch information
gregory-akins authored May 25, 2023
2 parents 3dcda98 + 951f2df commit 609cdee
Show file tree
Hide file tree
Showing 51 changed files with 942 additions and 87 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ Java based MADiE models used by MADiE microservices
</dependency>
```
Where,\
**X**: Major version , **Y**: Minor version, **Z**: Patch version
**X**: Major version , **Y**: Minor version, **Z**: Patch version

## Publishing Snapshots
To publish a snapshot, update project version in pom.xml and create a PR against develop
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

<groupId>gov.cms.madie</groupId>
<artifactId>madie-java-models</artifactId>
<version>0.3.1</version>

<version>0.5.1</version>
<name>madie-java-models</name>
<description>Java based models for MADiE microservices</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>16</java.version>
<java.version>17</java.version>
<mvn.checkstyle.file>checkstyle.xml</mvn.checkstyle.file>
<mvn.checkstyle.version>3.1.2</mvn.checkstyle.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<fasterxml.jackson.version>2.13.3</fasterxml.jackson.version>
<springboot.version>3.0.3</springboot.version>
</properties>

<distributionManagement>
Expand All @@ -44,23 +44,23 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>3.0.2</version>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.6.14</version>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>3.0.2</version>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>2.6.6</version>
<version>${springboot.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/gov/cms/madie/models/common/ImprovementNotation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package gov.cms.madie.models.common;

import com.fasterxml.jackson.annotation.JsonProperty;

public enum ImprovementNotation {

@JsonProperty("Increased score indicates improvement")
INCREASED_SCORE_INDICATES_IMPROVEMENT("Increased score indicates improvement"),

@JsonProperty("Decreased score indicates improvement")
DECREASED_SCORE_INDICATES_IMPROVEMENT("Decreased score indicates improvement");

private final String value;

ImprovementNotation(String value) {
this.value = value;
}

@Override
public String toString() {
return this.value;
}
}
3 changes: 2 additions & 1 deletion src/main/java/gov/cms/madie/models/common/ModelType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

@Getter
public enum ModelType {
QI_CORE("QI-Core v4.1.1");
QI_CORE("QI-Core v4.1.1"),
QDM_5_6("QDM v5.6");

private String value;
private static final Map<String, ModelType> MODEL_TYPE_BY_VALUE = new HashMap<>();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/gov/cms/madie/models/library/CqlLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import gov.cms.madie.models.common.Version;

import java.time.Instant;
import javax.validation.GroupSequence;
import javax.validation.constraints.*;
import javax.validation.groups.Default;
import jakarta.validation.GroupSequence;
import jakarta.validation.constraints.*;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down Expand Up @@ -63,8 +63,8 @@ public class CqlLibrary {
private String groupId;
private boolean cqlErrors;
private String cql;
@Transient private String elmJson;
@Transient private String elmXml;
private String elmJson;
private String elmXml;
private Instant createdAt;
private String createdBy;
private Instant lastModifiedAt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package gov.cms.madie.models.library;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package gov.cms.madie.models.measure;

import java.util.Arrays;

import com.fasterxml.jackson.annotation.JsonProperty;

public enum BaseConfigurationTypes {
@JsonProperty("Appropriate Use Process")
APPROPRIATE_USE_PROCESS("Appropriate Use Process"),
@JsonProperty("Cost/Resource Use")
COST_OR_RESOURCE_USE("Cost/Resource Use"),
@JsonProperty("Efficiency")
EFFICIENCY("Efficiency"),
@JsonProperty("Intermediate Clinical Outcome")
INTERMEDIATE_CLINICAL_OUTCOME("Intermediate Clinical Outcome"),
@JsonProperty("Outcome")
OUTCOME("Outcome"),
@JsonProperty("Patient Engagement/Experience")
PATIENT_ENGAGEMENT_OR_EXPERIENCE("Patient Engagement/Experience"),
@JsonProperty("Patient Reported Outcome")
PATIENT_REPORTED_OUTCOME("Patient Reported Outcome"),
@JsonProperty("Performance")
PERFORMANCE("Performance"),
@JsonProperty("Process")
PROCESS("Process"),
@JsonProperty("Structure")
STRUCTURE("Structure");

private final String text;

BaseConfigurationTypes(String text) {
this.text = text;
}

@Override
public String toString() {
return this.text;
}

public static BaseConfigurationTypes valueOfText(String text) {
return Arrays.stream(BaseConfigurationTypes.values())
.filter(s -> s.text.equals(text))
.findFirst()
.orElseThrow(
() ->
new IllegalArgumentException(
"No enum constant " + BaseConfigurationTypes.class.getCanonicalName() + "." + text));
}
}
19 changes: 19 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/DefDescPair.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package gov.cms.madie.models.measure;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class DefDescPair {

private String definition;

private String description;

}

4 changes: 2 additions & 2 deletions src/main/java/gov/cms/madie/models/measure/Endorsement.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package gov.cms.madie.models.measure;

import gov.cms.madie.models.validators.RequiredOnSelect;
import javax.validation.constraints.Pattern;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@RequiredOnSelect(selectedField = "endorser", requiredField = "endorsementId", message = "EndorsementId is required when endorser is not null")
@RequiredOnSelect(selectedField = "endorser", requiredField = "endorsementId", message = "EndorsementId is required when Endorser is not null,otherwise if Endorser is null, EndorsementId has to be null")
public class Endorsement {

private String endorser;
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/Export.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package gov.cms.madie.models.measure;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Export {
@Id
private String id;
private String measureId;
private String measureBundleJson;
}
22 changes: 22 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/FhirMeasure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package gov.cms.madie.models.measure;

import com.fasterxml.jackson.annotation.JsonTypeName;

import gov.cms.madie.models.validators.ValidFhirGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

import java.util.List;

@Data
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@JsonTypeName("QI-Core v4.1.1")
@ToString(callSuper=true)
@ValidFhirGroup
public class FhirMeasure extends Measure {

private List<TestCase> testCases;
}
10 changes: 3 additions & 7 deletions src/main/java/gov/cms/madie/models/measure/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.util.List;

@Data
Expand Down Expand Up @@ -45,16 +43,14 @@ public class Group implements GroupScoringPopulation {

private String rateAggregation;

@NotEmpty
//@NotEmpty
private List<MeasureGroupTypes> measureGroupTypes;

private Object scoringUnit;

@Valid
private List<Stratification> stratifications;

@NotBlank(
message = "Population Basis is required.")
private String populationBasis;

}
34 changes: 25 additions & 9 deletions src/main/java/gov/cms/madie/models/measure/Measure.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.validation.GroupSequence;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.groups.Default;
import jakarta.validation.GroupSequence;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.groups.Default;

import gov.cms.madie.models.common.ProgramUseContext;
import lombok.Singular;
Expand All @@ -17,6 +17,9 @@
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

Expand All @@ -31,6 +34,15 @@
@Data
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "model",
visible = true)
@JsonSubTypes({
@Type(value = FhirMeasure.class, name = "QI-Core v4.1.1"),
@Type(value = QdmMeasure.class, name = "QDM v5.6")
})
public class Measure extends ResourceAcl {

@Id private String id;
Expand Down Expand Up @@ -99,7 +111,6 @@ public class Measure extends ResourceAcl {
private String cql;
private String elmJson;
@Transient private String elmXml;
private List<TestCase> testCases;
@Valid private List<Group> groups;
private Instant createdAt;
private String createdBy;
Expand All @@ -108,10 +119,12 @@ public class Measure extends ResourceAcl {
private Date measurementPeriodStart;
private Date measurementPeriodEnd;
@Singular("sde")
private List<SupplementalData> supplementalData;
private List<RiskAdjustment> riskAdjustments;
private List<DefDescPair> supplementalData;
@Singular("rav")
private List<DefDescPair> riskAdjustments;
private ProgramUseContext programUseContext;

@NotBlank(message = "Model is required")
@EnumValidator(
enumClass = ModelType.class,
message = "MADiE was unable to complete your request, please try again.",
Expand All @@ -129,6 +142,9 @@ public class Measure extends ResourceAcl {

private ReviewMetaData reviewMetaData = new ReviewMetaData();

@Transient
private MeasureSet measureSet;

@GroupSequence({
Measure.ValidationOrder1.class,
Measure.ValidationOrder2.class,
Expand Down Expand Up @@ -157,4 +173,4 @@ public interface ValidationOrder6 {}
public interface ValidationOrder7 {}

public interface ValidationOrder8 {}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gov.cms.madie.models.measure;

import gov.cms.madie.models.common.Organization;
import javax.validation.Valid;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

@Data
@Builder(toBuilder = true)
Expand Down
Loading

0 comments on commit 609cdee

Please sign in to comment.