@openmrs/esm-patient-banner-app 11.3.1-pre.9360 → 11.3.1-pre.9365

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 (117) hide show
  1. package/.turbo/turbo-build.log +19 -20
  2. package/dist/1119.js +1 -1
  3. package/dist/1197.js +1 -1
  4. package/dist/2146.js +1 -1
  5. package/dist/2529.js +2 -0
  6. package/dist/2529.js.map +1 -0
  7. package/dist/2636.js +1 -1
  8. package/dist/2636.js.map +1 -1
  9. package/dist/2690.js +1 -1
  10. package/dist/3099.js +1 -1
  11. package/dist/3584.js +1 -1
  12. package/dist/4055.js +1 -1
  13. package/dist/4132.js +1 -1
  14. package/dist/4300.js +1 -1
  15. package/dist/4335.js +1 -1
  16. package/dist/439.js +1 -1
  17. package/dist/4618.js +1 -1
  18. package/dist/4652.js +1 -1
  19. package/dist/4944.js +1 -1
  20. package/dist/5173.js +1 -1
  21. package/dist/5241.js +1 -1
  22. package/dist/5442.js +1 -1
  23. package/dist/5661.js +1 -1
  24. package/dist/5763.js +1 -1
  25. package/dist/5763.js.map +1 -1
  26. package/dist/6022.js +1 -1
  27. package/dist/6468.js +1 -1
  28. package/dist/6589.js +1 -1
  29. package/dist/6679.js +1 -1
  30. package/dist/6840.js +1 -1
  31. package/dist/6859.js +1 -1
  32. package/dist/7097.js +1 -1
  33. package/dist/7159.js +1 -1
  34. package/dist/723.js +1 -1
  35. package/dist/7617.js +1 -1
  36. package/dist/795.js +1 -1
  37. package/dist/8163.js +1 -1
  38. package/dist/8349.js +1 -1
  39. package/dist/8371.js +1 -1
  40. package/dist/8618.js +1 -1
  41. package/dist/890.js +1 -1
  42. package/dist/9214.js +1 -1
  43. package/dist/9538.js +1 -1
  44. package/dist/9569.js +1 -1
  45. package/dist/986.js +1 -1
  46. package/dist/9879.js +1 -1
  47. package/dist/9895.js +1 -1
  48. package/dist/9900.js +1 -1
  49. package/dist/9913.js +1 -1
  50. package/dist/main.js +1 -1
  51. package/dist/main.js.map +1 -1
  52. package/dist/openmrs-esm-patient-banner-app.js +1 -1
  53. package/dist/openmrs-esm-patient-banner-app.js.buildmanifest.json +174 -270
  54. package/dist/openmrs-esm-patient-banner-app.js.map +1 -1
  55. package/dist/routes.json +1 -1
  56. package/package.json +2 -2
  57. package/src/config-schema.ts +0 -65
  58. package/src/index.ts +1 -20
  59. package/src/routes.json +0 -20
  60. package/translations/am.json +1 -9
  61. package/translations/ar.json +1 -9
  62. package/translations/ar_SY.json +1 -9
  63. package/translations/bn.json +1 -9
  64. package/translations/cs.json +1 -9
  65. package/translations/de.json +1 -9
  66. package/translations/en.json +1 -9
  67. package/translations/en_US.json +1 -9
  68. package/translations/es.json +1 -9
  69. package/translations/es_MX.json +1 -9
  70. package/translations/fr.json +1 -9
  71. package/translations/he.json +1 -9
  72. package/translations/hi.json +1 -9
  73. package/translations/hi_IN.json +1 -9
  74. package/translations/id.json +1 -9
  75. package/translations/it.json +1 -9
  76. package/translations/ka.json +1 -9
  77. package/translations/km.json +1 -9
  78. package/translations/ku.json +1 -9
  79. package/translations/ky.json +1 -9
  80. package/translations/lg.json +1 -9
  81. package/translations/ne.json +1 -9
  82. package/translations/pl.json +1 -9
  83. package/translations/pt.json +1 -9
  84. package/translations/pt_BR.json +1 -9
  85. package/translations/qu.json +1 -9
  86. package/translations/ro_RO.json +1 -9
  87. package/translations/ru_RU.json +1 -9
  88. package/translations/si.json +1 -9
  89. package/translations/sq.json +1 -9
  90. package/translations/sw.json +1 -9
  91. package/translations/sw_KE.json +1 -9
  92. package/translations/tr.json +1 -9
  93. package/translations/tr_TR.json +1 -9
  94. package/translations/uk.json +1 -9
  95. package/translations/uz.json +1 -9
  96. package/translations/uz@Latn.json +1 -9
  97. package/translations/uz_UZ.json +1 -9
  98. package/translations/vi.json +1 -9
  99. package/translations/zh.json +1 -9
  100. package/translations/zh_CN.json +1 -9
  101. package/translations/zh_TW.json +1 -9
  102. package/dist/44.js +0 -1
  103. package/dist/44.js.map +0 -1
  104. package/dist/508.js +0 -1
  105. package/dist/508.js.map +0 -1
  106. package/dist/5982.js +0 -1
  107. package/dist/5982.js.map +0 -1
  108. package/dist/8782.js +0 -2
  109. package/dist/8782.js.map +0 -1
  110. package/src/print-identifier-sticker/action-button.scss +0 -3
  111. package/src/print-identifier-sticker/patient-detail.component.tsx +0 -147
  112. package/src/print-identifier-sticker/print-identifier-sticker-action-button.component.tsx +0 -35
  113. package/src/print-identifier-sticker/print-identifier-sticker-modal.test.tsx +0 -131
  114. package/src/print-identifier-sticker/print-identifier-sticker.modal.tsx +0 -168
  115. package/src/print-identifier-sticker/print-identifier-sticker.resource.ts +0 -46
  116. package/src/print-identifier-sticker/print-identifier-sticker.scss +0 -88
  117. /package/dist/{8782.js.LICENSE.txt → 2529.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- .menuitem {
2
- max-width: none;
3
- }
@@ -1,147 +0,0 @@
1
- import React from 'react';
2
- import dayjs from 'dayjs';
3
- import { useTranslation } from 'react-i18next';
4
- import { age, type CoreTranslationKey, getCoreTranslation, getPatientName, useConfig } from '@openmrs/esm-framework';
5
- import { type ConfigObject } from '../config-schema';
6
- import styles from './print-identifier-sticker.scss';
7
-
8
- export interface PatientDetailProps {
9
- patient: fhir.Patient;
10
- }
11
-
12
- export const PatientName: React.FC<PatientDetailProps> = ({ patient }) => {
13
- const { t } = useTranslation();
14
- return (
15
- <div>
16
- <span>
17
- <strong className={styles.strong}>{t('patientNameWithSeparator', 'Patient name:')}</strong>
18
- </span>
19
- <span className={styles.patientDetail}>{getPatientName(patient)}</span>
20
- </div>
21
- );
22
- };
23
-
24
- export const PatientAge: React.FC<PatientDetailProps> = ({ patient }) => {
25
- const { t } = useTranslation();
26
- return (
27
- <div>
28
- <span>
29
- <strong className={styles.strong}>{t('patientAge', 'Age:')}</strong>
30
- </span>
31
- <span className={styles.patientDetail}>{age(patient.birthDate)}</span>
32
- </div>
33
- );
34
- };
35
-
36
- export const PatientDob: React.FC<PatientDetailProps> = ({ patient }) => {
37
- const { t } = useTranslation();
38
- return (
39
- <div>
40
- <span>
41
- <strong className={styles.strong}>{t('patientDateOfBirthWithSeparator', 'Date of birth:')}</strong>
42
- </span>
43
- <span className={styles.patientDetail}>{dayjs(patient.birthDate).format('DD-MM-YYYY')}</span>
44
- </div>
45
- );
46
- };
47
-
48
- export const PatientGender: React.FC<PatientDetailProps> = ({ patient }) => {
49
- const { t } = useTranslation();
50
- const getGender = (gender: string): string => {
51
- switch (gender) {
52
- case 'male':
53
- return getCoreTranslation('male', 'Male');
54
- case 'female':
55
- return getCoreTranslation('female', 'Female');
56
- case 'other':
57
- return getCoreTranslation('other', 'Other');
58
- case 'unknown':
59
- return getCoreTranslation('unknown', 'Unknown');
60
- default:
61
- return gender;
62
- }
63
- };
64
- return (
65
- <div>
66
- <span>
67
- <strong className={styles.strong}>{t('patientGenderWithSeparator', 'Gender:')}</strong>
68
- </span>
69
- <span className={styles.patientDetail}>{getGender(patient.gender)}</span>
70
- </div>
71
- );
72
- };
73
-
74
- export const PatientIdentifier: React.FC<PatientDetailProps> = ({ patient }) => {
75
- const { printPatientSticker } = useConfig<ConfigObject>();
76
- const { identifiersToDisplay } = printPatientSticker ?? {};
77
- const patientIdentifiers =
78
- (identifiersToDisplay ?? []).length === 0
79
- ? patient.identifier
80
- : patient.identifier?.filter((identifier) => identifiersToDisplay.includes(identifier.type.coding[0].code));
81
- return (
82
- <div>
83
- {patientIdentifiers?.map((identifier) => (
84
- <div key={identifier.id}>
85
- <span>
86
- <strong className={styles.strong}>{identifier.type.text}:</strong>
87
- </span>
88
- <span className={styles.patientDetail}>{identifier.value}</span>
89
- </div>
90
- ))}
91
- </div>
92
- );
93
- };
94
-
95
- export const PatientContact: React.FC<PatientDetailProps> = ({ patient }) => {
96
- const { t } = useTranslation();
97
-
98
- if (!patient?.telecom?.length) {
99
- return null;
100
- }
101
-
102
- return (
103
- <div>
104
- <span>
105
- <strong className={styles.strong}>{t('telephoneNumberWithSeparator', 'Telephone number:')}</strong>
106
- </span>
107
- <span className={styles.patientDetail}>{patient.telecom?.[0]?.value}</span>
108
- </div>
109
- );
110
- };
111
-
112
- export const PatientAddress: React.FC<PatientDetailProps> = ({ patient }) => {
113
- const address = patient?.address?.find((a) => a.use === 'home');
114
- const getAddressKey = (url: string) => url.split('#')[1];
115
-
116
- return (
117
- <>
118
- {address ? (
119
- Object.entries(address)
120
- .filter(([key]) => key !== 'id' && key !== 'use')
121
- .map(([key, value]) =>
122
- key === 'extension' ? (
123
- address.extension?.[0]?.extension?.map((add, i) => (
124
- <div key={`address-${key}-${i}`}>
125
- <span className={styles.strong}>
126
- {getCoreTranslation(
127
- getAddressKey(add.url) as CoreTranslationKey,
128
- getAddressKey(add.url) as CoreTranslationKey,
129
- )}
130
- :
131
- </span>
132
- <span className={styles.patientDetail}>{add.valueString}</span>
133
- </div>
134
- ))
135
- ) : (
136
- <div key={`address-${key}`}>
137
- <span className={styles.strong}>{getCoreTranslation(key as CoreTranslationKey, key)}:</span>
138
- <span className={styles.patientDetail}>{value}</span>
139
- </div>
140
- ),
141
- )
142
- ) : (
143
- <li>--</li>
144
- )}
145
- </>
146
- );
147
- };
@@ -1,35 +0,0 @@
1
- import React, { useCallback } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
- import { OverflowMenuItem } from '@carbon/react';
4
- import { showModal, useFeatureFlag } from '@openmrs/esm-framework';
5
- import styles from './action-button.scss';
6
-
7
- interface PrintIdentifierStickerOverflowMenuItemProps {
8
- patient: fhir.Patient;
9
- }
10
-
11
- const PrintIdentifierStickerOverflowMenuItem: React.FC<PrintIdentifierStickerOverflowMenuItemProps> = ({ patient }) => {
12
- const { t } = useTranslation();
13
- const canPrintPatientIdentifierSticker = useFeatureFlag('print-patient-identifier-sticker');
14
-
15
- const handleLaunchModal = useCallback(() => {
16
- const dispose = showModal('print-identifier-sticker-modal', {
17
- closeModal: () => dispose(),
18
- patient,
19
- });
20
- }, [patient]);
21
-
22
- if (!patient || !canPrintPatientIdentifierSticker) {
23
- return null;
24
- }
25
-
26
- return (
27
- <OverflowMenuItem
28
- className={styles.menuitem}
29
- itemText={t('printIdentifierSticker', 'Print identifier sticker')}
30
- onClick={handleLaunchModal}
31
- />
32
- );
33
- };
34
-
35
- export default PrintIdentifierStickerOverflowMenuItem;
@@ -1,131 +0,0 @@
1
- import React from 'react';
2
- import Barcode from 'react-barcode';
3
- import userEvent from '@testing-library/user-event';
4
- import { render, screen } from '@testing-library/react';
5
- import { useReactToPrint } from 'react-to-print';
6
- import { age, getDefaultsFromConfigSchema, useConfig } from '@openmrs/esm-framework';
7
- import { mockFhirPatient } from '__mocks__';
8
- import { type ConfigObject, configSchema } from '../config-schema';
9
- import { getByTextWithMarkup } from 'tools';
10
- import PrintIdentifierSticker from './print-identifier-sticker.modal';
11
-
12
- const mockedCloseModal = jest.fn();
13
- const mockedUseConfig = jest.mocked(useConfig<ConfigObject>);
14
- const mockedUseReactToPrint = jest.mocked(useReactToPrint);
15
-
16
- const defaultConfig: ConfigObject = getDefaultsFromConfigSchema(configSchema);
17
-
18
- jest.mock('react-to-print', () => ({
19
- ...jest.requireActual('react-to-print'),
20
- useReactToPrint: jest.fn(),
21
- }));
22
-
23
- jest.mock('react-barcode', () => jest.fn().mockReturnValue(<div data-testid="barcode" />));
24
-
25
- describe('PrintIdentifierStickerModal', () => {
26
- beforeEach(() => {
27
- mockedUseConfig.mockReturnValue(getDefaultsFromConfigSchema(configSchema));
28
- });
29
-
30
- it('renders the print modal', async () => {
31
- const user = userEvent.setup();
32
- const mockHandlePrint = jest.fn();
33
- mockedUseReactToPrint.mockReturnValue(mockHandlePrint);
34
-
35
- renderPrintIdentifierStickerModal();
36
-
37
- expect(screen.getByText(/print identifier sticker/i)).toBeInTheDocument();
38
- const printButton = screen.getByRole('button', { name: /print/i });
39
- const cancelButton = screen.getByRole('button', { name: /cancel/i });
40
-
41
- await user.click(cancelButton);
42
- expect(mockedCloseModal).toHaveBeenCalledTimes(1);
43
-
44
- await user.click(printButton);
45
- expect(mockHandlePrint).toHaveBeenCalledTimes(1);
46
- });
47
-
48
- it('renders a barcode if enabled via config', async () => {
49
- mockedUseConfig.mockReturnValue({
50
- ...defaultConfig,
51
- printPatientSticker: {
52
- ...defaultConfig.printPatientSticker,
53
- header: {
54
- showBarcode: true,
55
- showLogo: true,
56
- logo: '',
57
- },
58
- },
59
- });
60
-
61
- renderPrintIdentifierStickerModal();
62
-
63
- expect(screen.getByTestId('barcode')).toBeInTheDocument();
64
- expect(Barcode).toHaveBeenCalledWith(
65
- {
66
- value: '100008E',
67
- width: 2,
68
- background: '#f4f4f4',
69
- displayValue: true,
70
- renderer: 'img',
71
- font: 'IBM Plex Sans',
72
- format: 'CODE39',
73
- textAlign: 'center',
74
- textPosition: 'bottom',
75
- fontSize: 16,
76
- },
77
- {},
78
- );
79
- expect(screen.getByTestId('openmrs-logo')).toBeInTheDocument();
80
- });
81
-
82
- it("should not render a barcode if it's disabled via config", async () => {
83
- mockedUseConfig.mockReturnValue({
84
- ...defaultConfig,
85
- printPatientSticker: {
86
- ...defaultConfig.printPatientSticker,
87
- header: {
88
- showBarcode: false,
89
- showLogo: false,
90
- logo: '',
91
- },
92
- },
93
- });
94
-
95
- renderPrintIdentifierStickerModal();
96
-
97
- expect(screen.queryByTestId('barcode')).not.toBeInTheDocument();
98
- expect(screen.queryByTestId('openmrs-logo')).not.toBeInTheDocument();
99
- });
100
-
101
- it('renders a custom implementation logo if passed via config', () => {
102
- mockedUseConfig.mockReturnValue({
103
- ...defaultConfig,
104
- printPatientSticker: {
105
- ...defaultConfig.printPatientSticker,
106
- header: {
107
- showBarcode: true,
108
- showLogo: true,
109
- logo: '/openmrs/spa/logo.png',
110
- },
111
- },
112
- });
113
-
114
- renderPrintIdentifierStickerModal();
115
-
116
- expect(screen.getByRole('img')).toHaveAttribute('src', '/openmrs/spa/logo.png');
117
- });
118
-
119
- it("renders the patient's details in the print modal", () => {
120
- renderPrintIdentifierStickerModal();
121
-
122
- expect(getByTextWithMarkup(/Joshua Johnson/i)).toBeInTheDocument();
123
- expect(getByTextWithMarkup(/\+255777053243/i)).toBeInTheDocument();
124
- expect(getByTextWithMarkup(/100008E/i)).toBeInTheDocument();
125
- expect(getByTextWithMarkup(age(mockFhirPatient.birthDate))).toBeInTheDocument();
126
- });
127
- });
128
-
129
- function renderPrintIdentifierStickerModal() {
130
- return render(<PrintIdentifierSticker closeModal={mockedCloseModal} patient={mockFhirPatient} />);
131
- }
@@ -1,168 +0,0 @@
1
- import React, { useCallback, useEffect, useRef, useState } from 'react';
2
- import Barcode from 'react-barcode';
3
- import { useTranslation } from 'react-i18next';
4
- import { useReactToPrint } from 'react-to-print';
5
- import { Button, InlineLoading, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
6
- import { getPatientName, showSnackbar, useConfig, getCoreTranslation } from '@openmrs/esm-framework';
7
- import { type ConfigObject } from '../config-schema';
8
- import { defaultBarcodeParams, getPatientField } from './print-identifier-sticker.resource';
9
- import styles from './print-identifier-sticker.scss';
10
-
11
- interface PrintIdentifierStickerProps {
12
- closeModal: () => void;
13
- patient: fhir.Patient;
14
- }
15
-
16
- interface PrintComponentProps extends Partial<ConfigObject> {
17
- patient: fhir.Patient;
18
- }
19
-
20
- const PrintIdentifierSticker: React.FC<PrintIdentifierStickerProps> = ({ closeModal, patient }) => {
21
- const { t } = useTranslation();
22
- const { printPatientSticker } = useConfig<ConfigObject>();
23
- const { pageSize, printScale = '1' } = printPatientSticker ?? {};
24
- const contentToPrintRef = useRef(null);
25
- const onBeforeGetContentResolve = useRef<() => void | null>(null);
26
- const [isPrinting, setIsPrinting] = useState(false);
27
- const headerTitle = t('patientIdentifierSticker', 'Patient identifier sticker');
28
-
29
- useEffect(() => {
30
- if (isPrinting && onBeforeGetContentResolve.current) {
31
- onBeforeGetContentResolve.current();
32
- }
33
- }, [isPrinting]);
34
-
35
- const handleBeforeGetContent = useCallback(
36
- () =>
37
- new Promise<void>((resolve) => {
38
- if (patient && headerTitle) {
39
- onBeforeGetContentResolve.current = resolve;
40
- setIsPrinting(true);
41
- }
42
- }),
43
- [headerTitle, patient],
44
- );
45
-
46
- const handleAfterPrint = useCallback(() => {
47
- onBeforeGetContentResolve.current = null;
48
- setIsPrinting(false);
49
- closeModal();
50
- }, [closeModal]);
51
-
52
- const handlePrintError = useCallback((errorLocation, error) => {
53
- onBeforeGetContentResolve.current = null;
54
-
55
- showSnackbar({
56
- isLowContrast: false,
57
- kind: 'error',
58
- title: getCoreTranslation('printError', 'Print error'),
59
- subtitle:
60
- getCoreTranslation('printErrorExplainer', 'An error occurred in "{{errorLocation}}": ', { errorLocation }) +
61
- error,
62
- });
63
-
64
- setIsPrinting(false);
65
- }, []);
66
-
67
- const handleInitiatePrint = useCallback(
68
- (printWindow: HTMLIFrameElement | null): Promise<void> => {
69
- return new Promise<void>((resolve) => {
70
- if (printWindow) {
71
- const printContent = printWindow.contentDocument || printWindow.contentWindow?.document;
72
- if (printContent) {
73
- printContent.documentElement.style.setProperty('--print-scale', printScale);
74
- printWindow.contentWindow?.print();
75
- resolve();
76
- }
77
- }
78
- });
79
- },
80
- [printScale],
81
- );
82
-
83
- const handlePrint = useReactToPrint({
84
- content: () => contentToPrintRef.current,
85
- documentTitle: `${getPatientName(patient)} - ${headerTitle}`,
86
- onAfterPrint: handleAfterPrint,
87
- onBeforeGetContent: handleBeforeGetContent,
88
- onPrintError: handlePrintError,
89
- print: handleInitiatePrint,
90
- copyStyles: true,
91
- });
92
-
93
- return (
94
- <>
95
- <ModalHeader
96
- closeModal={closeModal}
97
- title={getCoreTranslation('printIdentifierSticker', 'Print identifier sticker')}
98
- />
99
- <ModalBody>
100
- <div ref={contentToPrintRef}>
101
- <style type="text/css" media="print">
102
- {`
103
- @page {
104
- size: ${pageSize};
105
- }
106
- `}
107
- </style>
108
- <PrintComponent patient={patient} />
109
- </div>
110
- </ModalBody>
111
- <ModalFooter>
112
- <Button kind="secondary" onClick={closeModal}>
113
- {getCoreTranslation('cancel', 'Cancel')}
114
- </Button>
115
- <Button className={styles.button} disabled={isPrinting} onClick={handlePrint} kind="primary">
116
- {isPrinting ? (
117
- <InlineLoading className={styles.loader} description={getCoreTranslation('printing', 'Printing') + '...'} />
118
- ) : (
119
- getCoreTranslation('print', 'Print')
120
- )}
121
- </Button>
122
- </ModalFooter>
123
- </>
124
- );
125
- };
126
-
127
- const PrintComponent = ({ patient }: PrintComponentProps) => {
128
- const { printPatientSticker } = useConfig<ConfigObject>();
129
- const primaryIdentifierValue = patient?.identifier?.find((identifier) => identifier.use === 'official')?.value;
130
- return (
131
- <div className={styles.stickerContainer}>
132
- <div className={styles.documentHeader}>
133
- {printPatientSticker?.header?.showBarcode && (
134
- <Barcode value={primaryIdentifierValue} {...defaultBarcodeParams} />
135
- )}
136
- {printPatientSticker?.header?.showLogo && (
137
- <div className={styles.implementationLogo}>
138
- <ImplementationLogo />
139
- </div>
140
- )}
141
- </div>
142
- {printPatientSticker.fields.map((field) => {
143
- const Component = getPatientField(field);
144
- return <Component key={field} patient={patient} />;
145
- })}
146
- </div>
147
- );
148
- };
149
-
150
- const ImplementationLogo: React.FC = () => {
151
- const { t } = useTranslation();
152
- const { printPatientSticker } = useConfig<ConfigObject>();
153
-
154
- return printPatientSticker?.header?.logo ? (
155
- <img alt={t('implementationLogo', 'Implementation logo')} src={printPatientSticker?.header?.logo} />
156
- ) : (
157
- // TODO: Figure out why #omrs-logo-full-mono sprite is not working
158
- <svg data-testid="openmrs-logo" role="img" viewBox="0 0 380 119" xmlns="http://www.w3.org/2000/svg">
159
- <path
160
- fillRule="evenodd"
161
- clipRule="evenodd"
162
- d="M40.29 40.328a27.755 27.755 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.835 42.835 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968l.021 18.36ZM79.645 79.671a27.744 27.744 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.857 42.857 0 0 0 59.96 103a42.833 42.833 0 0 0 19.672-4.751l.013-18.578ZM40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.819 42.819 0 0 0 4.752 19.672l18.576.013ZM79.634 40.289a27.753 27.753 0 0 1 8.154 19.688 27.744 27.744 0 0 1-8.117 19.646l18.542.02a42.842 42.842 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675l-18.577-.013ZM156.184 60.002c0-8.748-6.118-15.776-15.025-15.776-8.909 0-15.025 7.028-15.025 15.776 0 8.749 6.116 15.78 15.025 15.78 8.907 0 15.025-7.031 15.025-15.78Zm-34.881 0c0-11.482 8.318-19.958 19.856-19.958 11.536 0 19.855 8.477 19.855 19.959 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.965ZM179.514 75.54c5.507 0 9.05-4.14 9.05-9.482 0-5.341-3.543-9.483-9.05-9.483-5.505 0-9.046 4.142-9.046 9.483 0 5.342 3.541 9.482 9.046 9.482ZM166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248V53.306ZM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193h16.021Zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868l3.219 2.508ZM227.854 59.356c0-2.346-.216-4.36-.216-6.05h4.031c0 1.363.11 2.777.11 4.195h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25V59.356ZM259.211 41.008h6.708L278.8 70.791h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507V41.01ZM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333v12.558Zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506V41.01ZM358.123 47.712c-1.506-2.413-4.187-3.486-6.926-3.486-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45l-3.699 3.218Z"
163
- />
164
- </svg>
165
- );
166
- };
167
-
168
- export default PrintIdentifierSticker;
@@ -1,46 +0,0 @@
1
- import { type Options } from 'react-barcode';
2
- import { type AllowedPatientFields } from '../config-schema';
3
- import {
4
- PatientAddress,
5
- PatientAge,
6
- PatientContact,
7
- type PatientDetailProps,
8
- PatientDob,
9
- PatientGender,
10
- PatientIdentifier,
11
- PatientName,
12
- } from './patient-detail.component';
13
-
14
- export const defaultBarcodeParams: Options = {
15
- width: 2,
16
- format: 'CODE39',
17
- background: '#f4f4f4',
18
- displayValue: true,
19
- renderer: 'img',
20
- font: 'IBM Plex Sans',
21
- textAlign: 'center',
22
- textPosition: 'bottom',
23
- fontSize: 16,
24
- };
25
-
26
- export function getPatientField(field: AllowedPatientFields): React.FC<PatientDetailProps> {
27
- switch (field) {
28
- case 'name':
29
- return PatientName;
30
- case 'age':
31
- return PatientAge;
32
- case 'dob':
33
- return PatientDob;
34
- case 'gender':
35
- return PatientGender;
36
- case 'identifier':
37
- return PatientIdentifier;
38
- case 'contact':
39
- return PatientContact;
40
- case 'address':
41
- return PatientAddress;
42
- default:
43
- console.error(`Invalid patient field: ${field}`);
44
- return null;
45
- }
46
- }
@@ -1,88 +0,0 @@
1
- @use '@carbon/layout';
2
- @use '@carbon/type';
3
- @use '@openmrs/esm-styleguide/src/vars' as *;
4
-
5
- .stickerContainer {
6
- padding: layout.$spacing-03 layout.$spacing-05;
7
- }
8
-
9
- .documentHeader {
10
- display: flex;
11
- justify-content: space-between;
12
- align-items: center;
13
- border-bottom: 1px solid $brand-01;
14
- margin-bottom: layout.$spacing-05;
15
- }
16
-
17
- .row {
18
- margin: layout.$spacing-03 0 0;
19
- display: flex;
20
- flex-flow: row wrap;
21
- gap: layout.$spacing-05;
22
- }
23
-
24
- .gridRow {
25
- padding: 0px;
26
- display: flex;
27
- flex-direction: row;
28
- justify-content: space-between;
29
-
30
- div {
31
- margin-left: 0px;
32
- margin-bottom: 5px;
33
- }
34
- }
35
-
36
- .patientName {
37
- font-size: layout.$spacing-06;
38
- font-weight: bolder;
39
- margin-bottom: 5px;
40
- }
41
-
42
- .button {
43
- :global(.cds--inline-loading) {
44
- min-height: layout.$spacing-05 !important;
45
- }
46
- }
47
-
48
- .detailsGrid {
49
- display: grid;
50
- grid-template-columns: repeat(2, minmax(0, 1fr));
51
- gap: layout.$spacing-03 0;
52
- margin-top: layout.$spacing-03;
53
- }
54
-
55
- .loader {
56
- :global(.cds--inline-loading__text) {
57
- @include type.type-style('body-01');
58
- }
59
- }
60
-
61
- .strong {
62
- @include type.type-style('heading-04');
63
- font-weight: 700;
64
- margin-inline-end: layout.$spacing-03;
65
- }
66
-
67
- .patientDetail {
68
- @include type.type-style('heading-03');
69
- }
70
-
71
- .implementationLogo {
72
- width: 40%;
73
- }
74
-
75
- @media print {
76
- html,
77
- body {
78
- height: 100vh;
79
- margin: 0 !important;
80
- padding: 0 !important;
81
- overflow: hidden;
82
- }
83
-
84
- .stickerContainer {
85
- transform: scale(var(--print-scale));
86
- transform-origin: left top;
87
- }
88
- }