@openmrs/esm-patient-registration-app 8.5.1-pre.6282 → 8.5.1-pre.6289

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.
@@ -521,9 +521,9 @@
521
521
  "initial": false,
522
522
  "entry": false,
523
523
  "recorded": false,
524
- "size": 145819,
524
+ "size": 145744,
525
525
  "sizes": {
526
- "javascript": 145819
526
+ "javascript": 145744
527
527
  },
528
528
  "names": [],
529
529
  "idHints": [],
@@ -536,7 +536,7 @@
536
536
  "auxiliaryFiles": [
537
537
  "3474.js.map"
538
538
  ],
539
- "hash": "9ae0e5005593a284",
539
+ "hash": "1ad8b2da2a5465cd",
540
540
  "childrenByOrder": {}
541
541
  },
542
542
  {
@@ -1365,10 +1365,10 @@
1365
1365
  "initial": true,
1366
1366
  "entry": true,
1367
1367
  "recorded": false,
1368
- "size": 2370328,
1368
+ "size": 2370253,
1369
1369
  "sizes": {
1370
1370
  "consume-shared": 168,
1371
- "javascript": 2347750,
1371
+ "javascript": 2347675,
1372
1372
  "share-init": 336,
1373
1373
  "runtime": 22074
1374
1374
  },
@@ -1385,7 +1385,7 @@
1385
1385
  "auxiliaryFiles": [
1386
1386
  "main.js.map"
1387
1387
  ],
1388
- "hash": "8d83ee270f21fef0",
1388
+ "hash": "f78fd60f1e8e8143",
1389
1389
  "childrenByOrder": {}
1390
1390
  },
