@openmrs/esm-fast-data-entry-app 1.0.1-pre.127 → 1.0.1-pre.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/129.js +1 -0
  2. package/dist/129.js.map +1 -0
  3. package/dist/153.js +1 -1
  4. package/dist/153.js.map +1 -1
  5. package/dist/208.js +1 -1
  6. package/dist/319.js +1 -1
  7. package/dist/365.js +1 -0
  8. package/dist/365.js.map +1 -0
  9. package/dist/436.js +1 -0
  10. package/dist/436.js.map +1 -0
  11. package/dist/460.js +1 -1
  12. package/dist/540.js +1 -1
  13. package/dist/540.js.map +1 -1
  14. package/dist/574.js +1 -1
  15. package/dist/591.js +1 -1
  16. package/dist/593.js +1 -1
  17. package/dist/706.js +1 -1
  18. package/dist/706.js.map +1 -1
  19. package/dist/757.js +1 -1
  20. package/dist/788.js +1 -1
  21. package/dist/807.js +1 -1
  22. package/dist/833.js +1 -1
  23. package/dist/883.js +1 -1
  24. package/dist/883.js.map +1 -1
  25. package/dist/main.js +1 -1
  26. package/dist/main.js.map +1 -1
  27. package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
  28. package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +114 -114
  29. package/dist/routes.json +1 -1
  30. package/package.json +1 -1
  31. package/src/FormBootstrap.tsx +10 -1
  32. package/src/config-schema.ts +20 -0
  33. package/src/group-form-entry-workflow/SessionDetailsForm.tsx +50 -4
  34. package/src/group-form-entry-workflow/configurable-questions/ConfigurableQuestionsSection.tsx +47 -0
  35. package/src/hooks/index.ts +8 -1
  36. package/src/hooks/useForm.ts +69 -0
  37. package/src/types.ts +20 -0
  38. package/translations/am.json +3 -0
  39. package/translations/ar.json +3 -0
  40. package/translations/en.json +3 -0
  41. package/translations/es.json +3 -0
  42. package/translations/fr.json +3 -0
  43. package/translations/he.json +3 -0
  44. package/translations/km.json +3 -0
  45. package/dist/262.js +0 -1
  46. package/dist/262.js.map +0 -1
  47. package/dist/279.js +0 -1
  48. package/dist/279.js.map +0 -1
  49. package/dist/889.js +0 -1
  50. package/dist/889.js.map +0 -1
@@ -5,10 +5,35 @@
5
5
  "initial": false,
6
6
  "entry": false,
7
7
  "recorded": false,
8
- "size": 3686,
8
+ "reason": "split chunk (cache group: default)",
9
+ "size": 33069,
10
+ "sizes": {
11
+ "javascript": 33069
12
+ },
13
+ "names": [],
14
+ "idHints": [],
15
+ "runtime": [
16
+ "@openmrs/esm-fast-data-entry-app",
17
+ "main"
18
+ ],
19
+ "files": [
20
+ "129.js"
21
+ ],
22
+ "auxiliaryFiles": [
23
+ "129.js.map"
24
+ ],
25
+ "hash": "e8ae4551aa0d5373",
26
+ "childrenByOrder": {}
27
+ },
28
+ {
29
+ "rendered": true,
30
+ "initial": false,
31
+ "entry": false,
32
+ "recorded": false,
33
+ "size": 4296,
9
34
  "sizes": {
10
35
  "consume-shared": 42,
11
- "javascript": 3644
36
+ "javascript": 4254
12
37
  },
13
38
  "names": [],
14
39
  "idHints": [],
@@ -21,7 +46,7 @@
21
46
  "auxiliaryFiles": [
22
47
  "153.js.map"
23
48
  ],
24
- "hash": "126e60e969bd28b8",
49
+ "hash": "fae59810468fd55f",
25
50
  "childrenByOrder": {}
26
51
  },
27
52
  {
@@ -29,10 +54,10 @@
29
54
  "initial": true,
30
55
  "entry": true,
31
56
  "recorded": false,
32
- "size": 25371,
57
+ "size": 25981,
33
58
  "sizes": {
34
59
  "consume-shared": 42,
35
- "javascript": 3644,
60
+ "javascript": 4254,
36
61
  "share-init": 336,
37
62
  "runtime": 21349
38
63
  },
@@ -49,7 +74,7 @@
49
74
  "auxiliaryFiles": [
50
75
  "main.js.map"
51
76
  ],
52
- "hash": "73f7b8341c1676ce",
77
+ "hash": "6efd2ce10c1955f8",
53
78
  "childrenByOrder": {}
54
79
  },
