Skip to content

Commit

Permalink
Remove usages of interfaces deprecated in latest FHIR core (#1414)
Browse files Browse the repository at this point in the history
* Remove usages of interfaces deprecated in latest FHIR core

* Fix formatting
  • Loading branch information
JPercival authored Sep 16, 2024
1 parent 00dbded commit aa17eaf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.List;
import org.cqframework.cql.cql2elm.LibrarySourceProvider;
import org.hl7.elm.r1.VersionedIdentifier;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.ILoggingService;
import org.hl7.fhir.r5.model.Library;
import org.hl7.fhir.utilities.npm.NpmPackage;

Expand All @@ -15,16 +15,15 @@
*/
public class NpmLibrarySourceProvider implements LibrarySourceProvider {

public NpmLibrarySourceProvider(
List<NpmPackage> packages, ILibraryReader reader, IWorkerContext.ILoggingService logger) {
public NpmLibrarySourceProvider(List<NpmPackage> packages, ILibraryReader reader, ILoggingService logger) {
this.packages = packages;
this.reader = reader;
this.logger = logger;
}

private List<NpmPackage> packages;
private ILibraryReader reader;
private IWorkerContext.ILoggingService logger;
private ILoggingService logger;

@Override
public InputStream getLibrarySource(VersionedIdentifier identifier) {
Expand Down Expand Up @@ -59,7 +58,7 @@ public InputStream getLibrarySource(VersionedIdentifier identifier) {
}
} catch (IOException e) {
logger.logDebugMessage(
IWorkerContext.ILoggingService.LogCategory.PROGRESS,
ILoggingService.LogCategory.PROGRESS,
String.format(
"Exceptions occurred attempting to load npm library source for %s",
identifier.toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.hl7.cql.model.ModelIdentifier;
import org.hl7.cql.model.ModelInfoProvider;
import org.hl7.elm_modelinfo.r1.ModelInfo;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.ILoggingService;
import org.hl7.fhir.r5.model.Library;
import org.hl7.fhir.utilities.npm.NpmPackage;

Expand All @@ -17,16 +17,15 @@
*/
public class NpmModelInfoProvider implements ModelInfoProvider {

public NpmModelInfoProvider(
List<NpmPackage> packages, ILibraryReader reader, IWorkerContext.ILoggingService logger) {
public NpmModelInfoProvider(List<NpmPackage> packages, ILibraryReader reader, ILoggingService logger) {
this.packages = packages;
this.reader = reader;
this.logger = logger;
}

private List<NpmPackage> packages;
private ILibraryReader reader;
private IWorkerContext.ILoggingService logger;
private ILoggingService logger;

public ModelInfo load(ModelIdentifier modelIdentifier) {
// VersionedIdentifier.id: Name of the model
Expand Down Expand Up @@ -60,7 +59,7 @@ public ModelInfo load(ModelIdentifier modelIdentifier) {
}
} catch (IOException e) {
logger.logDebugMessage(
IWorkerContext.ILoggingService.LogCategory.PROGRESS,
ILoggingService.LogCategory.PROGRESS,
String.format(
"Exceptions occurred attempting to load npm library for model %s",
modelIdentifier.toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.ILoggingService;
import org.hl7.fhir.r5.model.ImplementationGuide;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class NpmPackageManager implements IWorkerContext.ILoggingService {
public class NpmPackageManager implements ILoggingService {
private static final Logger logger = LoggerFactory.getLogger(NpmPackageManager.class);
private final ImplementationGuide sourceIg;
private final FilesystemPackageCacheManager fspcm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50;
import org.hl7.fhir.r4.model.Resource;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.ILoggingService;
import org.hl7.fhir.r5.model.ImplementationGuide;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class NpmPackageManagerTests implements IWorkerContext.ILoggingService {
public class NpmPackageManagerTests implements ILoggingService {

private final Logger logger = LoggerFactory.getLogger(NpmPackageManagerTests.class);
private final VersionConvertor_40_50 convertor = new VersionConvertor_40_50(new BaseAdvisor_40_50());
Expand Down Expand Up @@ -134,7 +134,7 @@ public void logMessage(String msg) {
}

@Override
public void logDebugMessage(IWorkerContext.ILoggingService.LogCategory category, String msg) {
public void logDebugMessage(ILoggingService.LogCategory category, String msg) {
logMessage(msg);
}

Expand Down

0 comments on commit aa17eaf

Please sign in to comment.