Skip to content

Commit

Permalink
Fixes for 3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
JPercival committed Nov 28, 2023
1 parent 8b356fd commit 1b5ecad
Show file tree
Hide file tree
Showing 20 changed files with 265 additions and 371 deletions.
25 changes: 3 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@

<groupId>org.opencds.cqf</groupId>
<artifactId>tooling-parent</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>

<packaging>pom</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cql-engine.version>3.3.2</cql-engine.version>
<cql-evaluator.version>2.6.0</cql-evaluator.version>
<cqframework.version>3.3.2</cqframework.version>
<hapi.version>6.8.0</hapi.version>
<core.version>6.0.22</core.version>
<hapi.version>6.8.5</hapi.version>
<core.version>6.0.22.2</core.version>
<spring-boot.version>2.1.5.RELEASE</spring-boot.version>
</properties>

Expand Down Expand Up @@ -106,28 +105,10 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>evaluator.builder</artifactId>
<version>${cql-evaluator.version}</version>
</dependency>

<dependency>
<groupId>org.opencds.cqf.cql</groupId>
<artifactId>evaluator.jaxb-deps</artifactId>
<version>${cql-evaluator.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>engine</artifactId>
<version>${cql-engine.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
Expand Down
18 changes: 8 additions & 10 deletions tooling-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>org.opencds.cqf</groupId>
<artifactId>tooling-parent</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>tooling-cli</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<description>CQF Tooling CLI</description>
Expand All @@ -19,20 +19,18 @@
<dependency>
<groupId>org.opencds.cqf</groupId>
<artifactId>tooling</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.opencds.cqf.cql</groupId>
<artifactId>evaluator.jaxb-deps</artifactId>
<type>pom</type>
</dependency>

<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>org.reflections</groupId>
Expand Down
18 changes: 2 additions & 16 deletions tooling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>org.opencds.cqf</groupId>
<artifactId>tooling-parent</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>tooling</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand Down Expand Up @@ -272,26 +272,12 @@
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.opencds.cqf.cql</groupId>
<artifactId>evaluator.jaxb-deps</artifactId>
<version>${cql-evaluator.version}</version>
<type>pom</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.7.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opencds.cqf.cql</groupId>
<artifactId>evaluator.builder</artifactId>
<version>${cql-evaluator.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import java.util.Collection;
import java.util.List;

import ca.uhn.fhir.narrative.BaseThymeleafNarrativeGenerator;
import com.google.common.base.Charsets;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.Validate;
import org.hl7.fhir.instance.model.api.IBaseResource;

import com.google.common.base.Charsets;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.narrative.BaseThymeleafNarrativeGenerator;
import ca.uhn.fhir.narrative2.NarrativeTemplateManifest;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;

Expand All @@ -28,9 +28,10 @@ public class JarEnabledCustomThymeleafNarrativeGenerator extends BaseThymeleafNa

public JarEnabledCustomThymeleafNarrativeGenerator(String... thePropertyFile) {
super();
setPropertyFile(thePropertyFile);
var propFile = Arrays.asList(thePropertyFile);
this.myPropertyFile = propFile;
try {
manifest = forManifestFileLocation(getPropertyFile());
this.manifest = forManifestFileLocation(propFile);
} catch (IOException e) {
throw new InternalErrorException(e);
}
Expand All @@ -46,7 +47,7 @@ public boolean populateResourceNarrative(FhirContext theFhirContext, IBaseResour
protected NarrativeTemplateManifest getManifest() {
return this.manifest;
}

public static NarrativeTemplateManifest forManifestFileLocation(Collection<String> thePropertyFilePaths) throws IOException {
List<String> manifestFileContents = new ArrayList<>(thePropertyFilePaths.size());
for (String next : thePropertyFilePaths) {
Expand All @@ -56,7 +57,7 @@ public static NarrativeTemplateManifest forManifestFileLocation(Collection<Strin

return NarrativeTemplateManifest.forManifestFileContents(manifestFileContents);
}

static String loadResourceAlsoFromJar(String name) throws IOException {
if (name.startsWith("classpath:")) {
String cpName = name.substring("classpath:".length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class VmrToFhirElmBuilder extends VmrToModelElmBuilder {
* @param modelVersion modelVersion
* @param decimalFormat decimalFormat
*/
@SuppressWarnings("this-escape")
public VmrToFhirElmBuilder(String modelVersion, DecimalFormat decimalFormat) {
super("FHIR", modelVersion, "http://hl7.org/FHIR", new FhirLibrarySourceProvider(), decimalFormat);
IncludeDef includeHelper = of.createIncludeDef().withLocalIdentifier("FHIRHelpers").withPath("FHIRHelpers")
Expand Down Expand Up @@ -184,7 +185,7 @@ private Expression buildModelingB(LibraryBuilder libraryBuilder) {
codeRefs.setResultType(new ListType(finalCodeRef.getResultType()));

String filterPath = "status";

Retrieve retrieve = resolveRetrieve(libraryBuilder, resource, null, null, null);
AliasedQuerySource source = of.createAliasedQuerySource().withAlias(retrieveAlias).withExpression(retrieve);
source.setResultType(source.getExpression().getResultType());
Expand All @@ -200,7 +201,7 @@ private Expression buildModelingB(LibraryBuilder libraryBuilder) {
* [MedicationAdministration] M return M.reasonCode // TODO: Work out the "include" capability
* union
* (
* [MedicationAdministration] M
* [MedicationAdministration] M
* let reasonConditions: [Condition: id in (M.reasonReference R return GetTail(R.reference))]
* return reasonConditions.code
* )
Expand Down Expand Up @@ -535,7 +536,7 @@ private Expression buildWhereReturnPathQuery(AliasedQuerySource source, LibraryB
Query query = resolveQuery(libraryBuilder, sources, elements);

Expression right = query;

Expression where = libraryBuilder.resolveIn(left, right);
return where;
}
Expand Down Expand Up @@ -669,7 +670,7 @@ private Query letConditionReturnQuery(LibraryBuilder libraryBuilder, String reso
Expression idList = of.createList().withElement(letQuery);
idList.setResultType(new ListType(letQuery.getResultType()));
Retrieve conditionRetrieve = resolveRetrieve(libraryBuilder, "Condition", idList, "in", "id");

LetClause let = of.createLetClause().withIdentifier("reasonConditions").withExpression(conditionRetrieve);
let.setResultType(conditionRetrieve.getResultType());
elements.add(let);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

public class LibraryGenerator extends BaseLibraryGenerator<Library, NarrativeProvider> {

@SuppressWarnings("this-escape")
public LibraryGenerator() {
setNarrativeProvider(new NarrativeProvider());
setFhirContext(FhirContext.forR4Cached());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class LibraryGenerator extends BaseLibraryGenerator<Library, NarrativePro

private Map<String, IBaseResource> libraryMap = new HashMap<>();

@SuppressWarnings("this-escape")
public LibraryGenerator() {
setNarrativeProvider(new NarrativeProvider());
setFhirContext(FhirContext.forDstu3Cached());
Expand All @@ -48,7 +49,7 @@ public void processLibrary(String id, CqlTranslator translator) {
if (elm.getIncludes() != null && !elm.getIncludes().getDef().isEmpty()) {
for (IncludeDef def : elm.getIncludes().getDef()) {
addRelatedArtifact(library, def);
}
}
}

resolveDataRequirements(library, translator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class LibraryRefresher extends BaseLibraryGenerator<Library, NarrativePro

private Map<String, IBaseResource> libraryMap = new HashMap<>();

@SuppressWarnings("this-escape")
public LibraryRefresher() {
setNarrativeProvider(new NarrativeProvider());
setFhirContext(FhirContext.forDstu3Cached());
Expand All @@ -43,7 +44,7 @@ public void processLibrary(String id, CqlTranslator translator) {
if (elm.getIncludes() != null && !elm.getIncludes().getDef().isEmpty()) {
for (IncludeDef def : elm.getIncludes().getDef()) {
addRelatedArtifact(generatedLibrary, def);
}
}
}

resolveDataRequirements(generatedLibrary, translator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import java.text.SimpleDateFormat;
import java.util.Objects;

import ca.uhn.fhir.parser.IParser;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.opencds.cqf.tooling.utilities.HttpClientUtils;
import org.opencds.cqf.tooling.utilities.LogUtils;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import org.opencds.cqf.tooling.utilities.HttpClientUtils;
import org.opencds.cqf.tooling.utilities.LogUtils;

public abstract class FhirServerMeasureTestAdapter extends MeasureTestAdapter {

Expand Down Expand Up @@ -60,7 +60,7 @@ private IMeasureReportAdapter parseEvaluatedResponse(String response) {
IParser parser = fhirContext.newJsonParser();
measureReport = parser.parseResource(response);

measureReportAdapter = this.getMeasureReportAdapter(measureReport);
measureReportAdapter = getMeasureReportAdapter(this.fhirContext, measureReport);
return measureReportAdapter;
}
}
Loading

0 comments on commit 1b5ecad

Please sign in to comment.