Skip to content

Commit

Permalink
MAT-6785 add more mappings, add data criteria to hqmf
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Mar 5, 2024
1 parent 549b756 commit ba0021b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public String generate(MeasureExport measureExport) throws Exception {
// This is removed in this method
hqmfXML = replaceInlineCommentFromEnd(hqmfXML);

// TODO: would be handled by MAT-6785
String dataCriteriaXML = hqmfDataCriteriaGenerator.generate(measureExport);
hqmfXML = appendToHQMF(dataCriteriaXML, hqmfXML);

Expand Down
12 changes: 8 additions & 4 deletions src/main/java/gov/cms/madie/services/MeasureMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public interface MeasureMapper {
@Mapping(target = "riskAdjustmentVariables", source = "measure.riskAdjustments")
MeasureType measureToMeasureType(QdmMeasure measure, CqlLookups cqlLookups);

@Mapping(target = "uuid", expression = "java(measure.getId())")
@Mapping(target = "cqlUUID", expression = "java(measure.getMeasureSetId())")
@Mapping(target = "title", source = "measureName")
@Mapping(target = "measureModel", source = "model")
@Mapping(target = "shortTitle", source = "ecqmTitle")
Expand Down Expand Up @@ -170,9 +172,10 @@ default List<ClauseType> groupToClauseTypes(Group group) {
"java(String.valueOf(org.apache.commons.lang3.StringUtils.isNotBlank(population.getDefinition())))")
@Mapping(target = "uuid", expression = "java(java.util.UUID.randomUUID().toString())")
@Mapping(target = "cqldefinitionOrCqlaggfunction", source = "population")
@Mapping(target = "type", expression = "java(gov.cms.madie.util.MappingUtil.getPopulationType(population.getName()))")
// TODO: clause type display name
@Mapping(target = "displayName", source = "name")
@Mapping(
target = "type",
expression = "java(gov.cms.madie.util.MappingUtil.getPopulationType(population.getName()))")
@Mapping(target = "displayName", expression = "java(population.getName().getDisplay())")
ClauseType populationToClauseType(Population population);

default List<Object> populationToDefOrAgg(Population population) {
Expand All @@ -190,7 +193,8 @@ default List<Object> populationToDefOrAgg(Population population) {
expression =
"java(String.valueOf(org.apache.commons.lang3.StringUtils.isNotBlank(observation.getDefinition())))")
@Mapping(target = "uuid", expression = "java(java.util.UUID.randomUUID().toString())")
// TODO: clause type display name
@Mapping(target = "type", constant = "measureObservation")
@Mapping(target = "displayName", constant = "Measure Observation")
ClauseType observationToClauseType(MeasureObservation observation);

// TODO: map observation to definition/aggregate function
Expand Down
22 changes: 20 additions & 2 deletions src/main/java/gov/cms/madie/util/MappingUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,26 @@ public static boolean isPopulationObservation(PopulationType populationType) {
}

public static String getPopulationType(PopulationType populationType) {
// todo: fill this in
return "";
switch (populationType) {
case INITIAL_POPULATION:
return "initialPopulation";
case DENOMINATOR:
return "denominator";
case DENOMINATOR_EXCLUSION:
return "denominatorExclusion";
case DENOMINATOR_EXCEPTION:
return "denominatorException";
case NUMERATOR:
return "numerator";
case NUMERATOR_EXCLUSION:
return "numeratorExclusion";
case MEASURE_POPULATION:
return "measurePopulation";
case MEASURE_POPULATION_EXCLUSION:
return "measurePopulationExclusion";
default:
return "?";
}
}

/**
Expand Down

0 comments on commit ba0021b

Please sign in to comment.