diff --git a/src/main/java/gov/cms/madie/services/MeasureMapper.java b/src/main/java/gov/cms/madie/services/MeasureMapper.java index 3c32e06..4ba1f52 100644 --- a/src/main/java/gov/cms/madie/services/MeasureMapper.java +++ b/src/main/java/gov/cms/madie/services/MeasureMapper.java @@ -6,6 +6,7 @@ import gov.cms.madie.dto.CQLDefinition; import gov.cms.madie.dto.CQLFunctionArgument; import gov.cms.madie.dto.CQLParameter; +import gov.cms.madie.dto.CQLValueSet; import gov.cms.madie.dto.CqlLookups; import gov.cms.madie.models.common.Organization; import gov.cms.madie.models.common.Version; @@ -360,10 +361,30 @@ default FinalizedDateType instantToFinalizedDateType(Measure measure) { return finalizedDateType; } + @Mapping(target = "valuesets", source = "valueSets") @Mapping(target = "definitions", source = "definitions") @Mapping(target = "functions", source = "definitions") CqlLookUpType cqlLookupsToCqlLookUpType(CqlLookups cqlLookups); + default ValuesetsType valueSetsToValuesetsType(Set cqlValueSets) { + if (CollectionUtils.isEmpty(cqlValueSets)) { + return null; + } + ValuesetsType valuesetsType = new ValuesetsType(); + valuesetsType.getValueset().addAll(valueSetsToValuesetType(cqlValueSets)); + return valuesetsType; + } + + @Mapping(target = "datatype", constant = "") + @Mapping(target = "suppDataElement", source = "false") + @Mapping(target = "id", expression = "java(java.util.UUID.randomUUID().toString())") + @Mapping(target = "name", source = "name") + @Mapping(target = "oid", source = "oid") + @Mapping(target = "originalName", source = "name") + ValuesetType cqlValueSetToValuesetType(CQLValueSet cqlValueSet); + + List valueSetsToValuesetType(Set cqlValueSets); + default CodeSystemsType cqlCodeSystemsToCodeSystemsType(Set codeSystems) { if (!CollectionUtils.isEmpty(codeSystems)) { CodeSystemsType codeSystemsType = new CodeSystemsType(); @@ -465,5 +486,5 @@ default ArgumentsType functionArgumentsToArgumentsType( List functionArgumentsToArgumentTypes(List functionArguments); @Mapping(target = "type", source = "argumentType") - ArgumentType functionArgumentToArgumentType(CQLFunctionArgument functionArguments); + ArgumentType functionArgumentToArgumentType(CQLFunctionArgument functionArgument); }