Skip to content

Commit

Permalink
Add path to CQL source information
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival committed May 13, 2024
1 parent 5c7efb0 commit f52d79f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"testng"
],
"java.compile.nullAnalysis.mode": "automatic",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable"
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable"
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ private List<Library> internalRefreshGeneratedContent(List<Library> sourceLibrar
sourceLibraries.add(newLibrary);
}
}
else
{
logger.error("No identifier found for CQL file {}", fileInfo.getPath());
}

}

List<Library> resources = new ArrayList<Library>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public List<IBaseResource> refresh(RefreshIGParameters params) {
logger.info("Refreshing {}", library.getIdElement());

for (CqlProcessor.CqlSourceFileInformation info : cqlProcessor.getAllFileInformation()) {
if (info.getIdentifier() == null) {
logger.error("No identifier found for CQL file {}", info.getPath());
}

if (info.getIdentifier().getId().endsWith(name)) {
// TODO: should likely verify or resolve/refresh the following elements:
// cpg-knowledgeCapability, cpg-knowledgeRepresentationLevel, url, identifier, status,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.*;
import java.util.stream.Collectors;

import org.antlr.v4.parse.ANTLRParser.finallyClause_return;
import org.cqframework.cql.cql2elm.CqlCompilerException;
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
import org.cqframework.cql.cql2elm.CqlTranslator;
Expand Down Expand Up @@ -42,6 +43,7 @@ public class CqlProcessor {
* information about a cql file
*/
public class CqlSourceFileInformation {
private final String path;
private CqlTranslatorOptions options;
private VersionedIdentifier identifier;
private byte[] cql;
Expand All @@ -51,6 +53,15 @@ public class CqlSourceFileInformation {
private List<RelatedArtifact> relatedArtifacts = new ArrayList<>();
private List<DataRequirement> dataRequirements = new ArrayList<>();
private List<ParameterDefinition> parameters = new ArrayList<>();

public CqlSourceFileInformation(String path) {
this.path = path;
}

public String getPath() {
return path;
}

public CqlTranslatorOptions getOptions() {
return options;
}
Expand Down Expand Up @@ -362,7 +373,7 @@ public static ValidationMessage exceptionToValidationMessage(File file, CqlCompi

private void translateFile(LibraryManager libraryManager, File file, CqlCompilerOptions options) {
// logger.logMessage(String.format("Translating CQL source in file %s", file.toString()));
CqlSourceFileInformation result = new CqlSourceFileInformation();
CqlSourceFileInformation result = new CqlSourceFileInformation(file.getAbsolutePath());
fileMap.put(file.getAbsoluteFile().toString(), result);

if (options.getValidateUnits()) {
Expand Down

0 comments on commit f52d79f

Please sign in to comment.