Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAT-7450 API to retrieve Parameters, Definitions, Functions, and Fluent Functions from CQL #10

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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 @@ -32,6 +33,7 @@ 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 @@ -63,7 +65,7 @@ public CqlConversionPayload cqlToElmJson(
.validateUnits(validateUnits)
.resultTypes(resultTypes)
.build();

cqlParsingService.getCqlBuilderLookups(cqlData, accessToken);
adongare marked this conversation as resolved.
Show resolved Hide resolved
cqlLibraryService.setUpLibrarySourceProvider(cqlData, accessToken);

CqlConversionPayload cqlConversionPayload =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import gov.cms.madie.models.dto.TranslatedLibrary;
import gov.cms.madie.models.measure.Measure;
import gov.cms.mat.cql_elm_translation.dto.CqlLookupRequest;
import gov.cms.mat.cql_elm_translation.dto.CqlLookups;
import gov.cms.mat.cql_elm_translation.dto.CqlBuilderLookup;
import gov.cms.mat.cql_elm_translation.dto.SourceDataCriteria;
import gov.cms.mat.cql_elm_translation.exceptions.CqlFormatException;
import gov.cms.mat.cql_elm_translation.service.CqlConversionService;
Expand Down Expand Up @@ -92,15 +91,11 @@ public ResponseEntity<Map<String, Set<CQLDefinition>>> getDefinitionCallstack(
}

@PutMapping(
value = "/cql/lookups",
value = "/cql-builder-lookups",
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<CqlLookups> getCqlLookups(
@RequestBody CqlLookupRequest lookupRequest,
@RequestHeader("Authorization") String accessToken) {
log.info("Translator is preparing CQL Lookups for simple xml");
return ResponseEntity.ok(
cqlParsingService.getCqlLookups(
lookupRequest.getCql(), lookupRequest.getMeasureExpressions(), accessToken));
public ResponseEntity<CqlBuilderLookup> getCqlBuilderLookups(
adongare marked this conversation as resolved.
Show resolved Hide resolved
@RequestBody String cql, @RequestHeader("Authorization") String accessToken) {
return ResponseEntity.ok(cqlParsingService.getCqlBuilderLookups(cql, accessToken));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package gov.cms.mat.cql_elm_translation.dto;

import lombok.Builder;
import lombok.Data;

import java.util.Set;

@Data
@Builder
public class CqlBuilderLookup {
private Set<Lookup> parameters;
private Set<Lookup> definitions;
private Set<Lookup> functions;
private Set<Lookup> fluentFunctions;

@Builder
public static class Lookup {
private String name;
private String libraryName;
private String libraryAlias;
private String logic;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading