From d7dfc98f33b0335f1f7db60e64ce06b7def78142 Mon Sep 17 00:00:00 2001 From: Edwin Tan Date: Tue, 19 Nov 2024 15:13:23 -0800 Subject: [PATCH 1/2] MAT-7852: set activeOnly argument to false when expansion type is Latest (when manifestExpansion is null, expansion type is Latest. When manifestExpansion is not null, expansion type is Manifest) --- src/api/useTerminologyServiceApi.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/useTerminologyServiceApi.ts b/src/api/useTerminologyServiceApi.ts index f40623226..54aac605f 100644 --- a/src/api/useTerminologyServiceApi.ts +++ b/src/api/useTerminologyServiceApi.ts @@ -17,6 +17,7 @@ type ValueSetSearchParams = { type ValueSetsSearchCriteria = { profile: string; includeDraft: "yes" | "no"; + activeOnly: string; manifestExpansion: ManifestExpansion; valueSetParams: ValueSetSearchParams[]; }; @@ -78,6 +79,7 @@ export class TerminologyServiceApi { } const searchCriteria: ValueSetsSearchCriteria = { includeDraft: "yes", // always yes for now + activeOnly: manifestExpansion ? "true" : "false", profile: "", manifestExpansion: manifestExpansion, valueSetParams: this.getValueSetsOIDsFromCqmMeasure( From 7705d4288a633f9328800e5fec9c1dd99e777329 Mon Sep 17 00:00:00 2001 From: Edwin Tan Date: Wed, 20 Nov 2024 10:24:26 -0800 Subject: [PATCH 2/2] MAT-7852: add/modify unit tests --- src/api/TerminologyServiceApi.test.ts | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/api/TerminologyServiceApi.test.ts b/src/api/TerminologyServiceApi.test.ts index d3bb55766..62a92ec13 100644 --- a/src/api/TerminologyServiceApi.test.ts +++ b/src/api/TerminologyServiceApi.test.ts @@ -84,7 +84,7 @@ describe("TerminologyServiceApi Tests", () => { }); }); - it("Should call Terminology Service URL to fetch value set expansions when manifest Expansion feature flag is true", () => { + it("Should call Terminology Service URL to fetch value set expansions when manifest Expansion feature flag is true and activeOnly is set to 'true' when manifestExpansion is truthy (expansion type is Manifest)", () => { axios.put = jest .fn() .mockResolvedValue({ data: cqm_measure_basic_valueset }); @@ -101,6 +101,32 @@ describe("TerminologyServiceApi Tests", () => { fullUrl: "https://cts.nlm.nih.gov/fhir/Library/mu2-update-2015-05-01", id: "mu2-update-2015-05-01", }, + activeOnly: "true", + profile: "", + valueSetParams: [ + { oid: "2.16.840.1.113883.3.666.5.307" }, + { oid: "2.16.840.1.113883.3.464.1003.103.12.1001" }, + ], + }, + { headers: { Authorization: "Bearer undefined" }, signal: true } + ); + }); + + it("Should call Terminology Service URL to fetch value set expansions when manifest Expansion feature flag is true and activeOnly is set to 'false' when manifestExpansion is falsy (expansion type is Latest)", () => { + axios.put = jest + .fn() + .mockResolvedValue({ data: cqm_measure_basic_valueset }); + const result = terminologyService.getQdmValueSetsExpansion( + cqm_measure_basic, + null, + true + ); + expect(axios.put).toBeCalledWith( + "test.url/terminology/value-sets/expansion/qdm", + { + includeDraft: "yes", + manifestExpansion: null, + activeOnly: "false", profile: "", valueSetParams: [ { oid: "2.16.840.1.113883.3.666.5.307" }, @@ -128,6 +154,7 @@ describe("TerminologyServiceApi Tests", () => { "https://cts.nlm.nih.gov/fhir/Library/mu2-update-2015-05-01", id: "mu2-update-2015-05-01", }, + activeOnly: "true", profile: "", valueSetParams: [ { oid: "2.16.840.1.113883.3.666.5.307" },