1391
1391
  {
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,"order":30},{"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}],"modals":[{"name":"cancel-patient-edit-modal","component":"cancelPatientEditModal"},{"name":"delete-identifier-confirmation-modal","component":"deleteIdentifierConfirmationModal"}],"version":"8.5.1-pre.6282"}
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,"order":30},{"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}],"modals":[{"name":"cancel-patient-edit-modal","component":"cancelPatientEditModal"},{"name":"delete-identifier-confirmation-modal","component":"deleteIdentifierConfirmationModal"}],"version":"8.5.1-pre.6289"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-patient-registration-app",
3
- "version": "8.5.1-pre.6282",
3
+ "version": "8.5.1-pre.6289",
4
4
  "description": "Patient registration microfrontend for O3",
5
5
  "browser": "dist/openmrs-esm-patient-registration-app.js",
6
6
  "main": "src/index.ts",
@@ -124,6 +124,7 @@ export const esmPatientRegistrationSchema = {
124
124
  },
125
125
  sectionDefinitions: {
126
126
  _type: Type.Array,
127
+ _default: [],
127
128
  _elements: {
128
129
  id: {
129
130
  _type: Type.String,
@@ -141,13 +142,17 @@ export const esmPatientRegistrationSchema = {
141
142
  _description: `The parts to include in the section. Can be any of the following built-in fields: ${builtInFields.join(
142
143
  ', ',
143
144
  )}. Can also be an id from an object in the \`fieldDefinitions\` array, which you can use to define custom fields.`,
144
- _elements: { _type: Type.String },
145
+ _elements: {
146
+ _type: Type.String,
147
+ },
145
148
  },
146
149
  },
147
- _default: [],
148
150
  },
149
151
  fieldDefinitions: {
150
152
  _type: Type.Array,
153
+ _default: [],
154
+ _description:
155
+ 'Definitions for custom fields that can be used in sectionDefinitions. Can also be used to override built-in fields.',
151
156
  _elements: {
152
157
  id: {
153
158
  _type: Type.String,
@@ -165,12 +170,12 @@ export const esmPatientRegistrationSchema = {
165
170
  },
166
171
  showHeading: {
167
172
  _type: Type.Boolean,
168
- _description: 'Whether to show a heading above the person attribute field.',
169
173
  _default: false,
174
+ _description: 'Whether to show a heading above the person attribute field.',
170
175
  },
171
176
  label: {
172
177
  _type: Type.String,
173
- _default: null,
178
+ _default: '',
174
179
  _description: 'The label of the input. By default, uses the metadata `display` attribute.',
175
180
  },
176
181
  placeholder: {
@@ -189,27 +194,33 @@ export const esmPatientRegistrationSchema = {
189
194
  _description: 'Indicates whether the date input field should allow the selection of past dates or not.',
190
195
  },
191
196
  validation: {
192
- required: { _type: Type.Boolean, _default: false },
197
+ required: {
198
+ _type: Type.Boolean,
199
+ _default: false,
200
+ },
193
201
  matches: {
194
202
  _type: Type.String,
195
- _default: null,
203
+ _default: '',
196
204
  _description: 'Optional RegEx for testing the validity of the input.',
197
205
  },
198
206
  },
199
207
  locationTag: {
200
208
  _type: Type.String,
201
- _default: null,
209
+ _default: '',
202
210
  _description:
203
211
  'Only for fields with "person attribute" type `org.openmrs.Location`. This filters the list of location options in the dropdown based on their location tag. By default, all locations are shown.',
204
212
  },
205
213
  answerConceptSetUuid: {
206
214
  _type: Type.ConceptUuid,
207
- _default: null,
215
+ _default: '',
208
216
  _description:
209
217
  'For coded questions only. A concept which has the possible responses either as answers or as set members.',
210
218
  },
211
219
  customConceptAnswers: {
212
220
  _type: Type.Array,
221
+ _default: [],
222
+ _description:
223
+ 'For coded questions only (obs or person attrbute). A list of custom concept answers. Overrides answers that come from the obs concept or from `answerSetConceptUuid`.',
213
224
  _elements: {
214
225
  uuid: {
215
226
  _type: Type.UUID,
@@ -217,31 +228,31 @@ export const esmPatientRegistrationSchema = {
217
228
  },
218
229
  label: {
219
230
  _type: Type.String,
220
- _default: null,
231
+ _default: '',
221
232
  _description: 'The custom label for the answer concept.',
222
233
  },
223
234
  },
224
- _default: [],
225
- _description:
226
- 'For coded questions only (obs or person attrbute). A list of custom concept answers. Overrides answers that come from the obs concept or from `answerSetConceptUuid`.',
227
235
  },
228
236
  },
229
237
  // Do not add fields here. If you want to add a field in code, add it to built-in fields above.
230
- _default: [],
231
- _description:
232
- 'Definitions for custom fields that can be used in sectionDefinitions. Can also be used to override built-in fields.',
233
238
  },
234
239
  fieldConfigurations: {
235
240
  causeOfDeath: {
236
241
  conceptUuid: {
237
242
  _type: Type.ConceptUuid,
238
- _description: 'The concept UUID to get cause of death answers',
239
243
  _default: '9272a14b-7260-4353-9e5b-5787b5dead9d',
244
+ _description: 'The concept UUID to get cause of death answers',
245
+ },
246
+ required: {
247
+ _type: Type.Boolean,
248
+ _default: false,
240
249
  },
241
- required: { _type: Type.Boolean, _default: false },
242
250
  },
243
251
  name: {
244
- displayMiddleName: { _type: Type.Boolean, _default: true },
252
+ displayMiddleName: {
253
+ _type: Type.Boolean,
254
+ _default: true,
255
+ },
245
256
  allowUnidentifiedPatients: {
246
257
  _type: Type.Boolean,
247
258
  _default: true,
@@ -270,20 +281,6 @@ export const esmPatientRegistrationSchema = {
270
281
  },
271
282
  gender: {
272
283
  _type: Type.Array,
273
- _elements: {
274
- value: {
275
- _type: Type.String,
276
- _description:
277
- 'Value that will be sent to the server. Limited to FHIR-supported values for Administrative Gender',
278
- _validators: [validators.oneOf(['male', 'female', 'other', 'unknown'])],
279
- },
280
- label: {
281
- _type: Type.String,
282
- _default: null,
283
- _description:
284
- 'The label displayed for the sex option, if it should be different from the value (the value will be translated; the English "translation" is upper-case).',
285
- },
286
- },
287
284
  _default: [
288
285
  {
289
286
  value: 'male',
@@ -300,54 +297,66 @@ export const esmPatientRegistrationSchema = {
300
297
  ],
301
298
  _description:
302
299
  'The options for sex selection during patient registration. This is Administrative Gender as it is called by FHIR (Possible options are limited to those defined in FHIR Administrative Gender, see https://hl7.org/fhir/R4/valueset-administrative-gender.html).',
300
+ _elements: {
301
+ value: {
302
+ _type: Type.String,
303
+ _description:
304
+ 'Value that will be sent to the server. Limited to FHIR-supported values for Administrative Gender',
305
+ _validators: [validators.oneOf(['male', 'female', 'other', 'unknown'])],
306
+ },
307
+ label: {
308
+ _type: Type.String,
309
+ _default: '',
310
+ _description:
311
+ 'The label displayed for the sex option, if it should be different from the value (the value will be translated; the English "translation" is upper-case).',
312
+ },
313
+ },
303
314
  },
304
315
  address: {
305
316
  useAddressHierarchy: {
306
317
  enabled: {
307
318
  _type: Type.Boolean,
308
- _description: 'Whether to use the Address hierarchy in the registration form or not',
309
319
  _default: true,
320
+ _description: 'Whether to use the Address hierarchy in the registration form or not',
310
321
  },
311
322
  useQuickSearch: {
312
323
  _type: Type.Boolean,
324
+ _default: true,
313
325
  _description:
314
326
  'Whether to use the quick searching through the address saved in the database pre-fill the form.',
315
- _default: true,
316
327
  },
317
328
  searchAddressByLevel: {
318
329
  _type: Type.Boolean,
330
+ _default: false,
319
331
  _description:
320
332
  "Whether to fill the addresses by levels, i.e. County => subCounty, the current field is dependent on it's previous field.",
321
- _default: false,
322
- },
323
- useAddressHierarchyLabel: {
324
- _type: Type.Object,
325
- _description: 'Whether to use custom labels for address hierarchy',
326
- _default: {},
327
333
  },
328
334
  },
329
335
  },
330
336
  dateOfBirth: {
331
337
  allowEstimatedDateOfBirth: {
332
338
  _type: Type.Boolean,
333
- _description: 'Whether to allow estimated date of birth for a patient during registration',
334
339
  _default: true,
340
+ _description: 'Whether to allow estimated date of birth for a patient during registration',
335
341
  },
336
342
  useEstimatedDateOfBirth: {
337
343
  enabled: {
338
344
  _type: Type.Boolean,
339
- _description: 'Whether to use a fixed day and month for estimated date of birth',
340
345
  _default: false,
346
+ _description: 'Whether to use a fixed day and month for estimated date of birth',
341
347
  },
342
348
  dayOfMonth: {
343
349
  _type: Type.Number,
344
- _description: 'The custom day of the month use on the estimated date of birth',
345
350
  _default: 0,
351
+ _description:
352
+ 'The custom day of the month use on the estimated date of birth (0 = last day of previous month, 1-31 = specific day)',
353
+ _validators: [validators.inRange(0, 31)],
346
354
  },
347
355
  month: {
348
356
  _type: Type.Number,
349
- _description: 'The custom month to use on the estimated date of birth i.e 0 = Jan & 11 = Dec',
350
357
  _default: 0,
358
+ _description: 'The custom month to use on the estimated date of birth i.e 0 = Jan & 11 = Dec',
359
+ _validators: [validators.inRange(0, 11)],
351
360
  },
352
361
  },
353
362
  },
@@ -358,10 +367,13 @@ export const esmPatientRegistrationSchema = {
358
367
  _description: 'The UUID of the phone number person attribute type',
359
368
  },
360
369
  validation: {
361
- required: { _type: Type.Boolean, _default: false },
370
+ required: {
371
+ _type: Type.Boolean,
372
+ _default: false,
373
+ },
362
374
  matches: {
363
375
  _type: Type.String,
364
- _default: null,
376
+ _default: '',
365
377
  _description: 'Optional RegEx for testing the validity of the input.',
366
378
  },
367
379
  },
@@ -376,15 +388,15 @@ export const esmPatientRegistrationSchema = {
376
388
  },
377
389
  defaultPatientIdentifierTypes: {
378
390
  _type: Type.Array,
391
+ _default: [],
379
392
  _elements: {
380
393
  _type: Type.PatientIdentifierTypeUuid,
381
394
  },
382
- _default: [],
383
395
  },
384
396
  registrationObs: {
385
397
  encounterTypeUuid: {
386
398
  _type: Type.UUID,
387
- _default: null,
399
+ _default: '',
388
400
  _description:
389
401
  'Obs created during registration will be associated with an encounter of this type. This must be set in order to use fields of type `obs`.',
390
402
  },
@@ -395,14 +407,14 @@ export const esmPatientRegistrationSchema = {
395
407
  },
396
408
  registrationFormUuid: {
397
409
  _type: Type.UUID,
398
- _default: null,
410
+ _default: '',
399
411
  _description:
400
412
  'The form UUID to associate with the registration encounter. By default no form will be associated.',
401
413
  },
402
414
  },
403
415
  freeTextFieldConceptUuid: {
404
- _default: '5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
405
416
  _type: Type.ConceptUuid,
417
+ _default: '5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
406
418
  },
407
419
  _validators: [
408
420
  validator(
@@ -133,7 +133,7 @@ const mockOpenmrsConfig: RegistrationConfig = {
133
133
  allowEstimatedDateOfBirth: true,
134
134
  useEstimatedDateOfBirth: {
135
135
  enabled: true,
136
- dayOfMonth: new Date().getDay(),
136
+ dayOfMonth: new Date().getDate(),
137
137
  month: new Date().getMonth(),
138
138
  },
139
139
  },
@@ -397,8 +397,8 @@ describe('Registering a new patient', () => {
397
397
  expect(mockSavePatient).toHaveBeenCalledTimes(1);
398
398
  expect(mockSaveEncounter).toHaveBeenCalledTimes(1);
399
399
 
400
- expect(mockShowSnackbar).toHaveBeenCalledWith(expect.objectContaining({ subtitle: 'an error message' })),
401
- mockSaveEncounter.mockResolvedValue({} as FetchResponse);
400
+ (expect(mockShowSnackbar).toHaveBeenCalledWith(expect.objectContaining({ subtitle: 'an error message' })),
401
+ mockSaveEncounter.mockResolvedValue({} as FetchResponse));
402
402
 
403
403
  await user.click(registerPatientButton);
404
404
  expect(mockSavePatient).toHaveBeenCalledTimes(2);