Skip to content

Commit

Permalink
MAT-6785 valueset mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Mar 5, 2024
1 parent 032472f commit eac58a1
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/main/java/gov/cms/madie/services/MeasureMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<CQLValueSet> 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<ValuesetType> valueSetsToValuesetType(Set<CQLValueSet> cqlValueSets);

default CodeSystemsType cqlCodeSystemsToCodeSystemsType(Set<CQLCodeSystem> codeSystems) {
if (!CollectionUtils.isEmpty(codeSystems)) {
CodeSystemsType codeSystemsType = new CodeSystemsType();
Expand Down Expand Up @@ -465,5 +486,5 @@ default ArgumentsType functionArgumentsToArgumentsType(
List<ArgumentType> functionArgumentsToArgumentTypes(List<CQLFunctionArgument> functionArguments);

@Mapping(target = "type", source = "argumentType")
ArgumentType functionArgumentToArgumentType(CQLFunctionArgument functionArguments);
ArgumentType functionArgumentToArgumentType(CQLFunctionArgument functionArgument);
}

0 comments on commit eac58a1

Please sign in to comment.