Skip to content

Commit 9694fc0

Browse files
authored
CQL 3.22.0 and HAPI 8.0.0 Update (#549)
Removed NPM classes in favor of translator classes
1 parent ed172f4 commit 9694fc0

31 files changed

Lines changed: 141 additions & 837 deletions

pom.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1515
<maven.compiler.release>11</maven.compiler.release>
16-
<cql.version>3.11.0</cql.version>
17-
<hapi.version>7.2.1</hapi.version>
16+
<cql.version>3.22.0</cql.version>
17+
<hapi.version>8.0.0</hapi.version>
1818
<spring-boot.version>2.1.5.RELEASE</spring-boot.version>
1919
<slf4j.version>2.0.5</slf4j.version>
2020
<jetty.version>11.0.20</jetty.version>
@@ -188,6 +188,12 @@
188188
<version>${cql.version}</version>
189189
</dependency>
190190

191+
<dependency>
192+
<groupId>info.cqframework</groupId>
193+
<artifactId>cqf-fhir-npm</artifactId>
194+
<version>${cql.version}</version>
195+
</dependency>
196+
191197
<dependency>
192198
<groupId>info.cqframework</groupId>
193199
<artifactId>elm-fhir</artifactId>
@@ -444,15 +450,15 @@
444450
<artifactId>maven-surefire-plugin</artifactId>
445451
<version>3.0.0-M5</version>
446452
<configuration>
447-
<argLine>-Xmx1024M</argLine>
453+
<argLine>-Xmx1024M</argLine>
448454
</configuration>
449455
</plugin>
450456
<plugin>
451457
<groupId>org.apache.maven.plugins</groupId>
452458
<artifactId>maven-failsafe-plugin</artifactId>
453459
<version>3.0.0-M5</version>
454460
<configuration>
455-
<argLine>-Xmx1024M</argLine>
461+
<argLine>-Xmx1024M</argLine>
456462
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
457463
</configuration>
458464
<executions>
@@ -508,14 +514,14 @@
508514
<groupId>org.apache.maven.plugins</groupId>
509515
<artifactId>maven-surefire-plugin</artifactId>
510516
<configuration>
511-
<argLine>-Xmx1024M ${argLine}</argLine>
517+
<argLine>-Xmx1024M ${argLine}</argLine>
512518
</configuration>
513519
</plugin>
514520
<plugin>
515521
<groupId>org.apache.maven.plugins</groupId>
516522
<artifactId>maven-failsafe-plugin</artifactId>
517523
<configuration>
518-
<argLine>-Xmx1024M ${argLine}</argLine>
524+
<argLine>-Xmx1024M ${argLine}</argLine>
519525
</configuration>
520526
</plugin>
521527
</plugins>
@@ -553,18 +559,18 @@
553559
<groupId>org.apache.maven.plugins</groupId>
554560
<artifactId>maven-surefire-plugin</artifactId>
555561
<configuration>
556-
<argLine>-Xmx1024M ${argLine}</argLine>
562+
<argLine>-Xmx1024M ${argLine}</argLine>
557563
</configuration>
558564
</plugin>
559565
<plugin>
560566
<groupId>org.apache.maven.plugins</groupId>
561567
<artifactId>maven-failsafe-plugin</artifactId>
562568
<configuration>
563-
<argLine>-Xmx1024M ${argLine}</argLine>
569+
<argLine>-Xmx1024M ${argLine}</argLine>
564570
</configuration>
565571
</plugin>
566572
</plugins>
567573
</build>
568574
</profile>
569575
</profiles>
570-
</project>
576+
</project>

tooling/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,14 @@
233233
<version>2.22.0</version>
234234
</dependency>
235235

236-
<!-- FHIR DAL -->
237236
<dependency>
238237
<groupId>info.cqframework</groupId>
239238
<artifactId>cqf-fhir</artifactId>
240239
</dependency>
240+
<dependency>
241+
<groupId>info.cqframework</groupId>
242+
<artifactId>cqf-fhir-npm</artifactId>
243+
</dependency>
241244
<dependency>
242245
<groupId>info.cqframework</groupId>
243246
<artifactId>cql-to-elm</artifactId>

tooling/src/main/java/org/opencds/cqf/tooling/library/LibraryProcessor.java

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,14 @@
11
package org.opencds.cqf.tooling.library;
22

3-
import java.io.File;
4-
import java.io.IOException;
5-
import java.util.ArrayList;
6-
import java.util.Collections;
7-
import java.util.List;
8-
import java.util.Map;
9-
import java.util.Queue;
10-
import java.util.Set;
11-
import java.util.concurrent.Callable;
12-
import java.util.concurrent.ConcurrentLinkedQueue;
13-
import java.util.regex.Pattern;
14-
3+
import ca.uhn.fhir.context.FhirContext;
4+
import com.google.common.base.Strings;
155
import org.apache.commons.io.FilenameUtils;
166
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
177
import org.cqframework.cql.cql2elm.CqlTranslator;
188
import org.cqframework.cql.cql2elm.CqlTranslatorOptions;
199
import org.cqframework.cql.cql2elm.CqlTranslatorOptions.Format;
2010
import org.hl7.fhir.instance.model.api.IBaseResource;
21-
import org.hl7.fhir.r5.model.Attachment;
22-
import org.hl7.fhir.r5.model.CodeableConcept;
23-
import org.hl7.fhir.r5.model.Coding;
24-
import org.hl7.fhir.r5.model.Extension;
25-
import org.hl7.fhir.r5.model.Library;
26-
import org.hl7.fhir.r5.model.Parameters;
27-
import org.hl7.fhir.r5.model.Reference;
28-
import org.hl7.fhir.r5.model.RelatedArtifact;
11+
import org.hl7.fhir.r5.model.*;
2912
import org.hl7.fhir.utilities.TextFile;
3013
import org.hl7.fhir.utilities.Utilities;
3114
import org.opencds.cqf.tooling.common.ThreadUtils;
@@ -41,9 +24,12 @@
4124
import org.slf4j.Logger;
4225
import org.slf4j.LoggerFactory;
4326

44-
import com.google.common.base.Strings;
45-
46-
import ca.uhn.fhir.context.FhirContext;
27+
import java.io.File;
28+
import java.io.IOException;
29+
import java.util.*;
30+
import java.util.concurrent.Callable;
31+
import java.util.concurrent.ConcurrentLinkedQueue;
32+
import java.util.regex.Pattern;
4733

4834
public class LibraryProcessor extends BaseProcessor {
4935
private static final Logger logger = LoggerFactory.getLogger(LibraryProcessor.class);
@@ -69,15 +55,15 @@ public static void validateIdAlphaNumeric(String id) {
6955
}
7056
}
7157

72-
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) {
58+
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) throws IOException {
7359
return refreshIgLibraryContent(parentContext, outputEncoding, null, null, versioned, fhirContext, shouldApplySoftwareSystemStamp);
7460
}
7561

