Skip to content

Commit

Permalink
MAT-7450 Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Jul 30, 2024
1 parent 7e36f63 commit 8d1d411
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import gov.cms.mat.cql_elm_translation.data.RequestData;
import gov.cms.mat.cql_elm_translation.service.CqlConversionService;
import gov.cms.mat.cql_elm_translation.service.CqlLibraryService;
import gov.cms.mat.cql_elm_translation.service.CqlParsingService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -33,7 +32,6 @@ public class CqlConversionController {

private final CqlConversionService cqlConversionService;
private final CqlLibraryService cqlLibraryService;
private final CqlParsingService cqlParsingService;

@PutMapping(path = "/cql", consumes = "text/plain", produces = "application/elm+json")
public CqlConversionPayload cqlToElmJson(
Expand Down Expand Up @@ -65,7 +63,6 @@ public CqlConversionPayload cqlToElmJson(
.validateUnits(validateUnits)
.resultTypes(resultTypes)
.build();
cqlParsingService.getCqlBuilderLookups(cqlData, accessToken);
cqlLibraryService.setUpLibrarySourceProvider(cqlData, accessToken);

CqlConversionPayload cqlConversionPayload =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,28 +569,28 @@ private Element resolve(String identifier, CompiledLibrary library) {
libraryAccessor = def;
try {
var parsedLibrary =
libraries.stream()
.filter(
l ->
l.getCqlLibraryName().equalsIgnoreCase(def.getPath())
&& l.getVersion().equalsIgnoreCase(def.getVersion()))
.findFirst();
libraries.stream()
.filter(
l ->
l.getCqlLibraryName().equalsIgnoreCase(def.getPath())
&& l.getVersion().equalsIgnoreCase(def.getVersion()))
.findFirst();
if (parsedLibrary.isEmpty()) {
parseChildLibraries(def);
libraries.add(
CQLIncludeLibrary.builder()
.cqlLibraryName(def.getPath())
.aliasName(def.getLocalIdentifier())
.version(def.getVersion())
// TODO: should be taken from librarySetId
.id(def.getTrackerId().toString())
.setId(def.getTrackerId().toString())
.build());
CQLIncludeLibrary.builder()
.cqlLibraryName(def.getPath())
.aliasName(def.getLocalIdentifier())
.version(def.getVersion())
// TODO: should be taken from librarySetId
.id(def.getTrackerId().toString())
.setId(def.getTrackerId().toString())
.build());
}
} catch (IOException e) {
log.error(
"IOException while parsing child library [{}] " + e.getMessage(),
def.getPath() + "-" + def.getVersion());
"IOException while parsing child library [{}] " + e.getMessage(),
def.getPath() + "-" + def.getVersion());
}
} else if (element instanceof CodeDef codeDef) {
codes.add(formattedIdentifier);
Expand Down

0 comments on commit 8d1d411

Please sign in to comment.