From ef45bf9428adbbd76308a62a869161989d9614d8 Mon Sep 17 00:00:00 2001 From: yeexianfong Date: Fri, 18 Oct 2024 09:52:05 +1100 Subject: [PATCH 1/2] Fix checkbox open label string input --- .../smart-forms-renderer/src/utils/openChoice.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/smart-forms-renderer/src/utils/openChoice.ts b/packages/smart-forms-renderer/src/utils/openChoice.ts index 21e4f824..878eacc0 100644 --- a/packages/smart-forms-renderer/src/utils/openChoice.ts +++ b/packages/smart-forms-renderer/src/utils/openChoice.ts @@ -106,10 +106,21 @@ export function updateOpenLabelAnswer( } // New open label answer is different from old open label answer, update it - oldOpenLabelAnswer.valueString = changedOpenLabelValue; + const updatedAnswers = oldQrItem.answer?.map((answer) => { + const { valueString } = answer; + if (valueString === oldOpenLabelAnswer.valueString) { + return { + ...answer, + valueString: changedOpenLabelValue // Update the valueString + }; + } + + return answer; // Keep the other answers unchanged + }); + return { ...oldQrItem, - answer: oldQrItem.answer + answer: updatedAnswers }; } From 2d66fccc0469ff0dc4149ee35e1d5591139224ed Mon Sep 17 00:00:00 2001 From: yeexianfong Date: Fri, 18 Oct 2024 10:07:23 +1100 Subject: [PATCH 2/2] Fix checkbox open label string input --- CHANGELOG.md | 3 +++ apps/smart-forms-app/package.json | 2 +- documentation/package.json | 2 +- package-lock.json | 6 +++--- packages/smart-forms-renderer/package.json | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8ddb27..47f60131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ This log documents significant changes for the [@aehrc/smart-forms-renderer](htt Changelog only includes changes from version 0.36.0 onwards. +## [0.44.2] - 2024-10-18 +### Fixed +- Fixed an issue where inputs in checkbox open-choice's open label field does not update the QuestionnaireResponse. ## [0.44.1] - 2024-10-14 ### Fixed diff --git a/apps/smart-forms-app/package.json b/apps/smart-forms-app/package.json index bd5bcc6a..2929191d 100644 --- a/apps/smart-forms-app/package.json +++ b/apps/smart-forms-app/package.json @@ -28,7 +28,7 @@ "dependencies": { "@aehrc/sdc-assemble": "^1.3.1", "@aehrc/sdc-populate": "^2.3.1", - "@aehrc/smart-forms-renderer": "^0.44.1", + "@aehrc/smart-forms-renderer": "^0.44.2", "@emotion/react": "^11.13.0", "@emotion/styled": "^11.13.0", "@fontsource/material-icons": "^5.0.18", diff --git a/documentation/package.json b/documentation/package.json index 7f6c60f1..2df0f20f 100644 --- a/documentation/package.json +++ b/documentation/package.json @@ -15,7 +15,7 @@ "typecheck": "tsc" }, "dependencies": { - "@aehrc/smart-forms-renderer": "^0.44.1", + "@aehrc/smart-forms-renderer": "^0.44.2", "@docusaurus/core": "^3.4.0", "@docusaurus/preset-classic": "^3.4.0", "@docusaurus/theme-live-codeblock": "^3.4.0", diff --git a/package-lock.json b/package-lock.json index 07923fe1..bfaf0aa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "dependencies": { "@aehrc/sdc-assemble": "^1.3.1", "@aehrc/sdc-populate": "^2.3.1", - "@aehrc/smart-forms-renderer": "^0.44.0", + "@aehrc/smart-forms-renderer": "^0.44.2", "@emotion/react": "^11.13.0", "@emotion/styled": "^11.13.0", "@fontsource/material-icons": "^5.0.18", @@ -451,7 +451,7 @@ "name": "@aehrc/smart-forms-documentation", "version": "0.0.0", "dependencies": { - "@aehrc/smart-forms-renderer": "^0.44.0", + "@aehrc/smart-forms-renderer": "^0.44.2", "@docusaurus/core": "^3.4.0", "@docusaurus/preset-classic": "^3.4.0", "@docusaurus/theme-live-codeblock": "^3.4.0", @@ -39546,7 +39546,7 @@ }, "packages/smart-forms-renderer": { "name": "@aehrc/smart-forms-renderer", - "version": "0.44.0", + "version": "0.44.2", "license": "Apache-2.0", "dependencies": { "@aehrc/sdc-populate": "^2.3.1", diff --git a/packages/smart-forms-renderer/package.json b/packages/smart-forms-renderer/package.json index abb48957..0f2200b5 100644 --- a/packages/smart-forms-renderer/package.json +++ b/packages/smart-forms-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@aehrc/smart-forms-renderer", - "version": "0.44.1", + "version": "0.44.2", "description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms", "main": "lib/index.js", "scripts": {