55
80
  {
@@ -94,7 +119,7 @@
94
119
  "auxiliaryFiles": [
95
120
  "208.js.map"
96
121
  ],
97
- "hash": "b1b1d768a028963c",
122
+ "hash": "5e0e7e25b7483016",
98
123
  "childrenByOrder": {}
99
124
  },
100
125
  {
@@ -102,11 +127,9 @@
102
127
  "initial": false,
103
128
  "entry": false,
104
129
  "recorded": false,
105
- "reason": "split chunk (cache group: default)",
106
- "size": 57424,
130
+ "size": 7103,
107
131
  "sizes": {
108
- "javascript": 57382,
109
- "consume-shared": 42
132
+ "javascript": 7103
110
133
  },
111
134
  "names": [],
112
135
  "idHints": [],
@@ -115,12 +138,12 @@
115
138
  "main"
116
139
  ],
117
140
  "files": [
118
- "262.js"
141
+ "294.js"
119
142
  ],
120
143
  "auxiliaryFiles": [
121
- "262.js.map"
144
+ "294.js.map"
122
145
  ],
123
- "hash": "e5d903fa6f684231",
146
+ "hash": "8eb39e4e55a4f546",
124
147
  "childrenByOrder": {}
125
148
  },
126
149
  {
@@ -128,10 +151,9 @@
128
151
  "initial": false,
129
152
  "entry": false,
130
153
  "recorded": false,
131
- "size": 160059,
154
+ "size": 3299,
132
155
  "sizes": {
133
- "javascript": 160017,
134
- "consume-shared": 42
156
+ "javascript": 3299
135
157
  },
136
158
  "names": [],
137
159
  "idHints": [],
@@ -140,12 +162,10 @@
140
162
  "main"
141
163
  ],
142
164
  "files": [
143
- "279.js"
144
- ],
145
- "auxiliaryFiles": [
146
- "279.js.map"
165
+ "319.js"
147
166
  ],
148
- "hash": "6a85219975d70c1d",
167
+ "auxiliaryFiles": [],
168
+ "hash": "c015935a478dda18",
149
169
  "childrenByOrder": {}
150
170
  },
151
171
  {
@@ -153,9 +173,10 @@
153
173
  "initial": false,
154
174
  "entry": false,
155
175
  "recorded": false,
156
- "size": 7103,
176
+ "size": 134801,
157
177
  "sizes": {
158
- "javascript": 7103
178
+ "javascript": 134759,
179
+ "consume-shared": 42
159
180
  },
160
181
  "names": [],
161
182
  "idHints": [],
@@ -164,34 +185,12 @@
164
185
  "main"
165
186
  ],
166
187
  "files": [
167
- "294.js"
188
+ "365.js"
168
189
  ],
169
190
  "auxiliaryFiles": [
170
- "294.js.map"
171
- ],
172
- "hash": "8eb39e4e55a4f546",
173
- "childrenByOrder": {}
174
- },
175
- {
176
- "rendered": true,
177
- "initial": false,
178
- "entry": false,
179
- "recorded": false,
180
- "size": 3064,
181
- "sizes": {
182
- "javascript": 3064
183
- },
184
- "names": [],
185
- "idHints": [],
186
- "runtime": [
187
- "@openmrs/esm-fast-data-entry-app",
188
- "main"
191
+ "365.js.map"
189
192
  ],
190
- "files": [
191
- "319.js"
192
- ],
193
- "auxiliaryFiles": [],
194
- "hash": "0949ab32d9aeff5a",
193
+ "hash": "2e6b0af471e92920",
195
194
  "childrenByOrder": {}
196
195
  },
197
196
  {
@@ -243,14 +242,13 @@
243
242
  "childrenByOrder": {}
244
243
  },
245
244
  {
246
- "rendered": false,
245
+ "rendered": true,
247
246
  "initial": false,
248
247
  "entry": false,
249
248
  "recorded": false,
250
- "reason": "split chunk (cache group: default)",
251
- "size": 42,
249
+ "size": 400,
252
250
  "sizes": {
253
- "consume-shared": 42
251
+ "javascript": 400
254
252
  },
255
253
  "names": [],
256
254
  "idHints": [],
@@ -258,9 +256,13 @@
258
256
  "@openmrs/esm-fast-data-entry-app",
259
257
  "main"
260
258
  ],