76-
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, String libraryOutputDirectory, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) {
62+
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, String libraryOutputDirectory, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) throws IOException {
7763
return refreshIgLibraryContent(parentContext, outputEncoding, null, libraryOutputDirectory, versioned, fhirContext, shouldApplySoftwareSystemStamp);
7864
}
7965

80-
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, String libraryPath, String libraryOutputDirectory, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) {
66+
public List<String> refreshIgLibraryContent(BaseProcessor parentContext, Encoding outputEncoding, String libraryPath, String libraryOutputDirectory, Boolean versioned, FhirContext fhirContext, Boolean shouldApplySoftwareSystemStamp) throws IOException {
8167
logger.info("[Refreshing Libraries]");
8268

8369
LibraryProcessor libraryProcessor;
@@ -334,7 +320,7 @@ private List<Library> internalRefreshGeneratedContent(List<Library> sourceLibrar
334320
{
335321
logger.warn("No identifier found for CQL file {}", fileInfo.getPath());
336322
}
337-
323+
338324
}
339325

340326
List<Library> resources = new ArrayList<Library>();
@@ -358,7 +344,7 @@ private Attachment loadFile(String fn) throws IOException {
358344
return null;
359345
}
360346

361-
public List<String> refreshLibraryContent(RefreshLibraryParameters params) {
347+
public List<String> refreshLibraryContent(RefreshLibraryParameters params) throws IOException {
362348
return new ArrayList<String>();
363349
}
364-
}
350+
}

tooling/src/main/java/org/opencds/cqf/tooling/library/r4/R4LibraryProcessor.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
package org.opencds.cqf.tooling.library.r4;
22

3-
import java.io.File;
4-
import java.util.ArrayList;
5-
import java.util.HashMap;
6-
import java.util.List;
7-
import java.util.Map;
8-
3+
import ca.uhn.fhir.context.FhirContext;
94
import com.google.common.base.Strings;
10-
115
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
126
import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50;
137
import org.hl7.fhir.r4.formats.FormatUtilities;
@@ -19,7 +13,12 @@
1913
import org.opencds.cqf.tooling.utilities.IOUtils;
2014
import org.opencds.cqf.tooling.utilities.IOUtils.Encoding;
2115

22-
import ca.uhn.fhir.context.FhirContext;
16+
import java.io.File;
17+
import java.io.IOException;
18+
import java.util.ArrayList;
19+
import java.util.HashMap;
20+
import java.util.List;
21+
import java.util.Map;
2322

2423
public class R4LibraryProcessor extends LibraryProcessor {
2524
private String libraryPath;
@@ -77,7 +76,7 @@ else if (file.isDirectory()) {
7776
for (org.hl7.fhir.r5.model.Library refreshedLibrary : refreshedLibraries) {
7877
Library library = (Library) versionConvertor_40_50.convertResource(refreshedLibrary);
7978
String filePath = null;
80-
Encoding fileEncoding = null;
79+
Encoding fileEncoding = null;
8180
if (fileMap.containsKey(refreshedLibrary.getId()))
8281
{
8382
filePath = fileMap.get(refreshedLibrary.getId());
@@ -134,7 +133,7 @@ private void loadLibrary(Map<String, String> fileMap, List<org.hl7.fhir.r5.model
134133
}
135134

136135
@Override
137-
public List<String> refreshLibraryContent(RefreshLibraryParameters params) {
136+
public List<String> refreshLibraryContent(RefreshLibraryParameters params) throws IOException {
138137
if (params.parentContext != null) {
139138
initialize(params.parentContext);
140139
}

tooling/src/main/java/org/opencds/cqf/tooling/library/stu3/STU3LibraryProcessor.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
package org.opencds.cqf.tooling.library.stu3;
22

3-
import java.io.File;
4-
import java.util.ArrayList;
5-
import java.util.Arrays;
6-
import java.util.HashMap;
7-
import java.util.List;
8-
import java.util.Map;
9-
3+
import ca.uhn.fhir.context.FhirContext;
104
import com.google.common.base.Strings;
11-
125
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50;
136
import org.hl7.fhir.convertors.conv30_50.VersionConvertor_30_50;
147
import org.hl7.fhir.dstu3.model.Library;
@@ -19,7 +12,9 @@
1912
import org.opencds.cqf.tooling.parameter.RefreshLibraryParameters;
2013
import org.opencds.cqf.tooling.utilities.IOUtils;
2114

22-
import ca.uhn.fhir.context.FhirContext;
15+
import java.io.File;
16+
import java.io.IOException;
17+
import java.util.*;
2318

2419
public class STU3LibraryProcessor extends LibraryProcessor {
2520
private String libraryPath;
@@ -32,7 +27,7 @@ public class STU3LibraryProcessor extends LibraryProcessor {
3227
protected List<String> refreshLibraries(String libraryPath, Boolean shouldApplySoftwareSystemStamp) {
3328
return refreshLibraries(libraryPath, null, shouldApplySoftwareSystemStamp);
3429
}
35-
30+
3631
/*
3732
Refresh all library resources in the given libraryPath and write to the given outputDirectory
3833
*/
@@ -102,7 +97,7 @@ private void cleanseRelatedArtifactReferences(Library library) {
10297
if (resourceReference.contains("Library/")) {
10398
resourceReference = resourceReference.substring(resourceReference.lastIndexOf("Library/"));
10499
}
105-
100+
106101
if (resourceReference.contains("|")) {
107102
if (this.versioned) {
108103
String curatedResourceReference = resourceReference.replace("|", "-");
@@ -131,7 +126,7 @@ private void loadLibrary(Map<String, String> fileMap, List<org.hl7.fhir.r5.model
131126
}
132127

133128
@Override
134-
public List<String> refreshLibraryContent(RefreshLibraryParameters params) {
129+
public List<String> refreshLibraryContent(RefreshLibraryParameters params) throws IOException {
135130
if (params.parentContext != null) {
136131
initialize(params.parentContext);
137132
}

tooling/src/main/java/org/opencds/cqf/tooling/measure/MeasureProcessor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.opencds.cqf.tooling.utilities.*;
1616
import org.opencds.cqf.tooling.utilities.IOUtils.Encoding;
1717

18+
import java.io.IOException;
1819
import java.util.ArrayList;
1920
import java.util.List;
2021
import java.util.concurrent.CopyOnWriteArrayList;
@@ -28,7 +29,7 @@ public static String getId(String baseId) {
2829
}
2930

3031
public List<String> refreshIgMeasureContent(BaseProcessor parentContext, Encoding outputEncoding, Boolean versioned, FhirContext fhirContext,
31-
String measureToRefreshPath, Boolean shouldApplySoftwareSystemStamp, Boolean shouldIncludePopDataRequirements) {
32+
String measureToRefreshPath, Boolean shouldApplySoftwareSystemStamp, Boolean shouldIncludePopDataRequirements) throws IOException {
3233

3334
return refreshIgMeasureContent(parentContext, outputEncoding, null, versioned, fhirContext, measureToRefreshPath,
3435
shouldApplySoftwareSystemStamp, shouldIncludePopDataRequirements);
@@ -38,7 +39,7 @@ public List<String> refreshIgMeasureContent(BaseProcessor parentContext, Encodin
3839

3940
public List<String> refreshIgMeasureContent(BaseProcessor parentContext, Encoding outputEncoding, String measureOutputDirectory,
4041
Boolean versioned, FhirContext fhirContext, String measureToRefreshPath,
41-
Boolean shouldApplySoftwareSystemStamp, Boolean shouldIncludePopDataRequirements) {
42+
Boolean shouldApplySoftwareSystemStamp, Boolean shouldIncludePopDataRequirements) throws IOException {
4243

4344
logger.info("[Refreshing Measures]");
4445

@@ -83,7 +84,7 @@ protected List<Object> getIdentifiers() {
8384
protected boolean versioned;
8485
protected FhirContext fhirContext;
8586

86-
public List<String> refreshMeasureContent(RefreshMeasureParameters params) {
87+
public List<String> refreshMeasureContent(RefreshMeasureParameters params) throws IOException {
8788
return new ArrayList<>();
8889
}
8990

tooling/src/main/java/org/opencds/cqf/tooling/measure/r4/R4MeasureProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.opencds.cqf.tooling.utilities.ResourceUtils;
2020

2121
import java.io.File;
22+
import java.io.IOException;
2223
import java.util.*;
2324
import java.util.concurrent.CopyOnWriteArrayList;
2425

@@ -180,7 +181,7 @@ private Measure refreshGeneratedContent(Measure measure, MeasureRefreshProcessor
180181
}
181182

182183
@Override
183-
public List<String> refreshMeasureContent(RefreshMeasureParameters params) {
184+
public List<String> refreshMeasureContent(RefreshMeasureParameters params) throws IOException {
184185
if (params.parentContext != null) {
185186
initialize(params.parentContext);
186187
}

tooling/src/main/java/org/opencds/cqf/tooling/npm/ILibraryReader.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)