@kenyaemr/esm-patient-registration-app 8.0.1-pre.95 → 8.0.2

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.
Files changed (134) hide show
  1. package/.turbo/turbo-build.log +23 -22
  2. package/dist/108.js +1 -0
  3. package/dist/108.js.map +1 -0
  4. package/dist/130.js +1 -1
  5. package/dist/130.js.LICENSE.txt +2 -0
  6. package/dist/130.js.map +1 -1
  7. package/dist/2.js +1 -0
  8. package/dist/2.js.map +1 -0
  9. package/dist/250.js +1 -0
  10. package/dist/250.js.map +1 -0
  11. package/dist/271.js +1 -1
  12. package/dist/319.js +1 -1
  13. package/dist/325.js +1 -0
  14. package/dist/325.js.map +1 -0
  15. package/dist/372.js +2 -0
  16. package/dist/372.js.map +1 -0
  17. package/dist/460.js +1 -1
  18. package/dist/574.js +1 -1
  19. package/dist/644.js +1 -1
  20. package/dist/66.js +1 -0
  21. package/dist/66.js.map +1 -0
  22. package/dist/662.js +1 -0
  23. package/dist/662.js.map +1 -0
  24. package/dist/757.js +1 -1
  25. package/dist/{59.js → 76.js} +1 -1
  26. package/dist/{59.js.map → 76.js.map} +1 -1
  27. package/dist/788.js +1 -1
  28. package/dist/807.js +1 -1
  29. package/dist/833.js +1 -1
  30. package/dist/895.js +2 -0
  31. package/dist/895.js.LICENSE.txt +34 -0
  32. package/dist/895.js.map +1 -0
  33. package/dist/kenyaemr-esm-patient-registration-app.js +1 -1
  34. package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +161 -188
  35. package/dist/kenyaemr-esm-patient-registration-app.js.map +1 -1
  36. package/dist/main.js +1 -1
  37. package/dist/main.js.LICENSE.txt +10 -0
  38. package/dist/main.js.map +1 -1
  39. package/dist/routes.json +1 -1
  40. package/package-lock.json +6047 -0
  41. package/package.json +3 -4
  42. package/src/client-registry/client-registry.component.tsx +22 -0
  43. package/src/client-registry/hie-client-registry/hie-client-registry.component.tsx +134 -0
  44. package/src/client-registry/hie-client-registry/hie-client-registry.scss +53 -0
  45. package/src/client-registry/hie-client-registry/hie-resource.ts +162 -0
  46. package/src/client-registry/hie-client-registry/hie-types.ts +29 -0
  47. package/src/client-registry/hie-client-registry/modal/confirm-hie.modal.tsx +82 -0
  48. package/src/client-registry/hie-client-registry/modal/confirm-hie.scss +10 -0
  49. package/src/{patient-verification → client-registry/patient-verification}/patient-verification-hook.tsx +2 -2
  50. package/src/{patient-verification → client-registry/patient-verification}/patient-verification-utils.ts +1 -1
  51. package/src/{patient-verification → client-registry/patient-verification}/patient-verification.component.tsx +4 -1
  52. package/src/{patient-verification → client-registry/patient-verification}/patient-verification.scss +17 -1
  53. package/src/{patient-verification → client-registry/patient-verification}/verification-modal/empty-prompt.component.tsx +9 -6
  54. package/src/config-schema.ts +72 -2
  55. package/src/index.ts +6 -6
  56. package/src/patient-registration/field/cause-of-death/cause-of-death.component.tsx +98 -0
  57. package/src/patient-registration/field/date-and-time-of-death/date-and-time-of-death.component.tsx +84 -0
  58. package/src/patient-registration/field/dob/dob.component.tsx +21 -7
  59. package/src/patient-registration/field/field.component.tsx +11 -5
  60. package/src/patient-registration/field/field.resource.ts +11 -4
  61. package/src/patient-registration/field/field.scss +44 -5
  62. package/src/patient-registration/field/gender/gender-field.component.tsx +2 -1
  63. package/src/patient-registration/field/gender/gender-field.test.tsx +1 -0
  64. package/src/patient-registration/field/id/id-field.component.tsx +8 -6
  65. package/src/patient-registration/field/id/id-field.test.tsx +27 -8
  66. package/src/patient-registration/field/name/name-field.component.tsx +5 -1
  67. package/src/patient-registration/field/obs/obs-field.component.tsx +1 -1
  68. package/src/patient-registration/field/person-attributes/coded-person-attribute-field.component.tsx +1 -0
  69. package/src/patient-registration/field/person-attributes/custom-person-attribute-field.component.tsx +76 -27
  70. package/src/patient-registration/field/person-attributes/location-person-attribute-field.component.tsx +105 -0
  71. package/src/patient-registration/field/person-attributes/location-person-attribute-field.resource.tsx +48 -0
  72. package/src/patient-registration/field/person-attributes/person-attribute-field.component.tsx +12 -1
  73. package/src/patient-registration/field/person-attributes/useUpdateIdentifierRequirement.tsx +83 -0
  74. package/src/patient-registration/form-manager.test.ts +21 -0
  75. package/src/patient-registration/form-manager.ts +40 -20
  76. package/src/patient-registration/input/basic-input/input/input.component.tsx +5 -1
  77. package/src/patient-registration/input/custom-input/identifier/identifier-input.component.tsx +18 -10
  78. package/src/patient-registration/input/custom-input/identifier/identifier-input.test.tsx +166 -67
  79. package/src/patient-registration/input/dummy-data/dummy-data-input.component.tsx +3 -0
  80. package/src/patient-registration/input/input.scss +5 -0
  81. package/src/patient-registration/patient-registration-context.ts +4 -3
  82. package/src/patient-registration/patient-registration-hooks.ts +67 -9
  83. package/src/patient-registration/patient-registration-utils.ts +3 -7
  84. package/src/patient-registration/patient-registration.component.tsx +44 -30
  85. package/src/patient-registration/patient-registration.resource.ts +8 -0
  86. package/src/patient-registration/patient-registration.test.tsx +9 -3
  87. package/src/patient-registration/patient-registration.types.ts +4 -1
  88. package/src/patient-registration/section/death-info/death-info-section.component.tsx +22 -17
  89. package/src/patient-registration/section/death-info/death-info-section.test.tsx +4 -14
  90. package/src/patient-registration/section/section.component.tsx +1 -1
  91. package/src/patient-registration/section/section.scss +5 -0
  92. package/src/patient-registration/validation/{patient-registration-validation.test.tsx → patient-registration-validation.test.ts} +26 -4
  93. package/src/patient-registration/validation/patient-registration-validation.ts +126 -0
  94. package/src/routes.json +14 -17
  95. package/src/widgets/cancel-patient-edit.modal.tsx +33 -0
  96. package/src/widgets/cancel-patient-edit.test.tsx +2 -3
  97. package/src/widgets/delete-identifier-confirmation.modal.tsx +22 -15
  98. package/src/widgets/delete-identifier-confirmation.test.tsx +2 -1
  99. package/translations/am.json +36 -25
  100. package/translations/ar.json +37 -26
  101. package/translations/en.json +51 -20
  102. package/translations/es.json +38 -26
  103. package/translations/fr.json +47 -35
  104. package/translations/he.json +37 -30
  105. package/translations/km.json +37 -30
  106. package/translations/zh.json +37 -20
  107. package/translations/zh_CN.json +37 -20
  108. package/dist/152.js +0 -1
  109. package/dist/152.js.map +0 -1
  110. package/dist/255.js +0 -2
  111. package/dist/255.js.map +0 -1
  112. package/dist/303.js +0 -1
  113. package/dist/303.js.map +0 -1
  114. package/dist/330.js +0 -1
  115. package/dist/330.js.map +0 -1
  116. package/dist/564.js +0 -1
  117. package/dist/564.js.map +0 -1
  118. package/dist/623.js +0 -1
  119. package/dist/623.js.map +0 -1
  120. package/dist/729.js +0 -1
  121. package/dist/729.js.map +0 -1
  122. package/dist/735.js +0 -1
  123. package/dist/735.js.map +0 -1
  124. package/dist/831.js +0 -2
  125. package/dist/831.js.LICENSE.txt +0 -14
  126. package/dist/831.js.map +0 -1
  127. package/src/patient-registration/validation/patient-registration-validation.tsx +0 -60
  128. package/src/widgets/cancel-patient-edit.component.tsx +0 -37
  129. package/src/widgets/delete-identifier-confirmation.scss +0 -34
  130. /package/dist/{255.js.LICENSE.txt → 372.js.LICENSE.txt} +0 -0
  131. /package/src/{patient-verification → client-registry/patient-verification}/assets/counties.json +0 -0
  132. /package/src/{patient-verification → client-registry/patient-verification}/assets/verification-assets.ts +0 -0
  133. /package/src/{patient-verification → client-registry/patient-verification}/verification-modal/confirm-prompt.component.tsx +0 -0
  134. /package/src/{patient-verification → client-registry/patient-verification}/verification-types.ts +0 -0
