@openmrs/esm-form-engine-lib 2.1.0-pre.1376 → 2.1.0-pre.1384
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/package.json +1 -1
- package/src/adapters/program-state-adapter.ts +1 -1
- package/src/processors/encounter/encounter-form-processor.ts +6 -1
- package/src/provider/form-factory-helper.ts +1 -0
- package/30f47e174c423ed1/30f47e174c423ed1.gz +0 -0
- package/6afbf667c2a790fc/6afbf667c2a790fc.gz +0 -0
- package/b7a6701f63a3c084/b7a6701f63a3c084.gz +0 -0
- package/db39c60881061b3d/db39c60881061b3d.gz +0 -0
package/package.json
CHANGED
@@ -29,7 +29,7 @@ export const ProgramStateAdapter: FormFieldValueAdapter = {
|
|
29
29
|
.filter((state) => !state.endDate)
|
30
30
|
.find((state) => state.state.programWorkflow?.uuid === field.questionOptions.workflowUuid)?.state;
|
31
31
|
field.meta = { ...(field.meta || {}), previousValue: currentState };
|
32
|
-
return currentState
|
32
|
+
return currentState?.uuid;
|
33
33
|
}
|
34
34
|
return null;
|
35
35
|
},
|
@@ -77,6 +77,7 @@ const contextInitializableTypes = [
|
|
77
77
|
'encounterLocation',
|
78
78
|
'patientIdentifier',
|
79
79
|
'encounterRole',
|
80
|
+
'programState'
|
80
81
|
];
|
81
82
|
export class EncounterFormProcessor extends FormProcessor {
|
82
83
|
prepareFormSchema(schema: FormSchema) {
|
@@ -257,7 +258,11 @@ export class EncounterFormProcessor extends FormProcessor {
|
|
257
258
|
const adapter = formFieldAdapters[field.type];
|
258
259
|
initialValues[field.id] = emptyValues[field.questionOptions.rendering] ?? null;
|
259
260
|
if (field.questionOptions.calculate?.calculateExpression) {
|
260
|
-
|
261
|
+
try {
|
262
|
+
await evaluateCalculateExpression(field, initialValues, context);
|
263
|
+
} catch (error) {
|
264
|
+
console.error(error);
|
265
|
+
}
|
261
266
|
}
|
262
267
|
if (isEmpty(initialValues[field.id]) && contextInitializableTypes.includes(field.type)) {
|
263
268
|
try {
|
@@ -17,6 +17,7 @@ export function validateForm(context: FormContextProps) {
|
|
17
17
|
} = context;
|
18
18
|
const values = getValues();
|
19
19
|
const errors = formFields
|
20
|
+
.filter((field) => !field.isHidden && !field.isDisabled)
|
20
21
|
.flatMap((field) =>
|
21
22
|
field.validators?.flatMap((validatorConfig) => {
|
22
23
|
const validator = formFieldValidators[validatorConfig.type];
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|