import type { QuestionnaireItemEnableWhen, QuestionnaireResponse, QuestionnaireResponseItemAnswer } from 'fhir/r4'; import type { EnableWhenItems, EnableWhenRepeatItemProperties, EnableWhenSingleItemProperties } from '../interfaces/enableWhen.interface'; /** * Create a linkedQuestionsMap that contains linked items of enableWhen items * mapped to an array containing all its respective enableWhen items' linkIds * returns a key-value pair of * * @author Sean Fong */ export declare function createEnableWhenLinkedQuestions(enableWhenItems: EnableWhenItems): Record; /** * Performs switching for non-group enableWhenItems based on their item types. * * @author Sean Fong */ export declare function isEnabledAnswerTypeSwitcher(enableWhen: QuestionnaireItemEnableWhen, answer: QuestionnaireResponseItemAnswer): boolean; export declare function mutateRepeatEnableWhenItemInstances(items: EnableWhenItems, parentRepeatGroupLinkId: string, parentRepeatGroupIndex: number, actionType: 'add' | 'remove'): EnableWhenItems; /** * Read initial answer values in questionnaireResponse * return a map of initial values with key-value pair * * @author Sean Fong */ export declare function readInitialAnswers(questionnaireResponse: QuestionnaireResponse, linkedQuestionsMap: Record): Record; /** * Set initial answer values into enableWhenItems' answer attributes * Update enabled status of each enableWhenItem simultaneously * * @author Sean Fong */ export declare function setInitialAnswers(initialAnswers: Record, items: EnableWhenItems, linkedQuestionsMap: Record): EnableWhenItems; /** * Update answer of the target linkId in every related enableWhenItem's linked items * Then update the enabled status of every related enableWhenItem * * @author Sean Fong */ export declare function updateEnableWhenItemAnswer(items: EnableWhenItems, linkedQuestions: string[], linkId: string, newAnswer: QuestionnaireResponseItemAnswer[] | undefined, parentRepeatGroupIndex: number | null): EnableWhenItems; /** * Check if a single enableWhenItem is enabled based on the answer of its linked items * * @author Sean Fong */ export declare function checkItemIsEnabledSingle(enableWhenItemProperties: EnableWhenSingleItemProperties): boolean; /** * Check if a repeat enableWhenItem is enabled based on the answer of its linked items * * @author Sean Fong */ export declare function checkItemIsEnabledRepeat(enableWhenItemProperties: EnableWhenRepeatItemProperties, parentRepeatGroupIndex: number): boolean; export declare function assignPopulatedAnswersToEnableWhen(items: EnableWhenItems, questionnaireResponse: QuestionnaireResponse): { initialisedItems: EnableWhenItems; linkedQuestions: Record; };