261
- "files": [],
262
- "auxiliaryFiles": [],
263
- "hash": "97a5374ef7355233",
259
+ "files": [
260
+ "415.js"
261
+ ],
262
+ "auxiliaryFiles": [
263
+ "415.js.map"
264
+ ],
265
+ "hash": "dede8f046ad98c9b",
264
266
  "childrenByOrder": {}
265
267
  },
266
268
  {
@@ -268,9 +270,11 @@
268
270
  "initial": false,
269
271
  "entry": false,
270
272
  "recorded": false,
271
- "size": 400,
273
+ "reason": "split chunk (cache group: default)",
274
+ "size": 82756,
272
275
  "sizes": {
273
- "javascript": 400
276
+ "javascript": 82714,
277
+ "consume-shared": 42
274
278
  },
275
279
  "names": [],
276
280
  "idHints": [],
@@ -279,12 +283,12 @@
279
283
  "main"
280
284
  ],
281
285
  "files": [
282
- "415.js"
286
+ "436.js"
283
287
  ],
284
288
  "auxiliaryFiles": [
285
- "415.js.map"
289
+ "436.js.map"
286
290
  ],
287
- "hash": "dede8f046ad98c9b",
291
+ "hash": "e650ac391294ec04",
288
292
  "childrenByOrder": {}
289
293
  },
290
294
  {
@@ -311,7 +315,7 @@
311
315
  "auxiliaryFiles": [
312
316
  "openmrs-esm-fast-data-entry-app.js.map"
313
317
  ],
314
- "hash": "d67a6ac76ee7d773",
318
+ "hash": "ececcaf6ccc4ed45",
315
319
  "childrenByOrder": {}
316
320
  },
317
321
  {
@@ -319,9 +323,9 @@
319
323
  "initial": false,
320
324
  "entry": false,
321
325
  "recorded": false,
322
- "size": 2613,
326
+ "size": 2814,
323
327
  "sizes": {
324
- "javascript": 2613
328
+ "javascript": 2814
325
329
  },
326
330
  "names": [],
327
331
  "idHints": [],
@@ -333,7 +337,7 @@
333
337
  "460.js"
334
338
  ],
335
339
  "auxiliaryFiles": [],
336
- "hash": "3f81d8a7f6ab4a6a",
340
+ "hash": "ba8802233b03121d",
337
341
  "childrenByOrder": {}
338
342
  },
339
343
  {
@@ -422,9 +426,9 @@
422
426
  "initial": false,
423
427
  "entry": false,
424
428
  "recorded": false,
425
- "size": 79976,
429
+ "size": 61957,
426
430
  "sizes": {
427
- "javascript": 79976
431
+ "javascript": 61957
428
432
  },
429
433
  "names": [],
430
434
  "idHints": [],
@@ -438,7 +442,7 @@
438
442
  "auxiliaryFiles": [
439
443
  "540.js.map"
440
444
  ],
441
- "hash": "fe9a7e7357e69061",
445
+ "hash": "ac99f86398137b46",
442
446
  "childrenByOrder": {}
443
447
  },
444
448
  {
@@ -473,9 +477,9 @@
473
477
  "initial": false,
474
478
  "entry": false,
475
479
  "recorded": false,
476
- "size": 2693,
480
+ "size": 2894,
477
481
  "sizes": {
478
- "javascript": 2693
482
+ "javascript": 2894
479
483
  },
480
484
  "names": [],
481
485
  "idHints": [],
@@ -487,7 +491,7 @@
487
491
  "574.js"
488
492
  ],
489
493
  "auxiliaryFiles": [],
490
- "hash": "e110ffd83ac1f796",
494
+ "hash": "0c5a8a30f7b9dd9e",
491
495
  "childrenByOrder": {}
492
496
  },
493
497
  {
@@ -514,7 +518,7 @@
514
518
  "auxiliaryFiles": [
515
519
  "591.js.map"
516
520
  ],
517
- "hash": "8012cc220c8b3404",
521
+ "hash": "29819f58e854e7cc",
518
522
  "childrenByOrder": {}
519
523
  },
520
524
  {
@@ -538,7 +542,7 @@
538
542
  "auxiliaryFiles": [
539
543
  "593.js.map"
540
544
  ],
541
- "hash": "27530c0417ab2d57",
545
+ "hash": "142d85a741dfee21",
542
546
  "childrenByOrder": {}
543
547
  },
