Repository: FHIR/sushi
Pull request #962 (2021-11-22 20:05:57)

Bring back lower case package names
This re-applies the #912 commit which adds support for loading case-insensitive packages in SUSHI.

The changes in c2da55a268fa26070025958ff72d657343c3d00c are directly applied from #912, so they should have already been reviewed. However, it may be good for reviewers to take a look at that still, since we did let this bug slip past us the first time.

Then c2da55a268fa26070025958ff72d657343c3d00c fixes the bug that slipped through, which is that SUSHI failed to load a package with a version number if that package with a version number did not already exist in the FHIR cache. To test that this now works, you can add a dependency like:

```yaml
dependencies:
  hl7.fhir.us.core: 3.1.1
```

to your IG, and delete `hl7.fhir.us.core#3.1.1` from your FHIR cache. On c2da55a268fa26070025958ff72d657343c3d00c, SUSHI will be unable to read in the definitions from that package, but on c2da55a268fa26070025958ff72d657343c3d00c, it should work fine.


Patch:
diff --git a/src/fhirdefs/load.ts b/src/fhirdefs/load.ts
index e19d860..3eef5b7 100644
--- a/src/fhirdefs/load.ts
+++ b/src/fhirdefs/load.ts
@@ -26,12 +26,12 @@ export async function loadDependency(
   cachePath: string = path.join(os.homedir(), '.fhir', 'packages')
 ): Promise<FHIRDefinitions> {
   let fullPackageName = `${packageName}#${version}`;
-  let loadPath = path.join(cachePath, fullPackageName, 'package');
+  const loadPath = path.join(cachePath, fullPackageName, 'package');
   let loadedPackage: string;
 
   // First, try to load the package from the local cache
   logger.info(`Checking local cache for ${fullPackageName}...`);
-  loadedPackage = loadFromPath(loadPath, fullPackageName, FHIRDefs);
+  loadedPackage = loadFromPath(cachePath, fullPackageName, FHIRDefs);
   if (loadedPackage) {
     logger.info(`Found ${fullPackageName} in local cache.`);
   } else {
@@ -46,8 +46,7 @@ export async function loadDependency(
     );
     version = 'current';
     fullPackageName = `${packageName}#${version}`;
-    loadPath = path.join(cachePath, fullPackageName, 'package');
-    loadedPackage = loadFromPath(loadPath, fullPackageName, FHIRDefs);
+    loadedPackage = loadFromPath(cachePath, fullPackageName, FHIRDefs);
   }
 
   let packageUrl;
@@ -153,7 +152,7 @@ export async function loadDependency(
       }
       fs.moveSync(tempDirectory, targetDirectory);
       // Now try to load again from the path
-      loadedPackage = loadFromPath(loadPath, fullPackageName, FHIRDefs);
+      loadedPackage = loadFromPath(cachePath, fullPackageName, FHIRDefs);
     } else {
       logger.info(`Unable to download most current version of ${fullPackageName}`);
     }
