@ampath/esm-patient-registration-app 6.0.1-pre.182 → 6.0.1-pre.186
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/.turbo/turbo-build.log +11 -11
- package/dist/{629.js → 192.js} +2 -2
- package/dist/{629.js.map → 192.js.map} +1 -1
- package/dist/267.js +1 -0
- package/dist/267.js.map +1 -0
- package/dist/56.js +1 -1
- package/dist/56.js.map +1 -1
- package/dist/831.js +1 -1
- package/dist/831.js.map +1 -1
- package/dist/913.js +1 -1
- package/dist/913.js.LICENSE.txt +3 -3
- package/dist/913.js.map +1 -1
- package/dist/ampath-esm-patient-registration-app.js +1 -1
- package/dist/ampath-esm-patient-registration-app.js.buildmanifest.json +66 -66
- package/dist/ampath-esm-patient-registration-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/patient-registration/field/dob/dob.component.tsx +37 -44
- package/dist/621.js +0 -1
- package/dist/621.js.map +0 -1
- /package/dist/{629.js.LICENSE.txt → 192.js.LICENSE.txt} +0 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"patient-registration","online":true,"offline":true},{"component":"editPatient","routeRegex":"patient\\/([a-zA-Z0-9\\-]+)\\/edit","online":true,"offline":true}],"extensions":[{"component":"addPatientLink","name":"add-patient-action","slot":"top-nav-actions-slot","online":true,"offline":true},{"component":"cancelPatientEditModal","name":"cancel-patient-edit-modal","online":true,"offline":true},{"component":"patientPhotoExtension","name":"patient-photo-widget","slot":"patient-photo-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-actions-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-search-actions-slot","online":true,"offline":true},{"component":"deleteIdentifierConfirmationModal","name":"delete-identifier-confirmation-modal","online":true,"offline":true},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal","online":true,"offline":true},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal","online":true,"offline":true}],"version":"6.0.1-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"patient-registration","online":true,"offline":true},{"component":"editPatient","routeRegex":"patient\\/([a-zA-Z0-9\\-]+)\\/edit","online":true,"offline":true}],"extensions":[{"component":"addPatientLink","name":"add-patient-action","slot":"top-nav-actions-slot","online":true,"offline":true},{"component":"cancelPatientEditModal","name":"cancel-patient-edit-modal","online":true,"offline":true},{"component":"patientPhotoExtension","name":"patient-photo-widget","slot":"patient-photo-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-actions-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-search-actions-slot","online":true,"offline":true},{"component":"deleteIdentifierConfirmationModal","name":"delete-identifier-confirmation-modal","online":true,"offline":true},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal","online":true,"offline":true},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal","online":true,"offline":true}],"version":"6.0.1-pre.186"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampath/esm-patient-registration-app",
|
|
3
|
-
"version": "6.0.1-pre.
|
|
3
|
+
"version": "6.0.1-pre.186",
|
|
4
4
|
"description": "Patient registration microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/ampath-esm-patient-registration-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { type ChangeEvent, useCallback, useContext } from 'react';
|
|
2
|
-
import { ContentSwitcher,
|
|
2
|
+
import { ContentSwitcher, Layer, Switch, TextInput } from '@carbon/react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useField } from 'formik';
|
|
5
|
-
import {
|
|
5
|
+
import { type CalendarDate, getLocalTimeZone } from '@internationalized/date';
|
|
6
6
|
import { PatientRegistrationContext } from '../../patient-registration-context';
|
|
7
7
|
import { OpenmrsDatePicker, useConfig } from '@openmrs/esm-framework';
|
|
8
8
|
import { type RegistrationConfig } from '../../../config-schema';
|
|
@@ -32,7 +32,6 @@ export const DobField: React.FC = () => {
|
|
|
32
32
|
const [yearsEstimated, yearsEstimateMeta] = useField('yearsEstimated');
|
|
33
33
|
const [monthsEstimated, monthsEstimateMeta] = useField('monthsEstimated');
|
|
34
34
|
const { setFieldValue } = useContext(PatientRegistrationContext);
|
|
35
|
-
const { format, placeHolder, dateFormat } = generateFormatting(['d', 'm', 'Y'], '/');
|
|
36
35
|
const today = new Date();
|
|
37
36
|
|
|
38
37
|
const onToggle = useCallback(
|
|
@@ -46,8 +45,8 @@ export const DobField: React.FC = () => {
|
|
|
46
45
|
);
|
|
47
46
|
|
|
48
47
|
const onDateChange = useCallback(
|
|
49
|
-
(birthdate:
|
|
50
|
-
setFieldValue('birthdate', birthdate);
|
|
48
|
+
(birthdate: CalendarDate) => {
|
|
49
|
+
setFieldValue('birthdate', birthdate?.toDate(getLocalTimeZone()));
|
|
51
50
|
},
|
|
52
51
|
[setFieldValue],
|
|
53
52
|
);
|
|
@@ -104,55 +103,49 @@ export const DobField: React.FC = () => {
|
|
|
104
103
|
<OpenmrsDatePicker
|
|
105
104
|
id="birthdate"
|
|
106
105
|
{...birthdate}
|
|
107
|
-
dateFormat={dateFormat}
|
|
108
106
|
onChange={onDateChange}
|
|
109
|
-
|
|
107
|
+
maxDate={today}
|
|
110
108
|
labelText={t('dateOfBirthLabelText', 'Date of Birth')}
|
|
111
|
-
|
|
112
|
-
invalidText={birthdateMeta.error && t(birthdateMeta.error)}
|
|
109
|
+
isInvalid={!!(birthdateMeta.touched && birthdateMeta.error)}
|
|
113
110
|
value={birthdate.value}
|
|
114
|
-
carbonOptions={{
|
|
115
|
-
placeholder: placeHolder,
|
|
116
|
-
}}
|
|
117
111
|
/>
|
|
112
|
+
{!!(birthdateMeta.touched && birthdateMeta.error) && (
|
|
113
|
+
<div className={styles.radioFieldError}>{birthdateMeta.error && t(birthdateMeta.error)}</div>
|
|
114
|
+
)}
|
|
118
115
|
</div>
|
|
119
116
|
) : (
|
|
120
117
|
<div className={styles.grid}>
|
|
121
118
|
<div className={styles.dobField}>
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/>
|
|
137
|
-
</Layer>
|
|
119
|
+
<TextInput
|
|
120
|
+
id="yearsEstimated"
|
|
121
|
+
type="number"
|
|
122
|
+
name={yearsEstimated.name}
|
|
123
|
+
onChange={onEstimatedYearsChange}
|
|
124
|
+
labelText={t('estimatedAgeInYearsLabelText', 'Estimated age in years')}
|
|
125
|
+
invalid={!!(yearsEstimateMeta.touched && yearsEstimateMeta.error)}
|
|
126
|
+
invalidText={yearsEstimateMeta.error && t(yearsEstimateMeta.error)}
|
|
127
|
+
value={yearsEstimated.value}
|
|
128
|
+
min={0}
|
|
129
|
+
required
|
|
130
|
+
{...yearsEstimated}
|
|
131
|
+
onBlur={updateBirthdate}
|
|
132
|
+
/>
|
|
138
133
|
</div>
|
|
139
134
|
<div className={styles.dobField}>
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/>
|
|
155
|
-
</Layer>
|
|
135
|
+
<TextInput
|
|
136
|
+
id="monthsEstimated"
|
|
137
|
+
type="number"
|
|
138
|
+
name={monthsEstimated.name}
|
|
139
|
+
onChange={onEstimatedMonthsChange}
|
|
140
|
+
labelText={t('estimatedAgeInMonthsLabelText', 'Estimated age in months')}
|
|
141
|
+
invalid={!!(monthsEstimateMeta.touched && monthsEstimateMeta.error)}
|
|
142
|
+
invalidText={monthsEstimateMeta.error && t(monthsEstimateMeta.error)}
|
|
143
|
+
value={monthsEstimated.value}
|
|
144
|
+
min={0}
|
|
145
|
+
{...monthsEstimated}
|
|
146
|
+
required={!yearsEstimateMeta.value}
|
|
147
|
+
onBlur={updateBirthdate}
|
|
148
|
+
/>
|
|
156
149
|
</div>
|
|
157
150
|
</div>
|
|
158
151
|
)}
|