544
548
  {
@@ -584,7 +588,7 @@
584
588
  "auxiliaryFiles": [
585
589
  "706.js.map"
586
590
  ],
587
- "hash": "7569369529f6dbb4",
591
+ "hash": "16ef31285eabbf1b",
588
592
  "childrenByOrder": {}
589
593
  },
590
594
  {
@@ -619,9 +623,9 @@
619
623
  "initial": false,
620
624
  "entry": false,
621
625
  "recorded": false,
622
- "size": 2996,
626
+ "size": 3236,
623
627
  "sizes": {
624
- "javascript": 2996
628
+ "javascript": 3236
625
629
  },
626
630
  "names": [],
627
631
  "idHints": [],
@@ -633,7 +637,7 @@
633
637
  "757.js"
634
638
  ],
635
639
  "auxiliaryFiles": [],
636
- "hash": "78fe1b3cfb12e8b1",
640
+ "hash": "af6e35644c6d92c3",
637
641
  "childrenByOrder": {}
638
642
  },
639
643
  {
@@ -641,9 +645,9 @@
641
645
  "initial": false,
642
646
  "entry": false,
643
647
  "recorded": false,
644
- "size": 2693,
648
+ "size": 2894,
645
649
  "sizes": {
646
- "javascript": 2693
650
+ "javascript": 2894
647
651
  },
648
652
  "names": [],
649
653
  "idHints": [],
@@ -655,7 +659,7 @@
655
659
  "788.js"
656
660
  ],
657
661
  "auxiliaryFiles": [],
658
- "hash": "aa5d121ccf466adc",
662
+ "hash": "89dd510675bbac2c",
659
663
  "childrenByOrder": {}
660
664
  },
661
665
  {
@@ -690,9 +694,9 @@
690
694
  "initial": false,
691
695
  "entry": false,
692
696
  "recorded": false,
693
- "size": 2693,
697
+ "size": 2894,
694
698
  "sizes": {
695
- "javascript": 2693
699
+ "javascript": 2894
696
700
  },
697
701
  "names": [],
698
702
  "idHints": [],
@@ -704,7 +708,7 @@
704
708
  "807.js"
705
709
  ],
706
710
  "auxiliaryFiles": [],
707
- "hash": "c8051df23a720720",
711
+ "hash": "9339e1ee968c4dda",
708
712
  "childrenByOrder": {}
709
713
  },
710
714
  {
@@ -712,9 +716,9 @@
712
716
  "initial": false,
713
717
  "entry": false,
714
718
  "recorded": false,
715
- "size": 2693,
719
+ "size": 2894,
716
720
  "sizes": {
717
- "javascript": 2693
721
+ "javascript": 2894
718
722
  },
719
723
  "names": [],
720
724
  "idHints": [],
@@ -726,7 +730,7 @@
726
730
  "833.js"
727
731
  ],
728
732
  "auxiliaryFiles": [],
729
- "hash": "53ab09deb6fa51ed",
733
+ "hash": "fdbcecc5ce4c889c",
730
734
  "childrenByOrder": {}
731
735
  },
732
736
  {
@@ -734,9 +738,9 @@
734
738
  "initial": false,
735
739
  "entry": false,
736
740
  "recorded": false,
737
- "size": 44636,
741
+ "size": 47756,
738
742
  "sizes": {
739
- "javascript": 44636
743
+ "javascript": 47756
740
744
  },
741
745
  "names": [],
742
746
  "idHints": [],
@@ -750,32 +754,7 @@
750
754
  "auxiliaryFiles": [
751
755
  "883.js.map"
752
756
  ],
753
- "hash": "39d6d7dda0f5b34c",
754
- "childrenByOrder": {}
755
- },
756
- {
757
- "rendered": true,
758
- "initial": false,
759
- "entry": false,
760
- "recorded": false,
761
- "reason": "split chunk (cache group: default)",
762
- "size": 25833,
763
- "sizes": {
764
- "javascript": 25833
765
- },
766
- "names": [],
767
- "idHints": [],
768
- "runtime": [
769
- "@openmrs/esm-fast-data-entry-app",
770
- "main"
771
- ],
772
- "files": [
773
- "889.js"
774
- ],
775
- "auxiliaryFiles": [
776
- "889.js.map"
777
- ],
778
- "hash": "7b8112e6a500a6e9",
757
+ "hash": "def52f9866894b82",
779
758
  "childrenByOrder": {}
780
759
  },