@@ -272,24 +271,28 @@ export function loadCustomResources(resourceDir: string, defs: FHIRDefinitions):
 }
 
 /**
- * Loads a set of JSON files at targetPath into FHIRDefs
- * @param {string} targetPath - The path to the directory containing the JSON definitions
+ * Locates the targetPackage within the cachePath and loads the set of JSON files into FHIRDefs
+ * @param {string} cachePath - The path to the directory containing cached packages
  * @param {string} targetPackage - The name of the package we are trying to load
  * @param {FHIRDefinitions} FHIRDefs - The FHIRDefinitions object to load defs into
  * @returns {string} the name of the loaded package if successful
  */
 export function loadFromPath(
-  targetPath: string,
+  cachePath: string,
   targetPackage: string,
   FHIRDefs: FHIRDefinitions
 ): string {
   if (FHIRDefs.packages.indexOf(targetPackage) < 0) {
     const originalSize = FHIRDefs.size();
-    if (fs.existsSync(targetPath)) {
-      const files = fs.readdirSync(targetPath);
+    const packages = fs.existsSync(cachePath) ? fs.readdirSync(cachePath) : [];
+    const cachedPackage = packages.find(packageName => packageName.toLowerCase() === targetPackage);
+    if (cachedPackage) {
+      const files = fs.readdirSync(path.join(cachePath, cachedPackage, 'package'));
       for (const file of files) {
         if (file.endsWith('.json')) {
-          const def = JSON.parse(fs.readFileSync(path.join(targetPath, file), 'utf-8').trim());
+          const def = JSON.parse(
+            fs.readFileSync(path.join(cachePath, cachedPackage, 'package', file), 'utf-8').trim()
+          );
           FHIRDefs.add(def);
         }
       }
diff --git a/src/import/importConfiguration.ts b/src/import/importConfiguration.ts
index c948259..5d5c53b 100644
--- a/src/import/importConfiguration.ts
+++ b/src/import/importConfiguration.ts
@@ -558,6 +558,12 @@ function parseDependencies(
     return;
   }
   return Object.entries(yamlDependencies).map(([packageId, versionOrDetails]) => {
+    if (/[A-Z]/.test(packageId)) {
+      logger.warn(
+        `${packageId} contains uppercase characters, which is discouraged. SUSHI will use ${packageId.toLowerCase()} as the package name.`
+      );
+      packageId = packageId.toLowerCase();
+    }
     if (typeof versionOrDetails === 'string' || typeof versionOrDetails === 'number') {
       return { packageId, version: `${versionOrDetails}` };
     } else if (versionOrDetails == null) {


Test patch:
diff --git a/test/export/CodeSystemExporter.test.ts b/test/export/CodeSystemExporter.test.ts
index cf80c2c..40c2813 100644
--- a/test/export/CodeSystemExporter.test.ts
+++ b/test/export/CodeSystemExporter.test.ts
@@ -15,11 +15,7 @@ describe('CodeSystemExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/FHIRExporter.test.ts b/test/export/FHIRExporter.test.ts
index bc9a1c4..4acbdda 100644
--- a/test/export/FHIRExporter.test.ts
+++ b/test/export/FHIRExporter.test.ts
@@ -31,11 +31,7 @@ describe('FHIRExporter', () => {
 
     beforeAll(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     });
 
     beforeEach(() => {
diff --git a/test/export/InstanceExporter.test.ts b/test/export/InstanceExporter.test.ts
index f56de09..bcb97a0 100644
--- a/test/export/InstanceExporter.test.ts
+++ b/test/export/InstanceExporter.test.ts
@@ -36,11 +36,7 @@ describe('InstanceExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
@@ -4033,11 +4029,7 @@ describe('InstanceExporter R5', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r5-definitions'),
-      'r5',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r5-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/MappingExporter.test.ts b/test/export/MappingExporter.test.ts
index 936410c..0c9b559 100644
--- a/test/export/MappingExporter.test.ts
+++ b/test/export/MappingExporter.test.ts
@@ -21,11 +21,7 @@ describe('MappingExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/StructureDefinition.ExtensionExporter.test.ts b/test/export/StructureDefinition.ExtensionExporter.test.ts
index e0536df..6277b38 100644
--- a/test/export/StructureDefinition.ExtensionExporter.test.ts
+++ b/test/export/StructureDefinition.ExtensionExporter.test.ts
@@ -15,11 +15,7 @@ describe('ExtensionExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/StructureDefinition.LogicalExporter.test.ts b/test/export/StructureDefinition.LogicalExporter.test.ts
index 9f203ed..e43a4cb 100644
--- a/test/export/StructureDefinition.LogicalExporter.test.ts
+++ b/test/export/StructureDefinition.LogicalExporter.test.ts
@@ -21,11 +21,7 @@ describe('LogicalExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/StructureDefinition.ProfileExporter.test.ts b/test/export/StructureDefinition.ProfileExporter.test.ts
index d3bd3ea..6115385 100644
--- a/test/export/StructureDefinition.ProfileExporter.test.ts
+++ b/test/export/StructureDefinition.ProfileExporter.test.ts
@@ -20,11 +20,7 @@ describe('ProfileExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/StructureDefinition.ResourceExporter.test.ts b/test/export/StructureDefinition.ResourceExporter.test.ts
index 6142d6d..17bb52f 100644
--- a/test/export/StructureDefinition.ResourceExporter.test.ts
+++ b/test/export/StructureDefinition.ResourceExporter.test.ts
@@ -22,11 +22,7 @@ describe('ResourceExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/StructureDefinitionExporter.test.ts b/test/export/StructureDefinitionExporter.test.ts
index 994abdb..6c21133 100644
--- a/test/export/StructureDefinitionExporter.test.ts
+++ b/test/export/StructureDefinitionExporter.test.ts
@@ -50,11 +50,7 @@ describe('StructureDefinitionExporter R4', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
@@ -7252,11 +7248,7 @@ describe('StructureDefinitionExporter R5', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r5-definitions'),
-      'r5',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r5-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/export/ValueSetExporter.test.ts b/test/export/ValueSetExporter.test.ts
index 463d13d..2640458 100644
--- a/test/export/ValueSetExporter.test.ts
+++ b/test/export/ValueSetExporter.test.ts
@@ -30,11 +30,7 @@ describe('ValueSetExporter', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
   });
 
   beforeEach(() => {
diff --git a/test/fhirdefs/FHIRDefinitions.test.ts b/test/fhirdefs/FHIRDefinitions.test.ts
index f7c52de..51e31d1 100644
--- a/test/fhirdefs/FHIRDefinitions.test.ts
+++ b/test/fhirdefs/FHIRDefinitions.test.ts
@@ -8,18 +8,10 @@ describe('FHIRDefinitions', () => {
   let defs: FHIRDefinitions;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'test#1.1.1',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     // Supplemental R3 defs needed to test fishing for implied extensions
     const r3Defs = new FHIRDefinitions(true);
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r3-definitions'),
-      'hl7.fhir.r3.core#3.0.2',
-      r3Defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r3-definitions', r3Defs);
     defs.addSupplementalFHIRDefinitions('hl7.fhir.r3.core#3.0.2', r3Defs);
     // Run the dependency resources through TestFisher to force them into the testhelpers cache
     const fisher = new TestFisher().withFHIR(defs);
diff --git a/test/fhirdefs/fixtures/sUshI-tESt-CaPs#0.1.0/package/StructureDefinition-MyPatient.json b/test/fhirdefs/fixtures/sUshI-tESt-CaPs#0.1.0/package/StructureDefinition-MyPatient.json
new file mode 100644
index 0000000..4f65cc4
--- /dev/null
+++ b/test/fhirdefs/fixtures/sUshI-tESt-CaPs#0.1.0/package/StructureDefinition-MyPatient.json
@@ -0,0 +1,25 @@
+{
+  "resourceType": "StructureDefinition",
+  "id": "MyPatient",
+  "url": "http://hl7.org/fhir/sushi-test/StructureDefinition/MyPatient",
+  "name": "MyPatient",
+  "status": "active",
+  "fhirVersion": "4.0.1",
+  "kind": "resource",
+  "type": "Patient",
+  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
+  "derivation": "constraint",
+  "differential": {
+    "element": [
+      {
+        "id": "Patient.deceased[x]",
+        "path": "Patient.deceased[x]",
+        "type": [
+          {
+            "code": "boolean"
+          }
+        ]
+      }
+    ]
+  }
+}
diff --git a/test/fhirdefs/fixtures/sUshI-tESt-CaPs#0.1.0/package/package.json b/test/fhirdefs/fixtures/sUshI-tESt-CaPs#0.1.0/package/package.json
new file mode 100644
index 0000000..99f065f
--- /dev/null
+++ b/test/fhirdefs/fixtures/sUshI-tESt-CaPs#0.1.0/package/package.json
@@ -0,0 +1,24 @@
+{
+  "name": "sushi-test",
+  "version" : "0.1.0",
+  "canonical" : "http://hl7.org/fhir/sushi-test",
+  "url" : "http://hl7.org/fhir/sushi-test",
+  "title" : "FSH Test IG",
+  "description": "Provides a simple example of how FSH can be used to create an IG",
+  "dependencies": {
+     "hl7.fhir.r4.core": "4.0.1",
+     "hl7.fhir.us.core": "3.1.0",
+     "hl7.fhir.uv.vhdir":"current"
+  },
+  "date": "20200413230227",
+  "language": "en",
+  "author": "James Tuna",
+  "maintainers": [
+    {
+      "name": "Bill Cod",
+      "email": "cod@reef.gov",
+      "url": "https://capecodfishermen.org/"
+    }
+  ],
+  "license": "CC0-1.0"
+ }
\ No newline at end of file
diff --git a/test/fhirdefs/impliedExtension.test.ts b/test/fhirdefs/impliedExtension.test.ts
index fe53016..e0f9f14 100644
--- a/test/fhirdefs/impliedExtension.test.ts
+++ b/test/fhirdefs/impliedExtension.test.ts
@@ -43,31 +43,15 @@ describe('impliedExtensions', () => {
     let defs: FHIRDefinitions;
     beforeEach(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testdefs',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       const r2Defs = new FHIRDefinitions(true);
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r2-definitions'),
-        'hl7.fhir.r2.core#1.0.2',
-        r2Defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r2-definitions', r2Defs);
       defs.addSupplementalFHIRDefinitions('hl7.fhir.r2.core#1.0.2', r2Defs);
       const r3Defs = new FHIRDefinitions(true);
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r3-definitions'),
-        'hl7.fhir.r3.core#3.0.2',
-        r3Defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r3-definitions', r3Defs);
       defs.addSupplementalFHIRDefinitions('hl7.fhir.r3.core#3.0.2', r3Defs);
       const r5Defs = new FHIRDefinitions(true);
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r5-definitions'),
-        'hl7.fhir.r5.core#4.6.0',
-        r5Defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r5-definitions', r5Defs);
       defs.addSupplementalFHIRDefinitions('hl7.fhir.r5.core#current', r5Defs);
       loggerSpy.reset();
     });
@@ -1330,17 +1314,9 @@ describe('impliedExtensions', () => {
     let defs: FHIRDefinitions;
     beforeEach(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r5-definitions'),
-        'hl7.fhir.r5.core#4.6.0',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r5-definitions', defs);
       const r4Defs = new FHIRDefinitions(true);
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'hl7.fhir.r4.core#4.0.1',
-        r4Defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', r4Defs);
       defs.addSupplementalFHIRDefinitions('hl7.fhir.r4.core#4.0.1', r4Defs);
       loggerSpy.reset();
     });
diff --git a/test/fhirdefs/load.test.ts b/test/fhirdefs/load.test.ts
index cd66e35..ceeca69 100644
--- a/test/fhirdefs/load.test.ts
+++ b/test/fhirdefs/load.test.ts
@@ -19,11 +19,7 @@ describe('#loadFromPath()', () => {
   let defs: FHIRDefinitions;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'test#1.1.1',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     // Run the dependency resources through TestFisher to force them into the testhelpers cache
     const fisher = new TestFisher().withFHIR(defs);
     fisher.fishForFHIR('Condition');
@@ -215,12 +211,17 @@ describe('#loadDependency()', () => {
   // Packages with numerical versions
   it('should not try to download a non-current package that is already in the cache', async () => {
     const expectedDefs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(cachePath, 'sushi-test#0.1.0', 'package'),
-      'sushi-test#0.1.0',
+    loadFromPath(cachePath, 'sushi-test#0.1.0', expectedDefs);
+    await expect(loadDependency('sushi-test', '0.1.0', defs, cachePath)).resolves.toEqual(
       expectedDefs
     );
-    await expect(loadDependency('sushi-test', '0.1.0', defs, cachePath)).resolves.toEqual(
+    expect(axiosSpy.mock.calls.length).toBe(0);
+  });
+
+  it('should recognize a package in the cache with uppercase letters', async () => {
+    const expectedDefs = new FHIRDefinitions();
+    loadFromPath(cachePath, 'sushi-test-caps#0.1.0', expectedDefs);
+    await expect(loadDependency('sushi-test-caps', '0.1.0', defs, cachePath)).resolves.toEqual(
       expectedDefs
     );
     expect(axiosSpy.mock.calls.length).toBe(0);
@@ -299,11 +300,7 @@ describe('#loadDependency()', () => {
   // Packages with current versions
   it('should not try to download a current package that is already in the cache and up to date', async () => {
     const expectedDefs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(cachePath, 'sushi-test#current', 'package'),
-      'sushi-test#current',
-      expectedDefs
-    );
+    loadFromPath(cachePath, 'sushi-test#current', expectedDefs);
     await expect(loadDependency('sushi-test', 'current', defs, cachePath)).resolves.toEqual(
       expectedDefs
     );
@@ -349,11 +346,7 @@ describe('#loadDependency()', () => {
 
   it('should revert to an old locally cached current version when a newer current version is not available for download', async () => {
     const expectedDefs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(cachePath, 'sushi-test-no-download#current', 'package'),
-      'sushi-test-no-download#current',
-      expectedDefs
-    );
+    loadFromPath(cachePath, 'sushi-test-no-download#current', expectedDefs);
     await expect(
       loadDependency('sushi-test-no-download', 'current', defs, cachePath)
     ).resolves.toEqual(expectedDefs);
@@ -368,7 +361,7 @@ describe('#loadDependency()', () => {
   // Packages with dev versions
   it('should not try to download a dev package that is already in the cache', async () => {
     const expectedDefs = new FHIRDefinitions();
-    loadFromPath(path.join(cachePath, 'sushi-test#dev', 'package'), 'sushi-test#dev', expectedDefs);
+    loadFromPath(cachePath, 'sushi-test#dev', expectedDefs);
     await expect(loadDependency('sushi-test', 'dev', defs, cachePath)).resolves.toEqual(
       expectedDefs
     );
diff --git a/test/fhirtypes/ElementDefinition.applyAddElementRule.test.ts b/test/fhirtypes/ElementDefinition.applyAddElementRule.test.ts
index 3baf37e..3c7a03f 100644
--- a/test/fhirtypes/ElementDefinition.applyAddElementRule.test.ts
+++ b/test/fhirtypes/ElementDefinition.applyAddElementRule.test.ts
@@ -11,11 +11,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
 
diff --git a/test/fhirtypes/ElementDefinition.applyFlags.test.ts b/test/fhirtypes/ElementDefinition.applyFlags.test.ts
index 18dbb53..90efffa 100644
--- a/test/fhirtypes/ElementDefinition.applyFlags.test.ts
+++ b/test/fhirtypes/ElementDefinition.applyFlags.test.ts
@@ -12,11 +12,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.applyMapping.test.ts b/test/fhirtypes/ElementDefinition.applyMapping.test.ts
index f004241..679f27d 100644
--- a/test/fhirtypes/ElementDefinition.applyMapping.test.ts
+++ b/test/fhirtypes/ElementDefinition.applyMapping.test.ts
@@ -11,11 +11,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignBoolean.test.ts b/test/fhirtypes/ElementDefinition.assignBoolean.test.ts
index 226101f..a5fe74c 100644
--- a/test/fhirtypes/ElementDefinition.assignBoolean.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignBoolean.test.ts
@@ -13,11 +13,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignFshCode.test.ts b/test/fhirtypes/ElementDefinition.assignFshCode.test.ts
index da4290e..82dbb67 100644
--- a/test/fhirtypes/ElementDefinition.assignFshCode.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignFshCode.test.ts
@@ -18,11 +18,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignFshQuantity.test.ts b/test/fhirtypes/ElementDefinition.assignFshQuantity.test.ts
index 83dcb69..92ffc23 100644
--- a/test/fhirtypes/ElementDefinition.assignFshQuantity.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignFshQuantity.test.ts
@@ -18,11 +18,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignFshRatio.test.ts b/test/fhirtypes/ElementDefinition.assignFshRatio.test.ts
index 4437288..9381e4c 100644
--- a/test/fhirtypes/ElementDefinition.assignFshRatio.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignFshRatio.test.ts
@@ -15,11 +15,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignFshReference.test.ts b/test/fhirtypes/ElementDefinition.assignFshReference.test.ts
index 59b466b..0c4bf34 100644
--- a/test/fhirtypes/ElementDefinition.assignFshReference.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignFshReference.test.ts
@@ -14,11 +14,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignInstanceDefinition.test.ts b/test/fhirtypes/ElementDefinition.assignInstanceDefinition.test.ts
index c7902c0..6b1223e 100644
--- a/test/fhirtypes/ElementDefinition.assignInstanceDefinition.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignInstanceDefinition.test.ts
@@ -12,11 +12,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.assignNumber.test.ts b/test/fhirtypes/ElementDefinition.assignNumber.test.ts
index 3ddae38..d2868f2 100644
--- a/test/fhirtypes/ElementDefinition.assignNumber.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignNumber.test.ts
@@ -17,11 +17,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
@@ -468,6 +464,7 @@ describe('ElementDefinition', () => {
               'testhelpers',
               'testdefs',
               'r5-definitions',
+              'package',
               'StructureDefinition-Extension.json'
             ),
             'utf-8'
diff --git a/test/fhirtypes/ElementDefinition.assignString.test.ts b/test/fhirtypes/ElementDefinition.assignString.test.ts
index de0e4bf..389dbda 100644
--- a/test/fhirtypes/ElementDefinition.assignString.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignString.test.ts
@@ -22,11 +22,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
@@ -1121,6 +1117,7 @@ describe('ElementDefinition', () => {
                 'testhelpers',
                 'testdefs',
                 'r5-definitions',
+                'package',
                 'StructureDefinition-Extension.json'
               ),
               'utf-8'
diff --git a/test/fhirtypes/ElementDefinition.assignValue.test.ts b/test/fhirtypes/ElementDefinition.assignValue.test.ts
index e041e21..1c52d6c 100644
--- a/test/fhirtypes/ElementDefinition.assignValue.test.ts
+++ b/test/fhirtypes/ElementDefinition.assignValue.test.ts
@@ -12,11 +12,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.bindToVS.test.ts b/test/fhirtypes/ElementDefinition.bindToVS.test.ts
index 74df002..5cdf2da 100644
--- a/test/fhirtypes/ElementDefinition.bindToVS.test.ts
+++ b/test/fhirtypes/ElementDefinition.bindToVS.test.ts
@@ -11,11 +11,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
@@ -189,11 +185,7 @@ describe('ElementDefinition R5', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r5-definitions'),
-      'r5',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r5-definitions', defs);
     fisher = new TestFisher()
       .withFHIR(defs)
       .withCachePackageName('hl7.fhir.r5.core#current')
diff --git a/test/fhirtypes/ElementDefinition.checkAssignInlineInstance.test.ts b/test/fhirtypes/ElementDefinition.checkAssignInlineInstance.test.ts
index 59c482e..884ae20 100644
--- a/test/fhirtypes/ElementDefinition.checkAssignInlineInstance.test.ts
+++ b/test/fhirtypes/ElementDefinition.checkAssignInlineInstance.test.ts
@@ -14,11 +14,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.constrainCardinality.test.ts b/test/fhirtypes/ElementDefinition.constrainCardinality.test.ts
index 4071ae7..65d96ed 100644
--- a/test/fhirtypes/ElementDefinition.constrainCardinality.test.ts
+++ b/test/fhirtypes/ElementDefinition.constrainCardinality.test.ts
@@ -12,11 +12,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.constrainType.test.ts b/test/fhirtypes/ElementDefinition.constrainType.test.ts
index 81d7233..0b19752 100644
--- a/test/fhirtypes/ElementDefinition.constrainType.test.ts
+++ b/test/fhirtypes/ElementDefinition.constrainType.test.ts
@@ -24,11 +24,7 @@ describe('ElementDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     pkg = new Package(minimalConfig);
     fisher = new TestFisher().withFHIR(defs).withPackage(pkg);
     exporter = new StructureDefinitionExporter(new FSHTank([], minimalConfig), pkg, fisher);
@@ -830,11 +826,7 @@ describe('ElementDefinition R5', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'r5-definitions'),
-      'r5',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r5-definitions', defs);
     pkg = new Package(minimalConfig);
     fisher = new TestFisher()
       .withFHIR(defs)
diff --git a/test/fhirtypes/ElementDefinition.setInstancePropertyByPath.test.ts b/test/fhirtypes/ElementDefinition.setInstancePropertyByPath.test.ts
index b49adf5..18defee 100644
--- a/test/fhirtypes/ElementDefinition.setInstancePropertyByPath.test.ts
+++ b/test/fhirtypes/ElementDefinition.setInstancePropertyByPath.test.ts
@@ -13,11 +13,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.slicing.test.ts b/test/fhirtypes/ElementDefinition.slicing.test.ts
index e3e6d52..f1b97e3 100644
--- a/test/fhirtypes/ElementDefinition.slicing.test.ts
+++ b/test/fhirtypes/ElementDefinition.slicing.test.ts
@@ -12,11 +12,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
   });
   beforeEach(() => {
diff --git a/test/fhirtypes/ElementDefinition.test.ts b/test/fhirtypes/ElementDefinition.test.ts
index d49f88c..c1511c7 100644
--- a/test/fhirtypes/ElementDefinition.test.ts
+++ b/test/fhirtypes/ElementDefinition.test.ts
@@ -20,11 +20,7 @@ describe('ElementDefinition', () => {
   let fisher: TestFisher;
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
     // resolve observation once to ensure it is present in defs
     observation = fisher.fishForStructureDefinition('Observation');
diff --git a/test/fhirtypes/StructureDefinition.test.ts b/test/fhirtypes/StructureDefinition.test.ts
index b032c57..93e90dc 100644
--- a/test/fhirtypes/StructureDefinition.test.ts
+++ b/test/fhirtypes/StructureDefinition.test.ts
@@ -27,11 +27,7 @@ describe('StructureDefinition', () => {
 
   beforeAll(() => {
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'testPackage',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     fisher = new TestFisher().withFHIR(defs);
     // resolve observation once to ensure it is present in defs
     observation = fisher.fishForStructureDefinition('Observation');
diff --git a/test/ig/IGExporter.IG.test.ts b/test/ig/IGExporter.IG.test.ts
index 2746c9d..401d66a 100644
--- a/test/ig/IGExporter.IG.test.ts
+++ b/test/ig/IGExporter.IG.test.ts
@@ -35,11 +35,7 @@ describe('IGExporter', () => {
 
     beforeAll(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       fixtures = path.join(__dirname, 'fixtures', 'simple-ig');
 
       const profiles = path.join(fixtures, 'profiles');
@@ -639,11 +635,7 @@ describe('IGExporter', () => {
 
     beforeAll(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       fixtures = path.join(__dirname, 'fixtures', 'simple-ig-plus');
 
       const profiles = path.join(fixtures, 'profiles');
@@ -876,11 +868,7 @@ describe('IGExporter', () => {
     beforeAll(() => {
       fixtures = path.join(__dirname, 'fixtures', 'customized-ig');
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     });
 
     beforeEach(() => {
@@ -1153,11 +1141,7 @@ describe('IGExporter', () => {
 
     beforeAll(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       fixtures = path.join(__dirname, 'fixtures', 'customized-ig-with-resources');
       loadCustomResources(path.join(fixtures, 'input'), defs);
     });
@@ -1525,11 +1509,7 @@ describe('IGExporter', () => {
 
     beforeAll(() => {
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       fixtures = path.join(__dirname, 'fixtures', 'customized-ig-with-nested-resources');
       loadCustomResources(path.join(fixtures, 'input'), defs);
     });
@@ -1703,11 +1683,7 @@ describe('IGExporter', () => {
     beforeAll(() => {
       fixtures = path.join(__dirname, 'fixtures', 'pages-folder-ig');
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     });
 
     beforeEach(() => {
@@ -1803,11 +1779,7 @@ describe('IGExporter', () => {
     beforeAll(() => {
       fixtures = path.join(__dirname, 'fixtures', 'invalid-pages-folder-ig');
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
     });
 
     beforeEach(() => {
@@ -1856,11 +1828,7 @@ describe('IGExporter', () => {
       tempOut = temp.mkdirSync('sushi-test');
       fixtures = path.join(__dirname, 'fixtures', 'sorted-pages-ig');
       defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       pkg = new Package(minimalConfig);
     });
 
@@ -1961,11 +1929,7 @@ describe('IGExporter', () => {
       tempOut = temp.mkdirSync('sushi-test');
       const fixtures = path.join(__dirname, 'fixtures', 'name-collision-ig');
       const defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       const pkg = new Package(minimalConfig);
       const exporter = new IGExporter(pkg, defs, fixtures);
       // No need to regenerate the IG on every test -- generate it once and inspect what you
diff --git a/test/ig/IGExporter.test.ts b/test/ig/IGExporter.test.ts
index 4054c32..03f4297 100644
--- a/test/ig/IGExporter.test.ts
+++ b/test/ig/IGExporter.test.ts
@@ -72,11 +72,7 @@ describe('IGExporter', () => {
       const config = importConfiguration(configYaml, configPath);
       const pkg = new Package(config);
       const defs = new FHIRDefinitions();
-      loadFromPath(
-        path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-        'testPackage',
-        defs
-      );
+      loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
       const exporter = new IGExporter(pkg, defs, __dirname);
       exporter.export(tempOut);
     });
diff --git a/test/import/importConfiguration.test.ts b/test/import/importConfiguration.test.ts
index 0549eca..1c4d212 100644
--- a/test/import/importConfiguration.test.ts
+++ b/test/import/importConfiguration.test.ts
@@ -1397,6 +1397,27 @@ describe('importConfiguration', () => {
         { packageId: 'bar', version: '2.3' }
       ]);
     });
+
+    it('should convert uppercase package Ids to lowercase', () => {
+      minYAML.dependencies = {
+        'hl7.ex.PAcKage.iD1': '1.2.3',
+        'hl7.ex.package.id2': '4.5.6'
+      };
+      const config = importConfiguration(minYAML, 'test-config.yaml');
+      expect(config.dependencies).toEqual([
+        { packageId: 'hl7.ex.package.id1', version: '1.2.3' },
+        { packageId: 'hl7.ex.package.id2', version: '4.5.6' }
+      ]);
+      expect(
+        loggerSpy
+          .getAllMessages('warn')
+          .some(message =>
+            message.match(
+              /hl7.ex.PAcKage.iD1 contains uppercase characters, which is discouraged. SUSHI will use hl7.ex.package.id1 as the package name./
+            )
+          )
+      ).toBeTruthy();
+    });
   });
 
   describe('#global', () => {
diff --git a/test/run/FshToFhir.test.ts b/test/run/FshToFhir.test.ts
index 760c0ce..a9af521 100644
--- a/test/run/FshToFhir.test.ts
+++ b/test/run/FshToFhir.test.ts
@@ -114,6 +114,7 @@ describe('#FshToFhir', () => {
             '..',
             'testhelpers',
             'testdefs',
+            'r4-definitions',
             'package',
             'StructureDefinition-StructureDefinition.json'
           ),
@@ -127,6 +128,7 @@ describe('#FshToFhir', () => {
             '..',
             'testhelpers',
             'testdefs',
+            'r4-definitions',
             'package',
             'StructureDefinition-Patient.json'
           ),
diff --git a/test/testhelpers/testdefs/r2-definitions/StructureDefinition-Bundle.json b/test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-Bundle.json
similarity index 100%
rename from test/testhelpers/testdefs/r2-definitions/StructureDefinition-Bundle.json
rename to test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-Bundle.json
diff --git a/test/testhelpers/testdefs/r2-definitions/StructureDefinition-DiagnosticReport.json b/test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-DiagnosticReport.json
similarity index 100%
rename from test/testhelpers/testdefs/r2-definitions/StructureDefinition-DiagnosticReport.json
rename to test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-DiagnosticReport.json
diff --git a/test/testhelpers/testdefs/r2-definitions/StructureDefinition-MedicationAdministration.json b/test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-MedicationAdministration.json
similarity index 100%
rename from test/testhelpers/testdefs/r2-definitions/StructureDefinition-MedicationAdministration.json
rename to test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-MedicationAdministration.json
diff --git a/test/testhelpers/testdefs/r2-definitions/StructureDefinition-ValueSet.json b/test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-ValueSet.json
similarity index 100%
rename from test/testhelpers/testdefs/r2-definitions/StructureDefinition-ValueSet.json
rename to test/testhelpers/testdefs/r2-definitions/package/StructureDefinition-ValueSet.json
diff --git a/test/testhelpers/testdefs/r3-definitions/StructureDefinition-Patient.json b/test/testhelpers/testdefs/r3-definitions/package/StructureDefinition-Patient.json
similarity index 100%
rename from test/testhelpers/testdefs/r3-definitions/StructureDefinition-Patient.json
rename to test/testhelpers/testdefs/r3-definitions/package/StructureDefinition-Patient.json
diff --git a/test/testhelpers/testdefs/package/CodeSystem-allergyintolerance-clinical.json b/test/testhelpers/testdefs/r4-definitions/package/CodeSystem-allergyintolerance-clinical.json
similarity index 100%
rename from test/testhelpers/testdefs/package/CodeSystem-allergyintolerance-clinical.json
rename to test/testhelpers/testdefs/r4-definitions/package/CodeSystem-allergyintolerance-clinical.json
diff --git a/test/testhelpers/testdefs/package/CodeSystem-w3c-provenance-activity-type.json b/test/testhelpers/testdefs/r4-definitions/package/CodeSystem-w3c-provenance-activity-type.json
similarity index 100%
rename from test/testhelpers/testdefs/package/CodeSystem-w3c-provenance-activity-type.json
rename to test/testhelpers/testdefs/r4-definitions/package/CodeSystem-w3c-provenance-activity-type.json
diff --git a/test/testhelpers/testdefs/package/ImplementationGuide-2-test-wonky-id.json b/test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-2-test-wonky-id.json
similarity index 100%
rename from test/testhelpers/testdefs/package/ImplementationGuide-2-test-wonky-id.json
rename to test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-2-test-wonky-id.json
diff --git a/test/testhelpers/testdefs/package/ImplementationGuide-hl7.core.uv.vhdir.json b/test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-hl7.core.uv.vhdir.json
similarity index 100%
rename from test/testhelpers/testdefs/package/ImplementationGuide-hl7.core.uv.vhdir.json
rename to test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-hl7.core.uv.vhdir.json
diff --git a/test/testhelpers/testdefs/package/ImplementationGuide-hl7.fhir.us.core.json b/test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-hl7.fhir.us.core.json
similarity index 100%
rename from test/testhelpers/testdefs/package/ImplementationGuide-hl7.fhir.us.core.json
rename to test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-hl7.fhir.us.core.json
diff --git a/test/testhelpers/testdefs/package/ImplementationGuide-test-wonky-id-1.json b/test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-test-wonky-id-1.json
similarity index 100%
rename from test/testhelpers/testdefs/package/ImplementationGuide-test-wonky-id-1.json
rename to test/testhelpers/testdefs/r4-definitions/package/ImplementationGuide-test-wonky-id-1.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ActivityDefinition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ActivityDefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ActivityDefinition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ActivityDefinition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Address.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Address.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Address.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Address.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Age.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Age.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Age.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Age.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-AlternateIdentification.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-AlternateIdentification.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-AlternateIdentification.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-AlternateIdentification.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Appointment.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Appointment.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Appointment.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Appointment.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-BackboneElement.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-BackboneElement.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-BackboneElement.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-BackboneElement.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Basic.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Basic.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Basic.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Basic.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Binary.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Binary.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Binary.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Binary.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Bundle.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Bundle.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Bundle.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Bundle.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-CapabilityStatement.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CapabilityStatement.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-CapabilityStatement.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CapabilityStatement.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-CarePlan.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CarePlan.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-CarePlan.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CarePlan.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-CodeSystem.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CodeSystem.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-CodeSystem.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CodeSystem.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-CodeableConcept.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CodeableConcept.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-CodeableConcept.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-CodeableConcept.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Coding.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Coding.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Coding.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Coding.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Condition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Condition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Condition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Condition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ContactDetail.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ContactDetail.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ContactDetail.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ContactDetail.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ContactPoint.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ContactPoint.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ContactPoint.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ContactPoint.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Device.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Device.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Device.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Device.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-DiagnosticReport.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-DiagnosticReport.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-DiagnosticReport.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-DiagnosticReport.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-DocumentReference.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-DocumentReference.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-DocumentReference.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-DocumentReference.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-DomainResource.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-DomainResource.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-DomainResource.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-DomainResource.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Duration.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Duration.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Duration.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Duration.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Element.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Element.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Element.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Element.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ElementDefinition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ElementDefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ElementDefinition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ElementDefinition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Expression.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Expression.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Expression.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Expression.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Extension.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Extension.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Extension.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Extension.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-FamilyMemberHistory.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-FamilyMemberHistory.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-FamilyMemberHistory.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-FamilyMemberHistory.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Group.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Group.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Group.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Group.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-HumanName.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-HumanName.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-HumanName.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-HumanName.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Identifier.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Identifier.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Identifier.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Identifier.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ImagingStudy.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ImagingStudy.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ImagingStudy.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ImagingStudy.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Location.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Location.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Location.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Location.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Medication.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Medication.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Medication.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Medication.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-MedicationRequest.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-MedicationRequest.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-MedicationRequest.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-MedicationRequest.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Meta.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Meta.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Meta.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Meta.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Money.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Money.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Money.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Money.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-MoneyQuantity.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-MoneyQuantity.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-MoneyQuantity.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-MoneyQuantity.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Narrative.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Narrative.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Narrative.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Narrative.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Observation.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Observation.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Observation.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Observation.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Organization.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Organization.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Organization.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Organization.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Patient.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Patient.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Patient.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Patient.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Period.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Period.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Period.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Period.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-PlanDefinition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-PlanDefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-PlanDefinition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-PlanDefinition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Practitioner.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Practitioner.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Practitioner.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Practitioner.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-PractitionerRole.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-PractitionerRole.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-PractitionerRole.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-PractitionerRole.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Procedure.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Procedure.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Procedure.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Procedure.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Quantity.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Quantity.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Quantity.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Quantity.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Questionnaire.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Questionnaire.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Questionnaire.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Questionnaire.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-QuestionnaireResponse.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-QuestionnaireResponse.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-QuestionnaireResponse.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-QuestionnaireResponse.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Range.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Range.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Range.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Range.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Ratio.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Ratio.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Ratio.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Ratio.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Reference.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Reference.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Reference.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Reference.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-RelatedPerson.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-RelatedPerson.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-RelatedPerson.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-RelatedPerson.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Resource.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Resource.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Resource.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Resource.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-RiskEvidenceSynthesis.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-RiskEvidenceSynthesis.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-RiskEvidenceSynthesis.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-RiskEvidenceSynthesis.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-SampledData.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-SampledData.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-SampledData.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-SampledData.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ServiceProfile.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ServiceProfile.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ServiceProfile.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ServiceProfile.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-SimpleQuantity.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-SimpleQuantity.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-SimpleQuantity.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-SimpleQuantity.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-StructureDefinition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-StructureDefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-StructureDefinition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-StructureDefinition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Task.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Task.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Task.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Task.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-Timing.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Timing.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-Timing.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-Timing.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-ValueSet.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ValueSet.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-ValueSet.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-ValueSet.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-actualgroup.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-actualgroup.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-actualgroup.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-actualgroup.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-bodyheight.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-bodyheight.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-bodyheight.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-bodyheight.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-bodyweight.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-bodyweight.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-bodyweight.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-bodyweight.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-boolean.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-boolean.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-boolean.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-boolean.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-bp.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-bp.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-bp.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-bp.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-canonical.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-canonical.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-canonical.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-canonical.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-capabilitystatement-search-parameter-combination.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-capabilitystatement-search-parameter-combination.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-capabilitystatement-search-parameter-combination.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-capabilitystatement-search-parameter-combination.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-clinicaldocument.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-clinicaldocument.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-clinicaldocument.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-clinicaldocument.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-code.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-code.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-code.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-code.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-composition-clinicaldocument-versionNumber.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-composition-clinicaldocument-versionNumber.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-composition-clinicaldocument-versionNumber.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-composition-clinicaldocument-versionNumber.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-computableplandefinition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-computableplandefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-computableplandefinition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-computableplandefinition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-cqf-library.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-cqf-library.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-cqf-library.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-cqf-library.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-cqf-questionnaire.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-cqf-questionnaire.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-cqf-questionnaire.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-cqf-questionnaire.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-dateTime.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-dateTime.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-dateTime.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-dateTime.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-decimal.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-decimal.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-decimal.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-decimal.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-eLTSSServiceModel.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-eLTSSServiceModel.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-eLTSSServiceModel.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-eLTSSServiceModel.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-familymemberhistory-genetic.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-familymemberhistory-genetic.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-familymemberhistory-genetic.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-familymemberhistory-genetic.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-familymemberhistory-type.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-familymemberhistory-type.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-familymemberhistory-type.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-familymemberhistory-type.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-instant.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-instant.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-instant.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-instant.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-integer.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-integer.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-integer.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-integer.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-iso21090-ADXP-additionalLocator.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-iso21090-ADXP-additionalLocator.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-iso21090-ADXP-additionalLocator.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-iso21090-ADXP-additionalLocator.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-lipidprofile.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-lipidprofile.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-lipidprofile.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-lipidprofile.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-maxSize.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-maxSize.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-maxSize.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-maxSize.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-observation-precondition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-observation-precondition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-observation-precondition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-observation-precondition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-observation-sequelTo.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-observation-sequelTo.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-observation-sequelTo.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-observation-sequelTo.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-patient-animal.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-patient-animal.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-patient-animal.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-patient-animal.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-patient-mothersMaidenName.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-patient-mothersMaidenName.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-patient-mothersMaidenName.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-patient-mothersMaidenName.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-patient-proficiency.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-patient-proficiency.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-patient-proficiency.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-patient-proficiency.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-questionnaire-itemControl.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-questionnaire-itemControl.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-questionnaire-itemControl.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-questionnaire-itemControl.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-resprate.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-resprate.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-resprate.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-resprate.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-servicerequest-precondition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-servicerequest-precondition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-servicerequest-precondition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-servicerequest-precondition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-shareableplandefinition.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-shareableplandefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-shareableplandefinition.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-shareableplandefinition.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-string.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-string.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-string.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-string.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-time.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-time.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-time.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-time.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-uri.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-uri.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-uri.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-uri.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-us-core-observation-lab.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-us-core-observation-lab.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-us-core-observation-lab.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-us-core-observation-lab.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-us-core-patient.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-us-core-patient.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-us-core-patient.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-us-core-patient.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-valueset-expression.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-valueset-expression.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-valueset-expression.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-valueset-expression.json
diff --git a/test/testhelpers/testdefs/package/StructureDefinition-vitalsigns.json b/test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-vitalsigns.json
similarity index 100%
rename from test/testhelpers/testdefs/package/StructureDefinition-vitalsigns.json
rename to test/testhelpers/testdefs/r4-definitions/package/StructureDefinition-vitalsigns.json
diff --git a/test/testhelpers/testdefs/package/ValueSet-allergyintolerance-clinical.json b/test/testhelpers/testdefs/r4-definitions/package/ValueSet-allergyintolerance-clinical.json
similarity index 100%
rename from test/testhelpers/testdefs/package/ValueSet-allergyintolerance-clinical.json
rename to test/testhelpers/testdefs/r4-definitions/package/ValueSet-allergyintolerance-clinical.json
diff --git a/test/testhelpers/testdefs/package/ValueSet-observation-category.json b/test/testhelpers/testdefs/r4-definitions/package/ValueSet-observation-category.json
similarity index 100%
rename from test/testhelpers/testdefs/package/ValueSet-observation-category.json
rename to test/testhelpers/testdefs/r4-definitions/package/ValueSet-observation-category.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-CarePlan.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-CarePlan.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-CarePlan.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-CarePlan.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-CodeableReference.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-CodeableReference.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-CodeableReference.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-CodeableReference.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Condition.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Condition.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Condition.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Condition.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-DomainResource.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-DomainResource.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-DomainResource.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-DomainResource.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Extension.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Extension.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Extension.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Extension.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Group.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Group.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Group.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Group.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-MedicationRequest.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-MedicationRequest.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-MedicationRequest.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-MedicationRequest.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Observation.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Observation.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Observation.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Observation.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Organization.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Organization.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Organization.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Organization.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Patient.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Patient.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Patient.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Patient.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Practitioner.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Practitioner.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Practitioner.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Practitioner.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Resource.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Resource.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Resource.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Resource.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-Signature.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Signature.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-Signature.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-Signature.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-StructureDefinition.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-StructureDefinition.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-StructureDefinition.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-StructureDefinition.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-actualgroup.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-actualgroup.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-actualgroup.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-actualgroup.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-bodyheight.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-bodyheight.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-bodyheight.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-bodyheight.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-bodyweight.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-bodyweight.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-bodyweight.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-bodyweight.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-string.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-string.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-string.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-string.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-uri.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-uri.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-uri.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-uri.json
diff --git a/test/testhelpers/testdefs/r5-definitions/StructureDefinition-vitalsigns.json b/test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-vitalsigns.json
similarity index 100%
rename from test/testhelpers/testdefs/r5-definitions/StructureDefinition-vitalsigns.json
rename to test/testhelpers/testdefs/r5-definitions/package/StructureDefinition-vitalsigns.json
diff --git a/test/utils/MasterFisher.test.ts b/test/utils/MasterFisher.test.ts
index 3c6bbe4..5fa6b35 100644
--- a/test/utils/MasterFisher.test.ts
+++ b/test/utils/MasterFisher.test.ts
@@ -51,11 +51,7 @@ describe('MasterFisher', () => {
     pkg.profiles.push(profile3, profile4);
 
     defs = new FHIRDefinitions();
-    loadFromPath(
-      path.join(__dirname, '..', 'testhelpers', 'testdefs', 'package'),
-      'test#1.1.1',
-      defs
-    );
+    loadFromPath(path.join(__dirname, '..', 'testhelpers', 'testdefs'), 'r4-definitions', defs);
 
     fisher = new MasterFisher(tank, defs, pkg);
   });