@@ -1,60 +0,0 @@
1
- import * as Yup from 'yup';
2
- import mapValues from 'lodash/mapValues';
3
- import { type FormValues } from '../patient-registration.types';
4
- import { type RegistrationConfig } from '../../config-schema';
5
-
6
- export function getValidationSchema(config: RegistrationConfig) {
7
- return Yup.object({
8
- givenName: Yup.string().required('givenNameRequired'),
9
- familyName: Yup.string().required('familyNameRequired'),
10
- additionalGivenName: Yup.string().when('addNameInLocalLanguage', {
11
- is: true,
12
- then: Yup.string().required('givenNameRequired'),
13
- otherwise: Yup.string().notRequired(),
14
- }),
15
- additionalFamilyName: Yup.string().when('addNameInLocalLanguage', {
16
- is: true,
17
- then: Yup.string().required('familyNameRequired'),
18
- otherwise: Yup.string().notRequired(),
19
- }),
20
- gender: Yup.string()
21
- .oneOf(
22
- config.fieldConfigurations.gender.map((g) => g.value),
23
- 'genderUnspecified',
24
- )
25
- .required('genderRequired'),
26
- birthdate: Yup.date().when('birthdateEstimated', {
27
- is: false,
28
- then: Yup.date().required('birthdayRequired').max(Date(), 'birthdayNotInTheFuture').nullable(),
29
- otherwise: Yup.date().nullable(),
30
- }),
31
- yearsEstimated: Yup.number().when('birthdateEstimated', {
32
- is: true,
33
- then: Yup.number().required('yearsEstimateRequired').min(0, 'negativeYears'),
34
- otherwise: Yup.number().nullable(),
35
- }),
36
- monthsEstimated: Yup.number().min(0, 'negativeMonths'),
37
- deathDate: Yup.date().max(Date(), 'deathdayNotInTheFuture').nullable(),
38
- email: Yup.string().optional().email('invalidEmail'),
39
- identifiers: Yup.lazy((obj: FormValues['identifiers']) =>
40
- Yup.object(
41
- mapValues(obj, () =>
42
- Yup.object({
43
- required: Yup.bool(),
44
- identifierValue: Yup.string().when('required', {
45
- is: true,
46
- then: Yup.string().required('identifierValueRequired'),
47
- otherwise: Yup.string().notRequired(),
48
- }),
49
- }),
50
- ),
51
- ),
52
- ),
53
- relationships: Yup.array().of(
54
- Yup.object().shape({
55
- relatedPersonUuid: Yup.string().required(),
56
- relationshipType: Yup.string().required(),
57
- }),
58
- ),
59
- });
60
- }
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import { Button } from '@carbon/react';
3
- import { useTranslation } from 'react-i18next';
4
-
5
- interface CancelPatientEditProps {
6
- close(): void;
7
- onConfirm(): void;
8
- }
9
-
10
- const CancelPatientEdit: React.FC<CancelPatientEditProps> = ({ close, onConfirm }) => {
11
- const { t } = useTranslation();
12
- return (
13
- <>
14
- <div className="cds--modal-header">
15
- <h3 className="cds--modal-header__heading">{t('discardModalHeader', 'Confirm Discard Changes')}</h3>
16
- </div>
17
- <div className="cds--modal-content">
18
- <p>
19
- {t(
20
- 'discardModalBody',
21
- "The changes you made to this patient's details have not been saved. Discard changes?",
22
- )}
23
- </p>
24
- </div>
25
- <div className="cds--modal-footer">
26
- <Button kind="secondary" onClick={close}>
27
- {t('cancel', 'Cancel')}
28
- </Button>
29
- <Button kind="danger" onClick={onConfirm}>
30
- {t('discard', 'Discard')}
31
- </Button>
32
- </div>
33
- </>
34
- );
35
- };
36
-
37
- export default CancelPatientEdit;
@@ -1,34 +0,0 @@
1
- @use '@carbon/layout';
2
- @use '@carbon/type';
3
- @use '@openmrs/esm-styleguide/src/vars' as *;
4
-
5
- .productiveHeading {
6
- @include type.type-style('heading-compact-02');
7
- }
8
-
9
- .modalContent {
10
- width: 100%;
11
- background-color: $ui-01;
12
- padding: layout.$spacing-05;
13
- }
14
-
15
- .modalSubtitle {
16
- @include type.type-style('body-compact-01');
17
- }
18
-
19
- .modalBody {
20
- @include type.type-style('body-compact-01');
21
- margin: layout.$spacing-05 0;
22
- }
23
-
24
- .buttonSet {
25
- display: grid;
26
- grid-template-columns: 1fr 1fr;
27
- margin-left: -(layout.$spacing-05);
28
- margin-right: -(layout.$spacing-05);
29
- margin-bottom: -(layout.$spacing-05);
30
- }
31
-
32
- .buttonSet > button {
33
- max-width: unset !important;
34
- }
File without changes