@openmrs/esm-form-engine-lib 2.1.0-pre.1577 → 2.1.0-pre.1581
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/obs-adapter.ts +1 -1
- package/src/components/renderer/field/fieldLogic.ts +3 -0
- package/src/components/renderer/field/form-field-renderer.component.tsx +0 -2
- package/src/processors/encounter/encounter-form-processor.ts +1 -1
- package/63ee6b397e426495/63ee6b397e426495.gz +0 -0
- package/96c41d63e46e82a5/96c41d63e46e82a5.gz +0 -0
- package/b5c5a7c4dc0a8acf/b5c5a7c4dc0a8acf.gz +0 -0
- package/d7b6803241c9380f/d7b6803241c9380f.gz +0 -0
package/package.json
CHANGED
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
type AttachmentResponse,
|
8
8
|
type Attachment,
|
9
9
|
type ValueAndDisplay,
|
10
|
+
type FormFieldValueAdapter,
|
10
11
|
} from '../types';
|
11
12
|
import {
|
12
13
|
hasRendering,
|
@@ -17,7 +18,6 @@ import {
|
|
17
18
|
formatDateAsDisplayString,
|
18
19
|
} from '../utils/common-utils';
|
19
20
|
import { type FormContextProps } from '../provider/form-provider';
|
20
|
-
import { type FormFieldValueAdapter } from '../types';
|
21
21
|
import { isEmpty } from '../validators/form-validator';
|
22
22
|
import { getAttachmentByUuid } from '../api';
|
23
23
|
import { formatDate, restBaseUrl } from '@openmrs/esm-framework';
|
@@ -6,6 +6,7 @@ import { hasRendering } from '../../../utils/common-utils';
|
|
6
6
|
import { evaluateAsyncExpression, evaluateExpression } from '../../../utils/expression-runner';
|
7
7
|
import { evalConditionalRequired, evaluateDisabled, evaluateHide } from '../../../utils/form-helper';
|
8
8
|
import { isEmpty } from '../../../validators/form-validator';
|
9
|
+
import { reportError } from '../../../utils/error-utils';
|
9
10
|
|
10
11
|
export function handleFieldLogic(field: FormField, context: FormContextProps) {
|
11
12
|
const {
|
@@ -80,6 +81,8 @@ function evaluateFieldDependents(field: FormField, values: any, context: FormCon
|
|
80
81
|
context.formFieldAdapters[dependent.type].transformFieldValue(dependent, result, context);
|
81
82
|
}
|
82
83
|
updateFormField(dependent);
|
84
|
+
}).catch((error) => {
|
85
|
+
reportError(error, 'Error evaluating calculate expression');
|
83
86
|
});
|
84
87
|
}
|
85
88
|
// evaluate hide
|
@@ -2,10 +2,8 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import {
|
3
3
|
type FormField,
|
4
4
|
type FormFieldInputProps,
|
5
|
-
type FormFieldValidator,
|
6
5
|
type FormFieldValueAdapter,
|
7
6
|
type RenderType,
|
8
|
-
type SessionMode,
|
9
7
|
type ValidationResult,
|
10
8
|
type ValueAndDisplay,
|
11
9
|
} from '../../../types';
|
@@ -318,7 +318,7 @@ export class EncounterFormProcessor extends FormProcessor {
|
|
318
318
|
patient: patient,
|
319
319
|
previousEncounter: previousDomainObjectValue,
|
320
320
|
});
|
321
|
-
return extractObsValueAndDisplay(field, value);
|
321
|
+
return value ? extractObsValueAndDisplay(field, value) : null;
|
322
322
|
}
|
323
323
|
if (previousDomainObjectValue && field.questionOptions.enablePreviousValue) {
|
324
324
|
return await adapter.getPreviousValue(field, previousDomainObjectValue, context);
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|