diff --git a/pom.xml b/pom.xml
index 2e334c05e..da9fb736e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -201,6 +201,12 @@
${cqframework.version}
+
+ info.cqframework
+ cqf-fhir-npm
+ ${cqframework.version}
+
+
info.cqframework
elm-fhir
diff --git a/tooling-cli/pom.xml b/tooling-cli/pom.xml
index cc91e6e67..81d320728 100644
--- a/tooling-cli/pom.xml
+++ b/tooling-cli/pom.xml
@@ -9,7 +9,6 @@
2.5.0-SNAPSHOT
- org.opencds.cqf
tooling-cli
2.5.0-SNAPSHOT
jar
diff --git a/tooling/pom.xml b/tooling/pom.xml
index a00fbe9c2..e6da65614 100644
--- a/tooling/pom.xml
+++ b/tooling/pom.xml
@@ -7,10 +7,8 @@
org.opencds.cqf
tooling-parent
2.5.0-SNAPSHOT
-
- org.opencds.cqf
tooling
2.5.0-SNAPSHOT
jar
@@ -192,7 +190,7 @@
com.github.ben-manes.caffeine
caffeine
- 2.9.1
+ 3.1.1
@@ -230,14 +228,20 @@
org.slf4j
jcl-over-slf4j
- 1.7.30
+ 1.7.33
org.slf4j
log4j-over-slf4j
- 1.7.30
+ 1.7.33
+
+
+
+ org.slf4j
+ slf4j-jdk14
+ 1.7.33
@@ -251,6 +255,11 @@
elm-fhir
+
+ info.cqframework
+ cqf-fhir-npm
+
+
com.google.errorprone
error_prone_annotations
@@ -325,7 +334,7 @@
org.slf4j
slf4j-simple
- 1.7.30
+ 2.0.5
true
diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/dateroller/ResourceDataDateRoller.java b/tooling/src/main/java/org/opencds/cqf/tooling/dateroller/ResourceDataDateRoller.java
index 4a1267e9c..ccce52930 100644
--- a/tooling/src/main/java/org/opencds/cqf/tooling/dateroller/ResourceDataDateRoller.java
+++ b/tooling/src/main/java/org/opencds/cqf/tooling/dateroller/ResourceDataDateRoller.java
@@ -9,36 +9,40 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
+import java.util.List;
public class ResourceDataDateRoller {
private static Logger logger = LoggerFactory.getLogger(ResourceDataDateRoller.class);
+ private ResourceDataDateRoller() {
+
+ }
+
public static void rollBundleDates(FhirContext fhirContext, IBaseResource iBaseResource) {
- switch (fhirContext.getVersion().getVersion().name()) {
- case "R4":
- ArrayList r4ResourceArrayList = BundleUtils.getR4ResourcesFromBundle((org.hl7.fhir.r4.model.Bundle) iBaseResource);
- r4ResourceArrayList.forEach(resource -> {
- RollDatesR4.rollDatesInResource(resource);
- });
+ switch (fhirContext.getVersion().getVersion()) {
+ case R4:
+ List r4ResourceArrayList = BundleUtils.getR4ResourcesFromBundle((org.hl7.fhir.r4.model.Bundle) iBaseResource);
+ r4ResourceArrayList.forEach(RollDatesR4::rollDatesInResource);
break;
- case "Stu3":
- ArrayList stu3resourceArrayList = BundleUtils.getStu3ResourcesFromBundle((org.hl7.fhir.dstu3.model.Bundle) iBaseResource);
- stu3resourceArrayList.forEach(resource -> {
- RollDatesDstu3.rollDatesInResource(resource);
- });
+ case DSTU3:
+ List stu3resourceArrayList = BundleUtils.getStu3ResourcesFromBundle((org.hl7.fhir.dstu3.model.Bundle) iBaseResource);
+ stu3resourceArrayList.forEach(RollDatesDstu3::rollDatesInResource);
break;
+ default: throw new UnsupportedOperationException("Date Roller not supported for version "
+ + fhirContext.getVersion().getVersion().getFhirVersionString());
}
}
public static void rollResourceDates(FhirContext fhirContext, IBaseResource resource) {
- switch (fhirContext.getVersion().getVersion().name()) {
- case "R4":
+ switch (fhirContext.getVersion().getVersion()) {
+ case R4:
RollDatesR4.rollDatesInResource(resource);
break;
- case "DSTU3":
+ case DSTU3:
RollDatesDstu3.rollDatesInResource(resource);
break;
+ default: throw new UnsupportedOperationException("Date Roller not supported for version "
+ + fhirContext.getVersion().getVersion().getFhirVersionString());
}
}
}
diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/library/LibraryProcessor.java b/tooling/src/main/java/org/opencds/cqf/tooling/library/LibraryProcessor.java
index 11a950e65..9a87ee28f 100644
--- a/tooling/src/main/java/org/opencds/cqf/tooling/library/LibraryProcessor.java
+++ b/tooling/src/main/java/org/opencds/cqf/tooling/library/LibraryProcessor.java
@@ -41,7 +41,7 @@ public static String getId(String baseId) {
private static Pattern getPattern() {
if(pattern == null) {
- String regex = "^[a-zA-Z]+[a-zA-Z0-9_\\-\\.]*";
+ String regex = "^[a-zA-Z]+[a-zA-Z\\d_\\-.]*";
pattern = Pattern.compile(regex);
}
return pattern;
@@ -92,8 +92,8 @@ public List refreshIgLibraryContent(BaseProcessor parentContext, Encodin
public Boolean bundleLibraryDependencies(String path, FhirContext fhirContext, Map resources,
Encoding encoding, boolean versioned) {
String fileName = FilenameUtils.getName(path);
- boolean prefixed = fileName.toLowerCase().startsWith("library-");
- Boolean shouldPersist = true;
+ boolean prefixed = fileName.toLowerCase().startsWith(ResourcePrefix);
+ boolean shouldPersist = true;
try {
Map dependencies = ResourceUtils.getDepLibraryResources(path, fhirContext, encoding, versioned, logger);
// String currentResourceID = IOUtils.getTypeQualifiedResourceId(path, fhirContext);
@@ -163,7 +163,7 @@ protected Library refreshGeneratedContent(Library sourceLibrary) {
sourceLibrary.getParameter().clear();
sourceLibrary.getParameter().addAll(info.getParameters());
} else {
- logMessage(String.format("No cql info found for ", fileName));
+ logMessage("No cql info found for " + fileName);
//f.getErrors().add(new ValidationMessage(ValidationMessage.Source.Publisher, ValidationMessage.IssueType.NOTFOUND, "Library", "No cql info found for "+f.getName(), ValidationMessage.IssueSeverity.ERROR));
}
}
@@ -176,14 +176,14 @@ protected List refreshGeneratedContent(List sourceLibraries) {
}
public List refreshGeneratedContent(String cqlDirectoryPath, String fhirVersion) {
- List result = new ArrayList();
+ List result = new ArrayList<>();
File input = new File(cqlDirectoryPath);
if (input.exists() && input.isDirectory()) {
result.add(input.getAbsolutePath());
}
setBinaryPaths(result);
- List libraries = new ArrayList();
+ List libraries = new ArrayList<>();
return internalRefreshGeneratedContent(libraries);
}
@@ -217,7 +217,7 @@ private List internalRefreshGeneratedContent(List sourceLibrar
newLibrary.setId(newLibrary.getName() + (versioned ? "-" + newLibrary.getVersion() : ""));
setLibraryType(newLibrary);
validateIdAlphaNumeric(newLibrary.getId());
- List attachments = new ArrayList();
+ List attachments = new ArrayList<>();
Attachment attachment = new Attachment();
attachment.setContentType("application/elm+xml");
attachment.setData(fileInfo.getElm());
@@ -228,7 +228,7 @@ private List internalRefreshGeneratedContent(List sourceLibrar
}
}
- List resources = new ArrayList();
+ List resources = new ArrayList<>();
for (Library library : sourceLibraries) {
resources.add(refreshGeneratedContent(library));
}
@@ -250,6 +250,6 @@ private Attachment loadFile(String fn) throws IOException {
}
public List refreshLibraryContent(RefreshLibraryParameters params) {
- return new ArrayList();
+ return new ArrayList<>();
}
}
\ No newline at end of file
diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java b/tooling/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java
index 341bf7cdf..d2ccc37dc 100644
--- a/tooling/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java
+++ b/tooling/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java
@@ -35,6 +35,7 @@
import ca.uhn.fhir.context.FhirContext;
public class MeasureProcessor extends BaseProcessor {
+ private static final Logger logger = LoggerFactory.getLogger(MeasureProcessor.class);
public static final String ResourcePrefix = "measure-";
public static final String MeasureTestGroupName = "measure";
protected List