Skip to content

Commit

Permalink
Merge pull request #110 from MeasureAuthoringTool/develop
Browse files Browse the repository at this point in the history
Release 0.3.1
  • Loading branch information
nmorasb authored Mar 15, 2023
2 parents 3860a32 + 5efe674 commit 3dcda98
Show file tree
Hide file tree
Showing 27 changed files with 375 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '16'
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
Expand All @@ -24,11 +24,11 @@ jobs:
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v3
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '16'
java-version: '17'

- name: Extract project version
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

<name>madie-java-models</name>
<description>Java based models for MADiE microservices</description>
Expand Down Expand Up @@ -41,15 +41,20 @@
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.6.6</version>
<version>2.6.14</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>2.6.6</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/gov/cms/madie/models/common/ActionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ public enum ActionType {
CREATED,
VERSIONED_MAJOR,
VERSIONED_MINOR,
VERSIONED_REVISIONNUMBER,
DELETED,
IMPORTED,
UPDATED
UPDATED,
DRAFTED
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package gov.cms.madie.models.common;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "endorserOrganization")
public class EndorserOrganization {

@Id
private String id;

private String endorserOrganization;

}
2 changes: 2 additions & 0 deletions src/main/java/gov/cms/madie/models/common/Organization.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ public class Organization {

@Indexed(unique = true)
private String oid;

private String url;
}
16 changes: 16 additions & 0 deletions src/main/java/gov/cms/madie/models/common/ProgramUseContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package gov.cms.madie.models.common;

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

