public async compileIGs()

in src/implementationGuides/IGCompiler.ts [98:118]


    public async compileIGs(igsDir: PathLike, outputPath: PathLike): Promise<void> {
        if (!existsSync(igsDir)) {
            throw new Error(`'${igsDir}' doesn't exist`);
        }
        const igInfos = await this.collectIGInfos(igsDir);
        this.validateDependencies(igInfos);

        const searchParams: any[] = [];
        const routingFhirDefinitions: any[] = [];
        for (const igInfo of igInfos) {
            searchParams.push(...(await this.collectResources(igInfo.path, ['SearchParameter'])));
            routingFhirDefinitions.push(
                ...(await this.collectResources(igInfo.path, ['StructureDefinition', 'OperationDefinition'])),
            );
        }
        const compiledSearchParams = await this.searchImplementationGuides.compile(searchParams);
        const compiledRoutingDefinitions = await this.routingImplementationGuides.compile(routingFhirDefinitions);

        await storeJson(path.join(outputPath.toString(), 'fhir-works-on-aws-search-es.json'), compiledSearchParams);
        await storeJson(path.join(outputPath.toString(), 'fhir-works-on-aws-routing.json'), compiledRoutingDefinitions);
    }