781
760
  {
@@ -831,6 +810,27 @@
831
810
  ],
832
811
  "hash": "af68757824b57b16",
833
812
  "childrenByOrder": {}
813
+ },
814
+ {
815
+ "rendered": false,
816
+ "initial": false,
817
+ "entry": false,
818
+ "recorded": false,
819
+ "reason": "split chunk (cache group: default)",
820
+ "size": 42,
821
+ "sizes": {
822
+ "consume-shared": 42
823
+ },
824
+ "names": [],
825
+ "idHints": [],
826
+ "runtime": [
827
+ "@openmrs/esm-fast-data-entry-app",
828
+ "main"
829
+ ],
830
+ "files": [],
831
+ "auxiliaryFiles": [],
832
+ "hash": "b2db37983a098c95",
833
+ "childrenByOrder": {}
834
834
  }
835
835
  ]
836
836
  }
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":"^1.2.0","webservices.rest":"^2.2.0"},"pages":[{"component":"root","routeRegex":"forms","online":true,"offline":true}],"extensions":[{"name":"forms-app-link","slot":"app-menu-slot","component":"formsAppMenuLink","online":true,"offline":true}],"version":"1.0.1-pre.127"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":"^1.2.0","webservices.rest":"^2.2.0"},"pages":[{"component":"root","routeRegex":"forms","online":true,"offline":true}],"extensions":[{"name":"forms-app-link","slot":"app-menu-slot","component":"formsAppMenuLink","online":true,"offline":true}],"version":"1.0.1-pre.128"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-fast-data-entry-app",
3
- "version": "1.0.1-pre.127",
3
+ "version": "1.0.1-pre.128",
4
4
  "license": "MPL-2.0",
5
5
  "description": "An OpenMRS 3.x microfrontend",
6
6
  "browser": "dist/openmrs-esm-fast-data-entry-app.js",
@@ -1,6 +1,7 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useContext, useEffect, useState } from "react";
2
2
  import { detach, ExtensionSlot } from "@openmrs/esm-framework";
3
3
  import useGetPatient from "./hooks/useGetPatient";
4
+ import GroupFormWorkflowContext from "./context/GroupFormWorkflowContext";
4
5
 