@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class ProgramUseContext {
private String codeSystem;
private String code;
private String display;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gov.cms.madie.models.library;
package gov.cms.madie.models.common;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/gov/cms/madie/models/library/CqlLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import gov.cms.madie.models.validators.EnumValidator;
import gov.cms.madie.models.utils.VersionJsonSerializer;
import gov.cms.madie.models.common.ModelType;
import gov.cms.madie.models.common.ProgramUseContext;
import gov.cms.madie.models.common.Version;

import java.time.Instant;
import javax.validation.GroupSequence;
Expand Down Expand Up @@ -70,6 +72,7 @@ public class CqlLibrary {
private String publisher;
private String description;
private boolean experimental;
private ProgramUseContext programUseContext;

@GroupSequence({
CqlLibrary.ValidationOrder1.class,
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/gov/cms/madie/models/measure/Endorsement.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package gov.cms.madie.models.measure;

import org.springframework.data.annotation.Id;

import gov.cms.madie.models.validators.RequiredOnSelect;
import javax.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")
public class Endorsement {
@Id private String id;
private String endorser;
private String endorsementId;

private String endorser;
private String endorserSystemId;
@Pattern(
regexp = "^[A-Za-z0-9]*$", message = "Endorsement Id is invalid")
private String endorsementId;
}
1 change: 1 addition & 0 deletions src/main/java/gov/cms/madie/models/measure/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class Group implements GroupScoringPopulation {
groups = {Measure.ValidationOrder5.class})
private String scoring;

@Valid
private List<Population> populations;

private List<MeasureObservation> measureObservations;
Expand Down
29 changes: 28 additions & 1 deletion src/main/java/gov/cms/madie/models/measure/Measure.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@
import java.time.Instant;
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 gov.cms.madie.models.common.ProgramUseContext;
import lombok.Singular;
import org.hibernate.validator.constraints.Length;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import gov.cms.madie.models.common.ModelType;
import gov.cms.madie.models.common.Version;
import gov.cms.madie.models.utils.VersionJsonSerializer;
import gov.cms.madie.models.validators.EnumValidator;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand All @@ -26,8 +36,16 @@ public class Measure extends ResourceAcl {
@Id private String id;

private String measureHumanReadableId;

@NotBlank(
groups = {ValidationOrder1.class},
message = "Measure Set ID is required.")
private String measureSetId;
private String version;

@JsonSerialize(using = VersionJsonSerializer.VersionSerializer.class)
@JsonDeserialize(using = VersionJsonSerializer.VersionDeserializer.class)
private Version version;
//temp for MAT-5191
private String revisionNumber;
private String state;

Expand Down Expand Up @@ -76,6 +94,8 @@ public class Measure extends ResourceAcl {
// TODO: determine if theres a way to set this from backend or if we should always trust user
// input for this field
private boolean cqlErrors;
@Singular
private Set<MeasureErrorType> errors;
private String cql;
private String elmJson;
@Transient private String elmXml;
Expand All @@ -87,20 +107,27 @@ public class Measure extends ResourceAcl {
private String lastModifiedBy;
private Date measurementPeriodStart;
private Date measurementPeriodEnd;
@Singular("sde")
private List<SupplementalData> supplementalData;
private List<RiskAdjustment> riskAdjustments;
private ProgramUseContext programUseContext;

@EnumValidator(
enumClass = ModelType.class,
message = "MADiE was unable to complete your request, please try again.",
groups = {ValidationOrder5.class})
private String model;

@Valid
private MeasureMetaData measureMetaData = new MeasureMetaData();

@NotBlank(
groups = {ValidationOrder1.class},
message = "Version ID is required.")
private String versionId;
private String cmsId;

private ReviewMetaData reviewMetaData = new ReviewMetaData();

@GroupSequence({
Measure.ValidationOrder1.class,
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/MeasureErrorType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package gov.cms.madie.models.measure;

public enum MeasureErrorType {
MISSING_ELM,
ERRORS_ELM_JSON,
MISMATCH_CQL_POPULATION_RETURN_TYPES,
MISMATCH_CQL_RISK_ADJUSTMENT,
MISMATCH_CQL_SUPPLEMENTAL_DATA,
INVALID_TERMINOLOGY
}
17 changes: 12 additions & 5 deletions src/main/java/gov/cms/madie/models/measure/MeasureMetaData.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
package gov.cms.madie.models.measure;

import gov.cms.madie.models.common.Organization;
import javax.validation.Valid;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;

@NoArgsConstructor
@Data
@Builder(toBuilder=true)
@NoArgsConstructor
@AllArgsConstructor
public class MeasureMetaData {
private String steward;
private List<String> developers;
private Organization steward;
private List<Organization> developers;
private String description;
private String copyright;
private String disclaimer;
private String rationale;
private String guidance;
private String clinicalRecommendation;

private boolean draft;
private List<Reference> references;
@Valid
private List<Endorsement> endorsements;
private String riskAdjustment;
private String definition;
private boolean experimental;
private String transmissionFormat;
private String supplementalDataElements;

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class MeasureObservation {
groups = {Measure.ValidationOrder5.class}
)
private String definition;
private String description;
private String criteriaReference;
@NotNull(
message = "Aggregate Method is required.",
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/Population.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

import org.springframework.data.annotation.Id;

@Data
Expand All @@ -12,6 +15,7 @@
@AllArgsConstructor
public class Population {
@Id
@NotBlank(message = "Population ID is required.")
private String id;
private PopulationType name;
private String definition;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/ReviewMetaData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package gov.cms.madie.models.measure;

import java.time.Instant;

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

@Data
@Builder(toBuilder=true)
@NoArgsConstructor
@AllArgsConstructor
public class ReviewMetaData {
private Instant approvalDate;
private Instant lastReviewDate;
}
15 changes: 15 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/RiskAdjustment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package gov.cms.madie.models.measure;

import lombok.Data;

@Data
public class RiskAdjustment extends SupplementalData {

public RiskAdjustment() {
super();
}

public RiskAdjustment(String definition, String description) {
super(definition, description);
}
}
18 changes: 18 additions & 0 deletions src/main/java/gov/cms/madie/models/measure/SupplementalData.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;

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

private String definition;

private String description;

}
Loading

0 comments on commit 3dcda98

Please sign in to comment.