From d032ee8b79de95289cfc19b4f9d0d1b1e6bbbbc1 Mon Sep 17 00:00:00 2001 From: kjefferson Date: Mon, 16 Sep 2024 08:57:20 -0400 Subject: [PATCH] adding conditional feedback --- src/export/ValueSetExporter.ts | 2 +- test/export/ValueSetExporter.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/export/ValueSetExporter.ts b/src/export/ValueSetExporter.ts index aacf9fd9..19c1b776 100644 --- a/src/export/ValueSetExporter.ts +++ b/src/export/ValueSetExporter.ts @@ -184,7 +184,7 @@ export class ValueSetExporter { this.addConceptComposeElement(composeElement, valueSet.compose.include); } } else { - if (composeElement.valueSet?.length != 0) { + if (composeElement.valueSet?.length !== 0 || composeElement.system != undefined) { valueSet.compose.include.push(composeElement); } } diff --git a/test/export/ValueSetExporter.test.ts b/test/export/ValueSetExporter.test.ts index f146da8d..78baa7b5 100644 --- a/test/export/ValueSetExporter.test.ts +++ b/test/export/ValueSetExporter.test.ts @@ -478,6 +478,7 @@ describe('ValueSetExporter', () => { valueSet.id = 'dinner-vs'; const component = new ValueSetConceptComponentRule(true); component.from = { + system: 'http://food.org/food1', valueSets: [ 'http://food.org/food/ValueSet/hot-food', 'http://food.org/food/ValueSet/cold-food', @@ -488,6 +489,7 @@ describe('ValueSetExporter', () => { }; const component2 = new ValueSetConceptComponentRule(true); component2.from = { + system: 'http://food.org/food2', valueSets: ['DinnerVS', 'http://hl7.org/fhir/us/minimal/ValueSet/dinner-vs', 'dinner-vs'] }; valueSet.rules.push(component); @@ -504,10 +506,14 @@ describe('ValueSetExporter', () => { compose: { include: [ { + system: 'http://food.org/food1', valueSet: [ 'http://food.org/food/ValueSet/hot-food', 'http://food.org/food/ValueSet/cold-food' ] + }, + { + system: 'http://food.org/food2' } ] }