5
6
  export interface Order {
6
7
  uuid: string;
@@ -98,12 +99,18 @@ export interface Encounter {
98
99
  obs: Array<Observation>;
99
100
  orders: Array<Order>;
100
101
  }
102
+
103
+ type PreFilledQuestions = {
104
+ [key: string]: string;
105
+ };
106
+
101
107
  interface FormParams {
102
108
  formUuid: string;
103
109
  patientUuid: string;
104
110
  visitUuid?: string;
105
111
  visitTypeUuid?: string;
106
112
  encounterUuid?: string;
113
+ preFilledQuestions?: PreFilledQuestions;
107
114
  showDiscardSubmitButtons?: boolean;
108
115
  handlePostResponse?: (Encounter) => void;
109
116
  handleEncounterCreate?: (Object) => void;
@@ -121,6 +128,7 @@ const FormBootstrap = ({
121
128
  handleOnValidate,
122
129
  }: FormParams) => {
123
130
  const patient = useGetPatient(patientUuid);
131
+ const { activeSessionMeta } = useContext(GroupFormWorkflowContext);
124
132
 
125
133
  useEffect(() => {
126
134
  return () => detach("form-widget-slot", "form-widget-slot");
@@ -156,6 +164,7 @@ const FormBootstrap = ({
156
164
  handleEncounterCreate,
157
165
  handleOnValidate,
158
166
  showDiscardSubmitButtons: false,
167
+ preFilledQuestions: { ...activeSessionMeta },
159
168
  }}
160
169
  />
161
170
  )}
@@ -82,6 +82,26 @@ export const configSchema = {
82
82
  _default: "fa8fedc0-c066-4da3-8dc1-2ad8621fc480",
83
83
  },
84
84
  },
85
+ specificQuestions: {
86
+ _type: Type.Array,
87
+ _description: "List of specific questions to populate forms.",
88
+ _elements: {
89
+ forms: {
90
+ _type: Type.Array,
91
+ _description: "List of form UUIDs for which the question applies.",
92
+ _elements: {
93
+ _type: Type.UUID,
94
+ },
95
+ _default: [],
96
+ },
97
+ questionId: {
98
+ _type: Type.String,
99
+ _description: "ID of the question.",
100
+ _default: "",
101
+ },
102
+ },
103
+ _default: [],
104
+ },
85
105
  };
86
106
 
87
107
  export type Form = {
@@ -7,14 +7,26 @@ import {
7
7
  DatePickerInput,
8
8
  } from "@carbon/react";
9
9
  import React, { useContext } from "react";
10
+ import { useConfig } from "@openmrs/esm-framework";
11
+ import { useParams } from "react-router-dom";
10
12
  import styles from "./styles.scss";
11
13
  import { useTranslation } from "react-i18next";
12
14
  import { Controller, useFormContext } from "react-hook-form";
13
15
  import { AttendanceTable } from "./attendance-table";
14
16
  import GroupFormWorkflowContext from "../context/GroupFormWorkflowContext";
15
17
  import useGetPatients from "../hooks/useGetPatients";
18
+ import ConfigurableQuestionsSection from "./configurable-questions/ConfigurableQuestionsSection";
19
+ import useSpecificQuestions from "../hooks/useForm";
20
+
21
+ interface ParamTypes {
22
+ formUuid?: string;
23
+ }
16
24
 
17
25
  const SessionDetailsForm = () => {
26
+ const { specificQuestions } = useConfig();
27
+ const { formUuid } = useParams() as ParamTypes;
28
+ const { questions } = useSpecificQuestions(formUuid, specificQuestions);
29
+
18
30
  const { t } = useTranslation();
19
31
  const {
20
32
  register,
@@ -54,7 +66,7 @@ const SessionDetailsForm = () => {
54
66
  labelText={t("sessionName", "Session Name")}
55
67
  {...register("sessionName", { required: true })}
56
68
  invalid={errors.sessionName}
57
- invalidText={"This field is required"}
69
+ invalidText={t("requiredField", "This field is required")}
58
70
  />
59
71
  <TextInput
60
72
  id="text"
@@ -62,7 +74,7 @@ const SessionDetailsForm = () => {
62
74
  labelText={t("practitionerName", "Practitioner Name")}
63
75
  {...register("practitionerName", { required: true })}
64
76
  invalid={errors.practitionerName}
65
- invalidText={"This field is required"}
77
+ invalidText={t("requiredField", "This field is required")}
66
78
  />
67
79
  <Controller
68
80
  name="sessionDate"
@@ -81,7 +93,10 @@ const SessionDetailsForm = () => {
81
93
  placeholder="mm/dd/yyyy"
82
94
  size="md"
83
95
  invalid={errors.sessionDate}
84
- invalidText={"This field is required"}
96
+ invalidText={t(
97
+ "requiredField",
98
+ "This field is required"
99
+ )}
85
100
  />
86
101
  </DatePicker>
87
102
  )}
@@ -92,7 +107,7 @@ const SessionDetailsForm = () => {
92
107
  labelText={t("sessionNotes", "Session Notes")}
93
108
  {...register("sessionNotes", { required: true })}
94
109
  invalid={errors.sessionNotes}
95
- invalidText={"This field is required"}
110
+ invalidText={t("requiredField", "This field is required")}
96
111
  />
97
112
  </div>
98
113
  </Layer>
@@ -122,6 +137,37 @@ const SessionDetailsForm = () => {
122
137
  </Layer>
123
138
  </Tile>
124
139
  </Layer>
140
+ {questions?.length > 0 ? (
141
+ <>
142
+ <h4>{t("sessionSpecificDetails", "3. Specific details")}</h4>
143
+ <div>
144
+ <p>
145
+ {t(
146
+ "sessionSpecificDetailsDescription",
147
+ "They will be mapped to form responses for all patients as pre-filled data."
148
+ )}
149
+ </p>
150
+ </div>
151
+ <Layer>
152
+ <Tile className={styles.formSectionTile}>
153
+ <Layer>
154
+ <div
155
+ style={{
156
+ display: "flex",
157
+ flexDirection: "column",
158
+ rowGap: "1.5rem",
159
+ }}
160
+ >
161
+ <ConfigurableQuestionsSection
162
+ register={register}
163
+ specificQuestions={questions}
164
+ />
165
+ </div>
166
+ </Layer>
167
+ </Tile>
168
+ </Layer>
169
+ </>
170
+ ) : null}
125
171
  </div>
126
172
  )}
127
173
  </div>