Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support FHIR R6 #272

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 76 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"fhir-package-loader": "^1.0.0",
"flat": "^5.0.2",
"fs-extra": "^11.2.0",
"fsh-sushi": "^3.11.0",
"fsh-sushi": "^3.12.0",
"ini": "^4.1.3",
"lodash": "^4.17.21",
"readline-sync": "^1.4.10",
Expand Down
18 changes: 2 additions & 16 deletions src/utils/Processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export async function loadExternalDependencies(
config.config.dependencies?.map(
(dep: fhirtypes.ImplementationGuideDependsOn) => `${dep.packageId}@${dep.version}`
) ?? [];
const fhirPackageId = determineCorePackageId(config.config.fhirVersion[0]);
const fhirPackageId = utils.getFHIRVersionInfo(config.config.fhirVersion[0])?.packageId;
if (!allDependencies.includes(`${fhirPackageId}@${config.config.fhirVersion[0]}`)) {
allDependencies.push(`${fhirPackageId}@${config.config.fhirVersion[0]}`);
}
Expand All @@ -139,7 +139,7 @@ export function loadConfiguredDependencies(
dependencies: string[] = []
): Promise<FHIRDefinitions | void>[] {
// Automatically include FHIR R4 if no other versions of FHIR are already included
if (!dependencies.some(dep => /hl7\.fhir\.r(4|5|4b)\.core/.test(dep))) {
if (!dependencies.some(dep => /hl7\.fhir\.r(4|5|4b|6)\.core/.test(dep))) {
dependencies.push('[email protected]');
}

Expand Down Expand Up @@ -333,20 +333,6 @@ export function getFilesRecursive(dir: string): string[] {
}
}

export function determineCorePackageId(fhirVersion: string): string {
if (/^4\.0\./.test(fhirVersion)) {
return 'hl7.fhir.r4.core';
} else if (/^(4\.1\.|4\.3.\d+-)/.test(fhirVersion)) {
return 'hl7.fhir.r4b.core';
} else if (/^4\.3.\d+$/.test(fhirVersion)) {
return 'hl7.fhir.r4b.core';
} else if (/^5\.0.\d+$/.test(fhirVersion)) {
return 'hl7.fhir.r5.core';
} else {
return 'hl7.fhir.r5.core';
}
}

const IGNORED_RESOURCE_LIKE_FILES = [
// If expansions.json is in an output directory, it was likely generated by the IG Publisher
// Since it is a generated file and it can be large, we skip processing it
Expand Down
Loading
Loading