From ba0021bf0302481b3f2c5286a2cfefb2ca957157 Mon Sep 17 00:00:00 2001 From: adongare Date: Tue, 5 Mar 2024 15:33:46 -0500 Subject: [PATCH] MAT-6785 add more mappings, add data criteria to hqmf --- .../cms/madie/hqmf/qdm_5_6/HQMFGenerator.java | 1 - .../gov/cms/madie/services/MeasureMapper.java | 12 ++++++---- .../java/gov/cms/madie/util/MappingUtil.java | 22 +++++++++++++++++-- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/main/java/gov/cms/madie/hqmf/qdm_5_6/HQMFGenerator.java b/src/main/java/gov/cms/madie/hqmf/qdm_5_6/HQMFGenerator.java index bb255ff..a0f4923 100644 --- a/src/main/java/gov/cms/madie/hqmf/qdm_5_6/HQMFGenerator.java +++ b/src/main/java/gov/cms/madie/hqmf/qdm_5_6/HQMFGenerator.java @@ -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); diff --git a/src/main/java/gov/cms/madie/services/MeasureMapper.java b/src/main/java/gov/cms/madie/services/MeasureMapper.java index 517f2aa..5061188 100644 --- a/src/main/java/gov/cms/madie/services/MeasureMapper.java +++ b/src/main/java/gov/cms/madie/services/MeasureMapper.java @@ -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") @@ -170,9 +172,10 @@ default List 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 populationToDefOrAgg(Population population) { @@ -190,7 +193,8 @@ default List 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 diff --git a/src/main/java/gov/cms/madie/util/MappingUtil.java b/src/main/java/gov/cms/madie/util/MappingUtil.java index cbd0ae9..4e2fb6c 100644 --- a/src/main/java/gov/cms/madie/util/MappingUtil.java +++ b/src/main/java/gov/cms/madie/util/MappingUtil.java @@ -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 "?"; + } } /**