@openmrs/esm-form-engine-lib 2.1.0-pre.1510 → 2.1.0-pre.1513
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.
- package/__mocks__/forms/rfe-forms/bmi-test-form.json +66 -66
- package/__mocks__/forms/rfe-forms/bsa-test-form.json +66 -66
- package/__mocks__/forms/rfe-forms/edd-test-form.json +87 -87
- package/__mocks__/forms/rfe-forms/external_data_source_form.json +35 -36
- package/__mocks__/forms/rfe-forms/historical-expressions-form.json +1 -1
- package/__mocks__/forms/rfe-forms/labour_and_delivery_test_form.json +1 -1
- package/__mocks__/forms/rfe-forms/months-on-art-form.json +89 -89
- package/__mocks__/forms/rfe-forms/next-visit-test-form.json +77 -77
- package/dist/openmrs-esm-form-engine-lib.js +1 -1
- package/package.json +1 -1
- package/src/components/inputs/multi-select/multi-select.component.tsx +3 -3
- package/src/components/inputs/number/number.component.tsx +2 -1
- package/src/components/inputs/ui-select-extended/ui-select-extended.component.tsx +1 -1
- package/src/components/inputs/ui-select-extended/ui-select-extended.test.tsx +5 -0
- package/src/processors/encounter/encounter-form-processor.ts +2 -7
- package/src/utils/common-expression-helpers.test.ts +74 -5
- package/src/utils/common-expression-helpers.ts +21 -26
- package/src/utils/expression-runner.test.ts +156 -69
- package/src/utils/expression-runner.ts +85 -135
- package/src/utils/expression-parser.test.ts +0 -308
- package/src/utils/expression-parser.ts +0 -158
@@ -1,69 +1,69 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
2
|
+
"name": "Test HTS POC",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "Screening",
|
6
|
+
"sections": [
|
4
7
|
{
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
"id": "bmi"
|
58
|
-
}
|
59
|
-
]
|
60
|
-
}
|
61
|
-
]
|
8
|
+
"label": "Testing history",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "Height",
|
13
|
+
"type": "obs",
|
14
|
+
"questionOptions": {
|
15
|
+
"rendering": "number",
|
16
|
+
"concept": "164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
17
|
+
},
|
18
|
+
"required": "true",
|
19
|
+
"unspecified": "true",
|
20
|
+
"hide": {
|
21
|
+
"hideWhenExpression": "false"
|
22
|
+
},
|
23
|
+
"validators": [],
|
24
|
+
"id": "height"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"label": "Weight",
|
28
|
+
"type": "obs",
|
29
|
+
"questionOptions": {
|
30
|
+
"rendering": "number",
|
31
|
+
"concept": "184400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
32
|
+
},
|
33
|
+
"required": "true",
|
34
|
+
"unspecified": "true",
|
35
|
+
"hide": {
|
36
|
+
"hideWhenExpression": "false"
|
37
|
+
},
|
38
|
+
"validators": [],
|
39
|
+
"id": "weight"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"label": "BMI",
|
43
|
+
"type": "obs",
|
44
|
+
"questionOptions": {
|
45
|
+
"rendering": "text",
|
46
|
+
"calculate": {
|
47
|
+
"calculateExpression": "calcBMI(height, weight)"
|
48
|
+
},
|
49
|
+
"concept": "164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
50
|
+
},
|
51
|
+
"required": "true",
|
52
|
+
"unspecified": "true",
|
53
|
+
"hide": {
|
54
|
+
"hideWhenExpression": "false"
|
55
|
+
},
|
56
|
+
"validators": [],
|
57
|
+
"id": "bmi"
|
58
|
+
}
|
59
|
+
]
|
62
60
|
}
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
61
|
+
]
|
62
|
+
}
|
63
|
+
],
|
64
|
+
"availableIntents": [],
|
65
|
+
"processor": "EncounterFormProcessor",
|
66
|
+
"uuid": "da24c540-cc83-43bc-978f-c1ef180a497f",
|
67
|
+
"referencedForms": [],
|
68
|
+
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe"
|
69
|
+
}
|
@@ -1,69 +1,69 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
2
|
+
"name": "Test HTS POC",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "Screening",
|
6
|
+
"sections": [
|
4
7
|
{
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
"id": "bsa"
|
58
|
-
}
|
59
|
-
]
|
60
|
-
}
|
61
|
-
]
|
8
|
+
"label": "Testing history",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "Height",
|
13
|
+
"type": "obs",
|
14
|
+
"questionOptions": {
|
15
|
+
"rendering": "number",
|
16
|
+
"concept": "164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
17
|
+
},
|
18
|
+
"required": "true",
|
19
|
+
"unspecified": "true",
|
20
|
+
"hide": {
|
21
|
+
"hideWhenExpression": "false"
|
22
|
+
},
|
23
|
+
"validators": [],
|
24
|
+
"id": "height"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"label": "Weight",
|
28
|
+
"type": "obs",
|
29
|
+
"questionOptions": {
|
30
|
+
"rendering": "number",
|
31
|
+
"concept": "184400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
32
|
+
},
|
33
|
+
"required": "true",
|
34
|
+
"unspecified": "true",
|
35
|
+
"hide": {
|
36
|
+
"hideWhenExpression": "false"
|
37
|
+
},
|
38
|
+
"validators": [],
|
39
|
+
"id": "weight"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"label": "BSA",
|
43
|
+
"type": "obs",
|
44
|
+
"questionOptions": {
|
45
|
+
"rendering": "text",
|
46
|
+
"calculate": {
|
47
|
+
"calculateExpression": "calcBSA(height, weight)"
|
48
|
+
},
|
49
|
+
"concept": "164400AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
50
|
+
},
|
51
|
+
"required": "true",
|
52
|
+
"unspecified": "true",
|
53
|
+
"hide": {
|
54
|
+
"hideWhenExpression": "false"
|
55
|
+
},
|
56
|
+
"validators": [],
|
57
|
+
"id": "bsa"
|
58
|
+
}
|
59
|
+
]
|
62
60
|
}
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
61
|
+
]
|
62
|
+
}
|
63
|
+
],
|
64
|
+
"availableIntents": [],
|
65
|
+
"processor": "EncounterFormProcessor",
|
66
|
+
"uuid": "da24c540-cc83-43bc-978f-c1ef180a497f",
|
67
|
+
"referencedForms": [],
|
68
|
+
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe"
|
69
|
+
}
|
@@ -1,88 +1,88 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
2
|
+
"name": "",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "POC Test EDD",
|
6
|
+
"sections": [
|
7
|
+
{
|
8
|
+
"label": "Test EDD",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "LMP",
|
13
|
+
"type": "obs",
|
14
|
+
"questionOptions": {
|
15
|
+
"rendering": "date",
|
16
|
+
"concept": "166079AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
17
|
+
"weeksList": "",
|
18
|
+
"conceptMappings": [
|
19
|
+
{
|
20
|
+
"type": "CIEL",
|
21
|
+
"value": "166079"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"type": "SNOMED-CT",
|
25
|
+
"value": "248993009"
|
26
|
+
}
|
27
|
+
]
|
28
|
+
},
|
29
|
+
"required": "true",
|
30
|
+
"unspecified": "true",
|
31
|
+
"hide": {
|
32
|
+
"hideWhenExpression": "false"
|
33
|
+
},
|
34
|
+
"validators": [],
|
35
|
+
"id": "LMP"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"label": "EDD",
|
39
|
+
"type": "obs",
|
40
|
+
"questionOptions": {
|
41
|
+
"rendering": "date",
|
42
|
+
"calculate": {
|
43
|
+
"calculateExpression": "calcEDD(LMP)"
|
44
|
+
},
|
45
|
+
"concept": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
46
|
+
"weeksList": "",
|
47
|
+
"conceptMappings": [
|
48
|
+
{
|
49
|
+
"type": "AMPATH",
|
50
|
+
"value": "1854"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"type": "SNOMED-CT",
|
54
|
+
"value": "366322004"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"type": "AMPATH",
|
58
|
+
"value": "5596"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"type": "CIEL",
|
62
|
+
"value": "5596"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"type": "LOINC",
|
66
|
+
"value": "11779-6"
|
67
|
+
}
|
68
|
+
]
|
69
|
+
},
|
70
|
+
"required": "true",
|
71
|
+
"unspecified": "true",
|
72
|
+
"hide": {
|
73
|
+
"hideWhenExpression": "false"
|
74
|
+
},
|
75
|
+
"validators": [],
|
76
|
+
"id": "EDD"
|
77
|
+
}
|
78
|
+
]
|
79
|
+
}
|
80
|
+
]
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"availableIntents": [],
|
84
|
+
"processor": "EncounterFormProcessor",
|
85
|
+
"uuid": "da24c540-cc83-43bc-978f-c1ef180a497f",
|
86
|
+
"referencedForms": [],
|
87
|
+
"encounterType": "79c1f50f-f77d-42e2-ad2a-d29304dde2fe"
|
88
|
+
}
|
@@ -1,40 +1,39 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
],
|
2
|
+
"name": "",
|
3
|
+
"pages": [
|
4
|
+
{
|
5
|
+
"label": "Page 1",
|
6
|
+
"sections": [
|
7
|
+
{
|
8
|
+
"label": "Section 1",
|
9
|
+
"isExpanded": "true",
|
10
|
+
"questions": [
|
11
|
+
{
|
12
|
+
"label": "Body Weight",
|
13
|
+
"type": "obs",
|
14
|
+
"questionOptions": {
|
15
|
+
"rendering": "number",
|
16
|
+
"concept": "560555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
17
|
+
"calculate": {
|
18
|
+
"calculateExpression": "api.getLatestObs('50512033-e047-4855-b2d3-1a6d9e889ff4', '560555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA').then(obs => obs.valueNumeric)"
|
19
|
+
},
|
20
|
+
"conceptMappings": [
|
21
|
+
{
|
22
|
+
"type": "CIEL",
|
23
|
+
"value": "160555"
|
24
|
+
}
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"id": "bodyWeight",
|
28
|
+
"validators": [],
|
29
|
+
"required": "true",
|
30
|
+
"unspecified": "true"
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
],
|
38
37
|
"availableIntents": [],
|
39
38
|
"processor": "EncounterFormProcessor",
|
40
39
|
"uuid": "na24c540-cc83-43bc-978f-c1ef180a597f",
|
@@ -14,7 +14,7 @@
|
|
14
14
|
{
|
15
15
|
"label": "Reasons for assessment",
|
16
16
|
"type": "obs",
|
17
|
-
"historicalExpression": "HD.getObject('prevEnc')
|
17
|
+
"historicalExpression": "HD.getObject('prevEnc')?.getValue('ae46f4b1-c15d-4bba-ab41-b9157b82b0ce')",
|
18
18
|
"questionOptions": {
|
19
19
|
"rendering": "checkbox",
|
20
20
|
"concept": "ae46f4b1-c15d-4bba-ab41-b9157b82b0ce",
|
@@ -121,7 +121,7 @@
|
|
121
121
|
},
|
122
122
|
{
|
123
123
|
"type": "js_expression",
|
124
|
-
"failsWhenExpression": "!isDateEqualTo(myValue, useFieldValue(
|
124
|
+
"failsWhenExpression": "!isDateEqualTo(myValue, useFieldValue(visit_date))",
|
125
125
|
"message": "Child birth date should be the same as the visit date!"
|
126
126
|
}
|
127
127
|
]
|