Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

MAT-7852: set activeOnly argument to false when expansion type is Lat… #765

Closed
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
29 changes: 28 additions & 1 deletion src/api/TerminologyServiceApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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" },
Expand Down Expand Up @@ -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" },
Expand Down
2 changes: 2 additions & 0 deletions src/api/useTerminologyServiceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type ValueSetSearchParams = {
type ValueSetsSearchCriteria = {
profile: string;
includeDraft: "yes" | "no";
activeOnly: string;
manifestExpansion: ManifestExpansion;
valueSetParams: ValueSetSearchParams[];
};
Expand Down Expand Up @@ -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(
Expand Down
Loading