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

Update to latest SUSHI and FPL #278

Merged
merged 1 commit into from
Dec 31, 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
143 changes: 127 additions & 16 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"diff": "^7.0.0",
"diff2html": "^3.4.48",
"fhir": "^4.12.0",
"fhir-package-loader": "^2.0.1",
"fhir-package-loader": "^2.1.0",
"flat": "^5.0.2",
"fs-extra": "^11.2.0",
"fsh-sushi": "^3.13.1",
"fsh-sushi": "^3.14.0",
"ini": "^5.0.0",
"lodash": "^4.17.21",
"readline-sync": "^1.4.10",
Expand Down
4 changes: 4 additions & 0 deletions src/processor/LakeOfFHIR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export class LakeOfFHIR implements utils.Fishable {
return this.defs.fishForMetadata(item, ...types);
}

fishForMetadatas(item: string, ...types: utils.Type[]): utils.Metadata[] {
return this.defs.fishForMetadatas(item, ...types);
}

/**
* Removes any definitions from this.docs that have the same resourceType and id as
* a previous definition, as long as there is a defined id.
Expand Down
7 changes: 7 additions & 0 deletions src/utils/MasterFisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,11 @@ export class MasterFisher implements utils.Fishable {
this.external?.fishForMetadata(item, ...types)
);
}

fishForMetadatas(item: string, ...types: utils.Type[]): utils.Metadata[] {
return [
...this.lakeOfFHIR.fishForMetadatas(item, ...types),
...(this.external?.fishForMetadatas(item, ...types) ?? [])
];
}
}
21 changes: 21 additions & 0 deletions test/utils/MasterFisher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ describe('MasterFisher', () => {
});
});

describe('#fishForMetadatas', () => {
let lakeSpy: jest.SpyInstance;
let fhirSpy: jest.SpyInstance;

beforeEach(() => {
lakeSpy = jest.spyOn(lake, 'fishForMetadatas');
fhirSpy = jest.spyOn(fhir, 'fishForMetadatas');
});

afterEach(() => jest.clearAllMocks());

it('should return all matches from the lake and the FHIR defs', () => {
lakeSpy.mockReturnValue([RESOURCE_A_METADATA]);
fhirSpy.mockReturnValue([RESOURCE_B_METADATA]);
expect(fisher.fishForMetadatas('Foo', utils.Type.Resource)).toEqual([
RESOURCE_A_METADATA,
RESOURCE_B_METADATA
]);
});
});

describe('#lakeOfFHIR', () => {
afterEach(() => jest.clearAllMocks());

Expand Down
Loading