From 5c8bec85e5abd2269037af4b1790e8968688fb11 Mon Sep 17 00:00:00 2001 From: Mint Thompson Date: Tue, 25 Jul 2023 09:52:16 -0400 Subject: [PATCH] Load the same automatic dependencies as SUSHI (#228) * Load the same automatic dependencies as SUSHI Use SUSHI's function for loading automatic dependencies. There is a minor discrepancy in the expected type, but the FHIR definitions are only passed in so they can be passed to fhir-package-loader's mergeDependency function. So, the ts-ignore here should be safe. Add a note indicating the reason for the ts-ignore and the conditions under which it can be removed. * Refactor dependency loading operations All dependency loading is now handled by loadExternalDependencies. This function is used in both command-line and API modes. This function determines the core FHIR package, loads automatic dependencies (as defined by SUSHI), and loads configured dependencies. * Check for core package before adding it * Further update to FPL dependency --- package-lock.json | 133 ++++++++++++++++++++++++++++++++-- package.json | 2 +- src/api/FhirToFsh.ts | 17 +---- src/app.ts | 17 +---- src/utils/Processing.ts | 24 +++++- test/api/FhirToFsh.test.ts | 64 ++++++---------- test/utils/Processing.test.ts | 98 +++++++++++++++++++++++-- 7 files changed, 270 insertions(+), 85 deletions(-) diff --git a/package-lock.json b/package-lock.json index 930a0d30..5187a6d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "diff": "^5.0.0", "diff2html": "^3.1.18", "fhir": "^4.10.0", - "fhir-package-loader": "^0.3.0", + "fhir-package-loader": "^0.5.0", "flat": "^5.0.2", "fs-extra": "^9.0.1", "fsh-sushi": "^3.1.0", @@ -2952,9 +2952,9 @@ } }, "node_modules/fhir-package-loader": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/fhir-package-loader/-/fhir-package-loader-0.3.0.tgz", - "integrity": "sha512-+S1jC8OxFWTeD6Ro+76/29Tk9ffIYIxpOvfEFu1qlnWLNzvTuTI7uM0RjOW79sD1TWv9XWaZRKTIPZooioMUbQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fhir-package-loader/-/fhir-package-loader-0.5.0.tgz", + "integrity": "sha512-Q+W+l0jNLkpC2lUCIbtJ76P7xUvU3Bady/dcHo6f45q/CpFtvE9DyfeSNIGJZwpI72IIVZe5lvZ+lA58CGoVuA==", "dependencies": { "axios": "^0.21.1", "chalk": "^4.1.2", @@ -2962,6 +2962,7 @@ "fs-extra": "^10.0.0", "https-proxy-agent": "^5.0.0", "lodash": "^4.17.21", + "semver": "^7.5.4", "tar": "^5.0.11", "temp": "^0.9.1", "winston": "^3.3.3" @@ -3370,6 +3371,72 @@ "xml-js": "^1.6.8" } }, + "node_modules/fsh-sushi/node_modules/fhir-package-loader": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/fhir-package-loader/-/fhir-package-loader-0.3.0.tgz", + "integrity": "sha512-+S1jC8OxFWTeD6Ro+76/29Tk9ffIYIxpOvfEFu1qlnWLNzvTuTI7uM0RjOW79sD1TWv9XWaZRKTIPZooioMUbQ==", + "dependencies": { + "axios": "^0.21.1", + "chalk": "^4.1.2", + "commander": "^8.3.0", + "fs-extra": "^10.0.0", + "https-proxy-agent": "^5.0.0", + "lodash": "^4.17.21", + "tar": "^5.0.11", + "temp": "^0.9.1", + "winston": "^3.3.3" + }, + "bin": { + "fpl": "dist/app.js" + } + }, + "node_modules/fsh-sushi/node_modules/fhir-package-loader/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/fsh-sushi/node_modules/fhir-package-loader/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fsh-sushi/node_modules/fhir-package-loader/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/fsh-sushi/node_modules/fhir-package-loader/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/fsh-sushi/node_modules/fhir/node_modules/inherits": { "version": "2.0.3", "inBundle": true, @@ -9252,9 +9319,9 @@ } }, "fhir-package-loader": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/fhir-package-loader/-/fhir-package-loader-0.3.0.tgz", - "integrity": "sha512-+S1jC8OxFWTeD6Ro+76/29Tk9ffIYIxpOvfEFu1qlnWLNzvTuTI7uM0RjOW79sD1TWv9XWaZRKTIPZooioMUbQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fhir-package-loader/-/fhir-package-loader-0.5.0.tgz", + "integrity": "sha512-Q+W+l0jNLkpC2lUCIbtJ76P7xUvU3Bady/dcHo6f45q/CpFtvE9DyfeSNIGJZwpI72IIVZe5lvZ+lA58CGoVuA==", "requires": { "axios": "^0.21.1", "chalk": "^4.1.2", @@ -9262,6 +9329,7 @@ "fs-extra": "^10.0.0", "https-proxy-agent": "^5.0.0", "lodash": "^4.17.21", + "semver": "^7.5.4", "tar": "^5.0.11", "temp": "^0.9.1", "winston": "^3.3.3" @@ -9563,6 +9631,57 @@ } } }, + "fhir-package-loader": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/fhir-package-loader/-/fhir-package-loader-0.3.0.tgz", + "integrity": "sha512-+S1jC8OxFWTeD6Ro+76/29Tk9ffIYIxpOvfEFu1qlnWLNzvTuTI7uM0RjOW79sD1TWv9XWaZRKTIPZooioMUbQ==", + "requires": { + "axios": "^0.21.1", + "chalk": "^4.1.2", + "commander": "^8.3.0", + "fs-extra": "^10.0.0", + "https-proxy-agent": "^5.0.0", + "lodash": "^4.17.21", + "tar": "^5.0.11", + "temp": "^0.9.1", + "winston": "^3.3.3" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + } + } + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", diff --git a/package.json b/package.json index 60860f25..f6a170d1 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "diff": "^5.0.0", "diff2html": "^3.1.18", "fhir": "^4.10.0", - "fhir-package-loader": "^0.3.0", + "fhir-package-loader": "^0.5.0", "flat": "^5.0.2", "fs-extra": "^9.0.1", "fsh-sushi": "^3.1.0", diff --git a/src/api/FhirToFsh.ts b/src/api/FhirToFsh.ts index 6a4a0afa..6b609719 100644 --- a/src/api/FhirToFsh.ts +++ b/src/api/FhirToFsh.ts @@ -1,14 +1,13 @@ -import { fhirtypes, fshtypes, utils } from 'fsh-sushi'; +import { fshtypes, utils } from 'fsh-sushi'; import { - determineCorePackageId, FHIRDefinitions, getResources, isProcessableContent, - loadExternalDependencies, MasterFisher, logger, errorsAndWarnings, - ErrorsAndWarnings + ErrorsAndWarnings, + loadExternalDependencies } from '../utils'; import { FHIRProcessor, LakeOfFHIR, WildFHIR } from '../processor'; import { FSHExporter } from '../export'; @@ -81,15 +80,7 @@ export async function fhirToFsh( ); // Load dependencies, including those inferred from an IG file, and those given as input - const dependencies = - configuration.config.dependencies?.map( - (dep: fhirtypes.ImplementationGuideDependsOn) => `${dep.packageId}@${dep.version}` - ) ?? []; - const fhirPackageId = determineCorePackageId(configuration.config.fhirVersion[0]); - if (!dependencies.includes(`${fhirPackageId}@${configuration.config.fhirVersion[0]}`)) { - dependencies.push(`${fhirPackageId}@${configuration.config.fhirVersion[0]}`); - } - await Promise.all(loadExternalDependencies(defs, dependencies)); + await loadExternalDependencies(defs, configuration); // Process the FHIR to rules, and then export to FSH const pkg = await getResources(processor, configuration, processingOptions); diff --git a/src/app.ts b/src/app.ts index 71e0fa9a..8d073819 100644 --- a/src/app.ts +++ b/src/app.ts @@ -5,22 +5,21 @@ import fs from 'fs-extra'; import program from 'commander'; import chalk from 'chalk'; import { pad, padStart, padEnd } from 'lodash'; -import { fhirtypes, utils } from 'fsh-sushi'; +import { utils } from 'fsh-sushi'; import { - determineCorePackageId, ensureOutputDir, FHIRDefinitions, getInputDir, getAliasFile, getFhirProcessor, getResources, - loadExternalDependencies, writeFSH, logger, stats, fshingTrip, getRandomPun, - ProcessingOptions + ProcessingOptions, + loadExternalDependencies } from './utils'; import { Package, AliasProcessor } from './processor'; import { ExportableAlias } from './exportable'; @@ -202,15 +201,7 @@ async function app() { const config = processor.processConfig(dependencies, specifiedFHIRVersion); // Load dependencies from config for GoFSH processing - const allDependencies = - config.config.dependencies?.map( - (dep: fhirtypes.ImplementationGuideDependsOn) => `${dep.packageId}@${dep.version}` - ) ?? []; - const fhirPackageId = determineCorePackageId(config.config.fhirVersion[0]); - allDependencies.push(`${fhirPackageId}@${config.config.fhirVersion[0]}`); - const dependencyDefs = loadExternalDependencies(defs, allDependencies); - - await Promise.all(dependencyDefs); + await loadExternalDependencies(defs, config); let pkg: Package; try { diff --git a/src/utils/Processing.ts b/src/utils/Processing.ts index 1e3b2106..6dbebcb3 100644 --- a/src/utils/Processing.ts +++ b/src/utils/Processing.ts @@ -4,6 +4,7 @@ import ini from 'ini'; import readlineSync from 'readline-sync'; import { mergeDependency } from 'fhir-package-loader'; import { logger, logMessage } from './GoFSHLogger'; +import { fhirtypes, utils } from 'fsh-sushi'; import { Package, FHIRProcessor, @@ -112,7 +113,28 @@ export function writeFSH(resources: Package, outDir: string, style: string): voi } } -export function loadExternalDependencies( +export async function loadExternalDependencies( + defs: FHIRDefinitions, + config: ExportableConfiguration +) { + const allDependencies = + config.config.dependencies?.map( + (dep: fhirtypes.ImplementationGuideDependsOn) => `${dep.packageId}@${dep.version}` + ) ?? []; + const fhirPackageId = determineCorePackageId(config.config.fhirVersion[0]); + if (!allDependencies.includes(`${fhirPackageId}@${config.config.fhirVersion[0]}`)) { + allDependencies.push(`${fhirPackageId}@${config.config.fhirVersion[0]}`); + } + await utils.loadAutomaticDependencies( + config.config.fhirVersion[0], + config.config.dependencies ?? [], + // @ts-ignore TODO: this can be removed once SUSHI changes the type signature for this function to use FPL's FHIRDefinitions type + defs + ); + await Promise.all(loadConfiguredDependencies(defs, allDependencies)); +} + +export function loadConfiguredDependencies( defs: FHIRDefinitions, dependencies: string[] = [] ): Promise[] { diff --git a/test/api/FhirToFsh.test.ts b/test/api/FhirToFsh.test.ts index 1a77fd49..f1a75b49 100644 --- a/test/api/FhirToFsh.test.ts +++ b/test/api/FhirToFsh.test.ts @@ -2,7 +2,7 @@ import fs from 'fs-extra'; import path from 'path'; import * as processing from '../../src/utils/Processing'; import { fshtypes } from 'fsh-sushi'; -import { logger } from '../../src/utils'; +import { FHIRDefinitions, logger } from '../../src/utils'; import { fhirToFsh, ResourceMap } from '../../src/api'; import { loggerSpy } from '../helpers/loggerSpy'; import { EOL } from 'os'; @@ -40,7 +40,7 @@ describe('fhirToFsh', () => { loadSpy = jest.spyOn(processing, 'loadExternalDependencies').mockImplementation(defs => { defs.add(sd); defs.add(patient); - return [undefined]; + return Promise.resolve(); }); defaultConfig = { FSHOnly: true, @@ -111,50 +111,28 @@ describe('fhirToFsh', () => { expect(results.configuration).toEqual(defaultConfig); }); - it('should load dependencies from user input', async () => { - // Should be able to accept both # and @ style for dependencies - const results = await fhirToFsh([], { + it('should try to load external dependencies', async () => { + await fhirToFsh([], { dependencies: ['hl7.fhir.us.core#3.1.0', 'hl7.fhir.us.mcode@1.0.0'] }); - expect(results.errors).toHaveLength(0); - expect(results.warnings).toHaveLength(1); - expect(results.warnings[0].message).toMatch('Could not determine FHIR version. Using 4.0.1.'); - expect(results.fsh).toEqual(''); - expect(results.configuration).toEqual({ - ...defaultConfig, - dependencies: [ - { packageId: 'hl7.fhir.us.core', version: '3.1.0' }, - { packageId: 'hl7.fhir.us.mcode', version: '1.0.0' } - ] - }); - - expect(loadSpy.mock.calls).toHaveLength(1); - expect(loadSpy.mock.calls[0][1]).toEqual([ - 'hl7.fhir.us.core@3.1.0', - 'hl7.fhir.us.mcode@1.0.0', - 'hl7.fhir.r4.core@4.0.1' - ]); - }); - - it('should load FHIR R4B when specified in config fhirVersion', async () => { - // Loads R4B from fhirVersion - const results = await fhirToFsh([ - JSON.stringify({ - resourceType: 'StructureDefinition', - name: 'Foo', - baseDefinition: 'http://hl7.org/fhir/StructureDefinition/Patient', - derivation: 'constraint', - fhirVersion: '4.3.0' // FHIR R4B + expect(loadSpy).toHaveBeenCalledTimes(1); + expect(loadSpy).toHaveBeenCalledWith( + expect.any(FHIRDefinitions), + expect.objectContaining({ + config: expect.objectContaining({ + dependencies: [ + { + packageId: 'hl7.fhir.us.core', + version: '3.1.0' + }, + { + packageId: 'hl7.fhir.us.mcode', + version: '1.0.0' + } + ] + }) }) - ]); - expect(results.errors).toHaveLength(0); - expect(results.warnings).toHaveLength(0); - expect(results.configuration).toEqual({ - ...defaultConfig, - fhirVersion: ['4.3.0'] - }); - expect(loadSpy.mock.calls).toHaveLength(1); - expect(loadSpy.mock.calls[0][1]).toEqual(['hl7.fhir.r4b.core@4.3.0']); + ); }); it('should parse a string input into JSON', async () => { diff --git a/test/utils/Processing.test.ts b/test/utils/Processing.test.ts index 2e985c35..5d11bcc2 100644 --- a/test/utils/Processing.test.ts +++ b/test/utils/Processing.test.ts @@ -9,7 +9,7 @@ import { ensureOutputDir, getInputDir, getResources, - loadExternalDependencies, + loadConfiguredDependencies, writeFSH, getIgPathFromIgIni, getFhirProcessor, @@ -25,7 +25,7 @@ import { ExportableProfile, ExportableAssignmentRule } from '../../src/exportable'; -import { FHIRDefinitions } from '../../src/utils'; +import { FHIRDefinitions, loadExternalDependencies } from '../../src/utils'; import * as loadOptimizers from '../../src/optimizer/loadOptimizers'; let loadedPackages: string[] = []; @@ -51,6 +51,22 @@ jest.mock('fhir-package-loader', () => { return newStyle; }); +jest.mock('fsh-sushi', () => { + const original = jest.requireActual('fsh-sushi'); + const newStyle = { + ...original, + utils: { + ...original.utils, + loadAutomaticDependencies: jest.fn(async () => { + // this is just one of the usual automatic depencies, as an example + loadedPackages.push('hl7.terminology.r4#1.0.0'); + return Promise.resolve(); + }) + } + }; + return newStyle; +}); + describe('Processing', () => { temp.track(); @@ -527,10 +543,78 @@ describe('Processing', () => { loadedPackages = []; }); + it('should load automatic and configured dependencies', async () => { + const config = new ExportableConfiguration({ + FSHOnly: true, + canonical: 'http://example.org', + fhirVersion: ['4.0.1'], + id: 'example', + name: 'Example', + applyExtensionMetadataToRoot: false, + dependencies: [{ packageId: 'hl7.fhir.us.core', version: '3.1.0' }] + }); + const defs = new FHIRDefinitions(); + await loadExternalDependencies(defs, config); + expect(loadedPackages).toHaveLength(3); + expect(loadedPackages).toContain('hl7.fhir.r4.core#4.0.1'); + expect(loadedPackages).toContain('hl7.fhir.us.core#3.1.0'); + expect(loadedPackages).toContain('hl7.terminology.r4#1.0.0'); + expect(loggerSpy.getAllMessages('error')).toHaveLength(0); + }); + + it('should load FHIR R4B when specified in config fhirVersion', async () => { + const config = new ExportableConfiguration({ + FSHOnly: true, + canonical: 'http://example.org', + fhirVersion: ['4.3.0'], + id: 'example', + name: 'Example', + applyExtensionMetadataToRoot: false, + dependencies: [{ packageId: 'hl7.fhir.us.core', version: '3.1.0' }] + }); + const defs = new FHIRDefinitions(); + await loadExternalDependencies(defs, config); + expect(loadedPackages).toHaveLength(3); + expect(loadedPackages).toContain('hl7.fhir.r4b.core#4.3.0'); + expect(loadedPackages).toContain('hl7.fhir.us.core#3.1.0'); + expect(loadedPackages).toContain('hl7.terminology.r4#1.0.0'); + expect(loggerSpy.getAllMessages('error')).toHaveLength(0); + }); + + it('should not add the identified FHIR core package to the list of dependencies when it is already there', async () => { + const config = new ExportableConfiguration({ + FSHOnly: true, + canonical: 'http://example.org', + fhirVersion: ['4.0.1'], + id: 'example', + name: 'Example', + applyExtensionMetadataToRoot: false, + dependencies: [ + { packageId: 'hl7.fhir.us.core', version: '3.1.0' }, + { packageId: 'hl7.fhir.r4.core', version: '4.0.1' } + ] + }); + const defs = new FHIRDefinitions(); + await loadExternalDependencies(defs, config); + // the core FHIR package is only present once in the list + expect(loadedPackages).toHaveLength(3); + expect(loadedPackages).toContain('hl7.fhir.r4.core#4.0.1'); + expect(loadedPackages).toContain('hl7.fhir.us.core#3.1.0'); + expect(loadedPackages).toContain('hl7.terminology.r4#1.0.0'); + expect(loggerSpy.getAllMessages('error')).toHaveLength(0); + }); + }); + + describe('loadConfiguredDependencies', () => { + beforeEach(() => { + loggerSpy.reset(); + loadedPackages = []; + }); + it('should load specified dependencies', () => { const defs = new FHIRDefinitions(); const dependencies = ['hl7.fhir.us.core@3.1.0']; - const dependencyDefs = loadExternalDependencies(defs, dependencies); + const dependencyDefs = loadConfiguredDependencies(defs, dependencies); return Promise.all(dependencyDefs).then(() => { expect(loadedPackages).toHaveLength(2); expect(loadedPackages).toContain('hl7.fhir.r4.core#4.0.1'); @@ -542,7 +626,7 @@ describe('Processing', () => { it('should log an error when it fails to load a dependency', () => { const defs = new FHIRDefinitions(); const badDependencies = ['hl7.does.not.exist@current']; - const dependencyDefs = loadExternalDependencies(defs, badDependencies); + const dependencyDefs = loadConfiguredDependencies(defs, badDependencies); return Promise.all(dependencyDefs).then(() => { expect(loadedPackages).toHaveLength(1); expect(loadedPackages).toContain('hl7.fhir.r4.core#4.0.1'); @@ -556,7 +640,7 @@ describe('Processing', () => { it('should log an error when a dependency has no specified version', () => { const defs = new FHIRDefinitions(); const badDependencies = ['hl7.fhir.us.core']; // No version - const dependencyDefs = loadExternalDependencies(defs, badDependencies); + const dependencyDefs = loadConfiguredDependencies(defs, badDependencies); return Promise.all(dependencyDefs).then(() => { expect(loadedPackages).toHaveLength(1); expect(loadedPackages).toContain('hl7.fhir.r4.core#4.0.1'); @@ -570,7 +654,7 @@ describe('Processing', () => { it('should load only FHIR if no dependencies specified', () => { const defs = new FHIRDefinitions(); // No dependencies specified on CLI will pass in undefined - const dependencyDefs = loadExternalDependencies(defs, undefined); + const dependencyDefs = loadConfiguredDependencies(defs, undefined); return Promise.all(dependencyDefs).then(() => { expect(loadedPackages).toHaveLength(1); expect(loadedPackages).toContain('hl7.fhir.r4.core#4.0.1'); @@ -581,7 +665,7 @@ describe('Processing', () => { it('should load FHIR R4B if specified', () => { const defs = new FHIRDefinitions(); const dependencies = ['hl7.fhir.r4b.core@4.3.0-snapshot1']; - const dependencyDefs = loadExternalDependencies(defs, dependencies); + const dependencyDefs = loadConfiguredDependencies(defs, dependencies); return Promise.all(dependencyDefs).then(() => { expect(loadedPackages).toHaveLength(1); expect(loadedPackages).toContain('hl7.fhir.r4b.core#4.3.0-snapshot1'); // Only contains r4b, doesn't load r4