From 984298863fca660d3003f9ebbd821a89bb4484e1 Mon Sep 17 00:00:00 2001 From: Elena Grednikova Date: Mon, 18 Nov 2024 18:58:12 +0100 Subject: [PATCH] Update getting cqf expresioon for _text, _required and _readOnly --- sdc-qrf/src/components.tsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sdc-qrf/src/components.tsx b/sdc-qrf/src/components.tsx index 8603602..fa56386 100644 --- a/sdc-qrf/src/components.tsx +++ b/sdc-qrf/src/components.tsx @@ -15,13 +15,7 @@ import { QuestionItemProps, QuestionItemsProps, } from './types'; -import { - calcContext, - findExtensionByUrl, - getBranchItems, - getEnabledQuestions, - wrapAnswerValue, -} from './utils'; +import { calcContext, getBranchItems, getEnabledQuestions, wrapAnswerValue } from './utils'; export function usePreviousValue(value: T) { const prevValue = useRef(); @@ -57,8 +51,6 @@ export function QuestionItems(props: QuestionItemsProps) { ); } -const cqfExpressionExtensionUrl = 'http://hl7.org/fhir/StructureDefinition/cqf-expression'; - export function QuestionItem(props: QuestionItemProps) { const { questionItem: initialQuestionItem, context: initialContext, parentPath } = props; const { @@ -147,8 +139,7 @@ export function QuestionItem(props: QuestionItemProps) { useEffect(() => { if (itemContext && _text) { - const extension = findExtensionByUrl(cqfExpressionExtensionUrl, _text.extension); - const cqfExpression = extension?.valueExpression; + const cqfExpression = _text.cqfExpression; const calculatedValue = evaluateQuestionItemExpression( linkId, @@ -166,8 +157,7 @@ export function QuestionItem(props: QuestionItemProps) { } if (itemContext && _readOnly) { - const extension = findExtensionByUrl(cqfExpressionExtensionUrl, _readOnly.extension); - const cqfExpression = extension?.valueExpression; + const cqfExpression = _readOnly.cqfExpression; const calculatedValue = evaluateQuestionItemExpression( linkId, @@ -185,8 +175,7 @@ export function QuestionItem(props: QuestionItemProps) { } if (itemContext && _required) { - const extension = findExtensionByUrl(cqfExpressionExtensionUrl, _required.extension); - const cqfExpression = extension?.valueExpression; + const cqfExpression = _required.cqfExpression; const calculatedValue = evaluateQuestionItemExpression( linkId,