import type { Expression, QuestionnaireResponse, QuestionnaireResponseItem } from 'fhir/r4'; import type { EnableWhenExpressions } from '../interfaces/enableWhen.interface'; import type { TargetConstraint } from '../interfaces/targetConstraint.interface'; import type { Variables, VariableXFhirQuery } from '../interfaces'; import type { ComputedQRItemUpdates } from '../interfaces/computedUpdates.interface'; import type { AnswerOptionsToggleExpression } from '../interfaces/answerOptionsToggleExpression.interface'; interface ExpressionUpdate { isUpdated: boolean; value: T; } export declare function evaluateOtherExpressions(updatedResponse: QuestionnaireResponse, updatedResponseItemMap: Record, variables: Variables, existingFhirPathContext: Record, existingFhirPathTerminologyCache: Record, targetConstraints: Record, enableWhenExpressions: EnableWhenExpressions, answerOptionsToggleExpressions: Record, processedValueSets: Record, terminologyServerUrl: string): Promise<{ updatedFhirPathContext: Record; updatedFhirPathTerminologyCache: Record; targetConstraintsUpdate: ExpressionUpdate>; enableWhenExpressionsUpdate: ExpressionUpdate; answerOptionsToggleExpressionsUpdate: ExpressionUpdate>; processedValueSetsUpdate: ExpressionUpdate>; computedQRItemUpdates: ComputedQRItemUpdates; }>; export declare function createFhirPathContext(questionnaireResponse: QuestionnaireResponse, questionnaireResponseItemMap: Record, variables: Variables, existingFhirPathContext: Record, fhirPathTerminologyCache: Record, terminologyServerUrl: string): Promise<{ fhirPathContext: Record; fhirPathTerminologyCache: Record; }>; export declare function addEmptyXFhirQueryVariablesToFhirPathContext(fhirPathContext: Record, variablesXFhirQuery: Record): Record; export declare function evaluateLinkIdVariables(linkId: string, variablesFhirPath: Record, fhirPathContext: Record, fhirPathTerminologyCache: Record, terminologyServerUrl: string, qrItem?: QuestionnaireResponseItem): Promise<{ fhirPathContext: Record; fhirPathTerminologyCache: Record; }>; export declare function evaluateQuestionnaireLevelVariables(resource: QuestionnaireResponse, variablesFhirPath: Record, fhirPathContext: Record, fhirPathTerminologyCache: Record, terminologyServerUrl: string): Promise<{ fhirPathContext: Record; fhirPathTerminologyCache: Record; }>; export declare function handleFhirPathResult(result: any[] | Promise): Promise; /** * Determines whether a FHIRPath expression result is cached. * * Expressions containing variables (e.g. `%something`) are never considered cached, because we can never know what a variable resolves to at runtime. * * @param {string} expression - The FHIRPath expression to check. * @param {Record} fhirPathTerminologyCache - Object storing cached expression results. * @returns {boolean} `true` if the expression is cached and contains no variables; otherwise `false`. */ export declare function isExpressionCached(expression: string, fhirPathTerminologyCache: Record): boolean; /** * Caches the result of a FHIRPath evaluation if it was an asynchronous terminology call and the expression contains no variables (e.g. `%something`). * * @param {string} expression - The FHIRPath expression that was evaluated. * @param {any} result - The evaluated result of the expression with async resolved. * @param {Record} fhirPathTerminologyCache - The cache object to store results. */ export declare function cacheTerminologyResult(expression: string, result: any, fhirPathTerminologyCache: Record): void; export {};