in src/implementationGuides/IGCompiler.ts [71:89]
private async collectResources(
igDir: PathLike,
resourceTypes: ('SearchParameter' | 'StructureDefinition' | 'OperationDefinition')[],
): Promise<any[]> {
const indexJson = path.join(igDir.toString(), '.index.json');
if (!existsSync(indexJson)) {
throw new Error(`'.index.json' not found in ${igDir}`);
}
const index: any = await loadJson(indexJson);
const resources = [];
for (const file of index.files) {
if (resourceTypes.includes(file.resourceType)) {
const filePath = path.join(igDir.toString(), file.filename);
console.log(`Compiling ${filePath}`);
resources.push(await loadJson(filePath));
}
}
return resources;
}