@cc-openmrs/cc-esm-active-prescriptions 1.0.65 → 1.0.68
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/dist/116.js +1 -0
- package/dist/184.js +2 -1
- package/dist/{311.js.LICENSE.txt → 184.js.LICENSE.txt} +0 -37
- package/dist/197.js +1 -1
- package/dist/225.js +1 -1
- package/dist/282.js +2 -0
- package/dist/282.js.LICENSE.txt +32 -0
- package/dist/300.js +1 -1
- package/dist/311.js +1 -2
- package/dist/319.js +1 -1
- package/dist/335.js +1 -1
- package/dist/353.js +1 -0
- package/dist/41.js +1 -1
- package/dist/422.js +2 -1
- package/dist/464.js +2 -0
- package/dist/464.js.LICENSE.txt +19 -0
- package/dist/478.js +2 -0
- package/dist/499.js +1 -0
- package/dist/537.js +1 -1
- package/dist/540.js +1 -1
- package/dist/55.js +1 -1
- package/dist/606.js +2 -1
- package/dist/{618.js.LICENSE.txt → 606.js.LICENSE.txt} +2 -2
- package/dist/63.js +1 -0
- package/dist/652.js +1 -1
- package/dist/679.js +1 -1
- package/dist/779.js +2 -0
- package/dist/{31.js.LICENSE.txt → 779.js.LICENSE.txt} +11 -0
- package/dist/961.js +1 -1
- package/dist/966.js +1 -1
- package/dist/99.js +1 -1
- package/dist/993.js +1 -0
- package/dist/main.js +1 -2
- package/dist/openmrs-esm-patient-lists-app.js +1 -0
- package/dist/{openmrs-esm-template-app.js.buildmanifest.json → openmrs-esm-patient-lists-app.js.buildmanifest.json} +179 -248
- package/dist/routes.json +1 -1
- package/package.json +61 -51
- package/src/declarations.d.ts +4 -5
- package/src/prescriptions-actions/add-drug-prescription/add-drug-prescription.component.tsx +186 -0
- package/src/prescriptions-actions/add-drug-prescription/add-drug-prescription.scss +1 -0
- package/src/prescriptions-actions/add-drug-prescription/index.ts +2 -0
- package/src/prescriptions-actions/prescriptions-action-button.component.tsx +7 -13
- package/src/prescriptions-actions/prescriptions-action-menu-item.component.tsx +29 -0
- package/src/prescriptions-actions/prescriptions-action-menu-item.scss +12 -0
- package/src/root.component.tsx +224 -296
- package/src/routes.json +12 -11
- package/dist/177.js +0 -2
- package/dist/237.js +0 -2
- package/dist/237.js.LICENSE.txt +0 -9
- package/dist/31.js +0 -2
- package/dist/437.js +0 -1
- package/dist/533.js +0 -1
- package/dist/618.js +0 -2
- package/dist/635.js +0 -1
- package/dist/647.js +0 -2
- package/dist/647.js.LICENSE.txt +0 -9
- package/dist/692.js +0 -2
- package/dist/761.js +0 -2
- package/dist/761.js.LICENSE.txt +0 -29
- package/dist/875.js +0 -2
- package/dist/875.js.LICENSE.txt +0 -5
- package/dist/main.js.LICENSE.txt +0 -9
- package/dist/openmrs-esm-template-app.js +0 -1
- package/src/carbon-react.d.ts +0 -9
- /package/dist/{177.js.LICENSE.txt → 422.js.LICENSE.txt} +0 -0
- /package/dist/{692.js.LICENSE.txt → 478.js.LICENSE.txt} +0 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"blueBox","slot":"Boxes"},{"name":"prescriptions-
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"blueBox","slot":"Boxes"}],"workspaces2":[{"name":"active-prescriptions-workspace","component":"root","window":"active-prescriptions-workspace"}],"workspaceWindows2":[{"name":"active-prescriptions-workspace","group":"patient-chart","icon":"prescriptionsActionButton","width":"wider","order":4}],"version":"1.0.68"}
|
package/package.json
CHANGED
|
@@ -1,95 +1,105 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cc-openmrs/cc-esm-active-prescriptions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.68",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
|
-
"description": "An OpenMRS
|
|
6
|
-
"browser": "dist/openmrs-esm-
|
|
5
|
+
"description": "An OpenMRS frontend module for managing patient lists in the Patient Chart",
|
|
6
|
+
"browser": "dist/openmrs-esm-patient-lists-app.js",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
8
|
"source": true,
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "openmrs develop",
|
|
11
11
|
"serve": "webpack serve --mode=development",
|
|
12
|
-
"build": "webpack --mode production",
|
|
12
|
+
"build": "webpack --mode production --color",
|
|
13
13
|
"analyze": "webpack --mode=production --env analyze=true",
|
|
14
|
-
"lint": "eslint src --ext js,jsx,ts,tsx --max-warnings
|
|
15
|
-
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"
|
|
14
|
+
"lint": "cross-env eslint src --ext js,jsx,ts,tsx --fix --max-warnings=0",
|
|
15
|
+
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
16
16
|
"typescript": "tsc",
|
|
17
|
-
"test": "jest --config jest.config.js --passWithNoTests",
|
|
18
|
-
"
|
|
17
|
+
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests --color",
|
|
18
|
+
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js --color",
|
|
19
19
|
"coverage": "yarn test --coverage",
|
|
20
|
-
"
|
|
21
|
-
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./tools/i18next-parser.config.js",
|
|
22
|
-
"test-e2e": "playwright test"
|
|
20
|
+
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.modal.tsx' 'src/**/*.extension.tsx' 'src/**/*.workspace.tsx' 'src/**/*.hook.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js"
|
|
23
21
|
},
|
|
24
22
|
"browserslist": [
|
|
25
23
|
"extends browserslist-config-openmrs"
|
|
26
24
|
],
|
|
27
25
|
"keywords": [
|
|
28
|
-
"openmrs"
|
|
29
|
-
"microfrontends"
|
|
26
|
+
"openmrs"
|
|
30
27
|
],
|
|
31
|
-
"
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/openmrs/openmrs-esm-template-app.git"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/openmrs/openmrs-esm-template-app#readme",
|
|
28
|
+
"homepage": "https://github.com/openmrs/openmrs-esm-patient-chart#readme",
|
|
36
29
|
"publishConfig": {
|
|
37
30
|
"access": "public"
|
|
38
31
|
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/openmrs/openmrs-esm-patient-chart.git"
|
|
35
|
+
},
|
|
39
36
|
"bugs": {
|
|
40
|
-
"url": "https://github.com/openmrs/openmrs-esm-
|
|
37
|
+
"url": "https://github.com/openmrs/openmrs-esm-patient-chart/issues"
|
|
41
38
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"routes": "src/routes.json"
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@carbon/react": "^1.83.0"
|
|
45
41
|
},
|
|
46
42
|
"peerDependencies": {
|
|
47
|
-
"@carbon/react": "^1.x",
|
|
48
43
|
"@openmrs/esm-framework": "9.x",
|
|
49
|
-
"@openmrs/esm-
|
|
44
|
+
"@openmrs/esm-patient-common-lib": "12.x",
|
|
45
|
+
"dayjs": "1.x",
|
|
50
46
|
"react": "18.x",
|
|
51
|
-
"react-dom": "18.x",
|
|
52
47
|
"react-i18next": "16.x",
|
|
48
|
+
"react-router-dom": "6.x",
|
|
49
|
+
"rxjs": "6.x",
|
|
53
50
|
"swr": "2.x"
|
|
54
51
|
},
|
|
55
52
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@swc/
|
|
61
|
-
"@
|
|
53
|
+
"@openmrs/esm-framework": "next",
|
|
54
|
+
"@playwright/test": "^1.51.1",
|
|
55
|
+
"@swc/cli": "^0.1.62",
|
|
56
|
+
"@swc/core": "^1.3.89",
|
|
57
|
+
"@swc/jest": "^0.2.29",
|
|
58
|
+
"@testing-library/dom": "^10.1.0",
|
|
62
59
|
"@testing-library/jest-dom": "^6.4.5",
|
|
63
|
-
"@testing-library/react": "^15.0.
|
|
64
|
-
"@
|
|
65
|
-
"@types/
|
|
60
|
+
"@testing-library/react": "^15.0.7",
|
|
61
|
+
"@testing-library/user-event": "^14.5.2",
|
|
62
|
+
"@types/fhir": "^0.0.31",
|
|
63
|
+
"@types/jest": "^29.5.11",
|
|
64
|
+
"@types/lodash-es": "^4.17.9",
|
|
65
|
+
"@types/react": "^18.3.2",
|
|
66
66
|
"@types/react-dom": "^18.3.0",
|
|
67
|
-
"@types/webpack-env": "^1.18.
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
69
|
-
"@typescript-eslint/parser": "^
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
67
|
+
"@types/webpack-env": "^1.18.8",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
69
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
70
|
+
"babel-preset-minify": "^0.5.2",
|
|
71
|
+
"concurrently": "^8.2.1",
|
|
72
|
+
"cross-env": "^7.0.3",
|
|
73
|
+
"css-loader": "^6.6.0",
|
|
74
|
+
"d3-selection": "^3.0.0",
|
|
75
|
+
"dayjs": "^1.11.10",
|
|
76
|
+
"dotenv": "^16.3.1",
|
|
77
|
+
"eslint": "^8.57.0",
|
|
78
|
+
"eslint-plugin-import": "^2.31.0",
|
|
79
|
+
"eslint-plugin-jest-dom": "^5.4.0",
|
|
80
|
+
"eslint-plugin-playwright": "^0.16.0",
|
|
81
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
82
|
+
"eslint-plugin-testing-library": "^6.2.2",
|
|
74
83
|
"husky": "^8.0.3",
|
|
75
84
|
"i18next": "^25.0.0",
|
|
76
85
|
"i18next-parser": "^9.3.0",
|
|
77
86
|
"identity-obj-proxy": "^3.0.0",
|
|
78
87
|
"jest": "^29.7.0",
|
|
88
|
+
"jest-cli": "^29.7.0",
|
|
79
89
|
"jest-environment-jsdom": "^29.7.0",
|
|
80
|
-
"lint-staged": "^
|
|
81
|
-
"
|
|
82
|
-
"
|
|
90
|
+
"lint-staged": "^14.0.1",
|
|
91
|
+
"lodash": "^4.17.23",
|
|
92
|
+
"openmrs": "next",
|
|
93
|
+
"prettier": "^3.0.3",
|
|
83
94
|
"react": "^18.3.1",
|
|
84
95
|
"react-dom": "^18.3.1",
|
|
85
96
|
"react-i18next": "^16.0.0",
|
|
86
|
-
"
|
|
97
|
+
"react-router-dom": "^6.16.0",
|
|
98
|
+
"rxjs": "^6.6.7",
|
|
99
|
+
"sass": "^1.54.3",
|
|
100
|
+
"swc-loader": "^0.2.3",
|
|
101
|
+
"swr": "2.2.5",
|
|
87
102
|
"turbo": "^2.5.2",
|
|
88
103
|
"typescript": "^5.0.0"
|
|
89
|
-
}
|
|
90
|
-
"lint-staged": {
|
|
91
|
-
"packages/**/src/**/*.{ts,tsx}": "eslint --cache --fix --max-warnings 0",
|
|
92
|
-
"*.{css,scss,ts,tsx}": "prettier --write --list-different"
|
|
93
|
-
},
|
|
94
|
-
"packageManager": "yarn@4.10.3"
|
|
104
|
+
}
|
|
95
105
|
}
|
package/src/declarations.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
declare module '*.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare type SideNavProps = object;
|
|
1
|
+
declare module '*.scss' {
|
|
2
|
+
const content: { [className: string]: string };
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Button, Checkbox, ComboBox, TextInput } from '@carbon/react';
|
|
4
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
5
|
+
import useSWR from 'swr';
|
|
6
|
+
|
|
7
|
+
export interface PrescriptionDrugItem {
|
|
8
|
+
drug: { uuid: string; name: string; display: string };
|
|
9
|
+
dosage: string;
|
|
10
|
+
unit: string;
|
|
11
|
+
route: string;
|
|
12
|
+
frequency: string;
|
|
13
|
+
patientInstructions?: string;
|
|
14
|
+
asNeeded?: boolean;
|
|
15
|
+
asNeededCondition?: string;
|
|
16
|
+
indication?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface AddDrugPrescriptionProps {
|
|
20
|
+
initialData?: PrescriptionDrugItem;
|
|
21
|
+
onSave: (item: PrescriptionDrugItem) => void;
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const UNITS = [{ value: 'mg' }, { value: 'ml' }, { value: 'g' }, { value: 'mcg' }, { value: 'comprimido(s)' }];
|
|
26
|
+
|
|
27
|
+
const ROUTES = [
|
|
28
|
+
{ value: 'Oral' },
|
|
29
|
+
{ value: 'Intravenoso (IV)' },
|
|
30
|
+
{ value: 'Intramuscular (IM)' },
|
|
31
|
+
{ value: 'Subcutâneo (SC)' },
|
|
32
|
+
{ value: 'Tópico' },
|
|
33
|
+
{ value: 'Inalatório' },
|
|
34
|
+
{ value: 'Sublingual' },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const FREQUENCIES = [
|
|
38
|
+
{ value: '1x ao dia' },
|
|
39
|
+
{ value: '2x ao dia' },
|
|
40
|
+
{ value: '3x ao dia' },
|
|
41
|
+
{ value: '4x ao dia' },
|
|
42
|
+
{ value: '6/6h' },
|
|
43
|
+
{ value: '8/8h' },
|
|
44
|
+
{ value: '12/12h' },
|
|
45
|
+
{ value: 'Se necessário' },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
function useDrugSearch(query: string) {
|
|
49
|
+
const url =
|
|
50
|
+
query?.length >= 3
|
|
51
|
+
? `${restBaseUrl}/drug?q=${encodeURIComponent(query)}&v=custom:(uuid,name,display)&limit=10`
|
|
52
|
+
: null;
|
|
53
|
+
const { data, isValidating } = useSWR<any>(url, openmrsFetch);
|
|
54
|
+
return {
|
|
55
|
+
drugs: (data?.data?.results ?? []) as Array<{ uuid: string; name: string; display: string }>,
|
|
56
|
+
isLoading: isValidating,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const AddDrugPrescription: React.FC<AddDrugPrescriptionProps> = ({ initialData, onSave, onCancel }) => {
|
|
61
|
+
const { t } = useTranslation();
|
|
62
|
+
|
|
63
|
+
const [drugQuery, setDrugQuery] = useState(initialData?.drug?.name ?? '');
|
|
64
|
+
const [selectedDrug, setSelectedDrug] = useState<PrescriptionDrugItem['drug'] | null>(initialData?.drug ?? null);
|
|
65
|
+
const [dosage, setDosage] = useState(initialData?.dosage ?? '');
|
|
66
|
+
const [unit, setUnit] = useState(initialData?.unit ?? '');
|
|
67
|
+
const [route, setRoute] = useState(initialData?.route ?? '');
|
|
68
|
+
const [frequency, setFrequency] = useState(initialData?.frequency ?? '');
|
|
69
|
+
const [patientInstructions, setPatientInstructions] = useState(initialData?.patientInstructions ?? '');
|
|
70
|
+
const [asNeeded, setAsNeeded] = useState(initialData?.asNeeded ?? false);
|
|
71
|
+
const [asNeededCondition, setAsNeededCondition] = useState(initialData?.asNeededCondition ?? '');
|
|
72
|
+
const [indication, setIndication] = useState(initialData?.indication ?? '');
|
|
73
|
+
|
|
74
|
+
const { drugs, isLoading } = useDrugSearch(drugQuery);
|
|
75
|
+
|
|
76
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
if (!selectedDrug || !dosage || !unit || !frequency) return;
|
|
79
|
+
onSave({
|
|
80
|
+
drug: selectedDrug,
|
|
81
|
+
dosage,
|
|
82
|
+
unit,
|
|
83
|
+
route,
|
|
84
|
+
frequency,
|
|
85
|
+
patientInstructions: patientInstructions || undefined,
|
|
86
|
+
asNeeded,
|
|
87
|
+
asNeededCondition: asNeeded ? asNeededCondition || undefined : undefined,
|
|
88
|
+
indication: indication || undefined,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<form onSubmit={handleSubmit} style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
|
|
94
|
+
<ComboBox
|
|
95
|
+
id="drug-search"
|
|
96
|
+
titleText={t('drugName', 'Medicamento')}
|
|
97
|
+
placeholder={t('drugSearchPlaceholder', 'Digite para buscar (mín. 3 letras)...')}
|
|
98
|
+
items={drugs.map((d) => ({ id: d.uuid, label: d.display || d.name, ...d }))}
|
|
99
|
+
itemToString={(item: any) => item?.label ?? ''}
|
|
100
|
+
selectedItem={selectedDrug ? { id: selectedDrug.uuid, label: selectedDrug.display } : null}
|
|
101
|
+
onInputChange={(v: string) => {
|
|
102
|
+
setDrugQuery(v);
|
|
103
|
+
if (!v) setSelectedDrug(null);
|
|
104
|
+
}}
|
|
105
|
+
onChange={({ selectedItem }: any) => {
|
|
106
|
+
if (selectedItem) {
|
|
107
|
+
setSelectedDrug({
|
|
108
|
+
uuid: selectedItem.uuid,
|
|
109
|
+
name: selectedItem.name,
|
|
110
|
+
display: selectedItem.display ?? selectedItem.name,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}}
|
|
114
|
+
disabled={isLoading}
|
|
115
|
+
helperText={isLoading ? t('searching', 'Buscando...') : undefined}
|
|
116
|
+
/>
|
|
117
|
+
<TextInput
|
|
118
|
+
id="dosage"
|
|
119
|
+
labelText={t('dosage', 'Dose')}
|
|
120
|
+
value={dosage}
|
|
121
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setDosage(e.target.value)}
|
|
122
|
+
required
|
|
123
|
+
/>
|
|
124
|
+
<ComboBox
|
|
125
|
+
id="unit"
|
|
126
|
+
titleText={t('unit', 'Unidade')}
|
|
127
|
+
items={UNITS}
|
|
128
|
+
itemToString={(item: any) => item?.value ?? ''}
|
|
129
|
+
selectedItem={UNITS.find((u) => u.value === unit) ?? null}
|
|
130
|
+
onChange={({ selectedItem }: any) => setUnit(selectedItem?.value ?? '')}
|
|
131
|
+
/>
|
|
132
|
+
<ComboBox
|
|
133
|
+
id="route"
|
|
134
|
+
titleText={t('route', 'Via de administração')}
|
|
135
|
+
items={ROUTES}
|
|
136
|
+
itemToString={(item: any) => item?.value ?? ''}
|
|
137
|
+
selectedItem={ROUTES.find((r) => r.value === route) ?? null}
|
|
138
|
+
onChange={({ selectedItem }: any) => setRoute(selectedItem?.value ?? '')}
|
|
139
|
+
/>
|
|
140
|
+
<ComboBox
|
|
141
|
+
id="frequency"
|
|
142
|
+
titleText={t('frequency', 'Frequência')}
|
|
143
|
+
items={FREQUENCIES}
|
|
144
|
+
itemToString={(item: any) => item?.value ?? ''}
|
|
145
|
+
selectedItem={FREQUENCIES.find((f) => f.value === frequency) ?? null}
|
|
146
|
+
onChange={({ selectedItem }: any) => setFrequency(selectedItem?.value ?? '')}
|
|
147
|
+
/>
|
|
148
|
+
<TextInput
|
|
149
|
+
id="patient-instructions"
|
|
150
|
+
labelText={t('patientInstructions', 'Instruções ao paciente')}
|
|
151
|
+
value={patientInstructions}
|
|
152
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPatientInstructions(e.target.value)}
|
|
153
|
+
/>
|
|
154
|
+
<Checkbox
|
|
155
|
+
id="as-needed"
|
|
156
|
+
labelText={t('asNeeded', 'Tomar se necessário (P.R.N.)')}
|
|
157
|
+
checked={asNeeded}
|
|
158
|
+
onChange={(_: any, { checked }: any) => setAsNeeded(checked)}
|
|
159
|
+
/>
|
|
160
|
+
{asNeeded && (
|
|
161
|
+
<TextInput
|
|
162
|
+
id="as-needed-condition"
|
|
163
|
+
labelText={t('asNeededCondition', 'Motivo P.R.N.')}
|
|
164
|
+
value={asNeededCondition}
|
|
165
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setAsNeededCondition(e.target.value)}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
<TextInput
|
|
169
|
+
id="indication"
|
|
170
|
+
labelText={t('indication', 'Indicação')}
|
|
171
|
+
value={indication}
|
|
172
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setIndication(e.target.value)}
|
|
173
|
+
/>
|
|
174
|
+
<div style={{ display: 'flex', gap: '0.5rem', marginTop: '0.5rem' }}>
|
|
175
|
+
<Button type="submit" kind="primary" disabled={!selectedDrug || !dosage || !unit || !frequency}>
|
|
176
|
+
{t('saveMedication', 'Salvar medicamento')}
|
|
177
|
+
</Button>
|
|
178
|
+
<Button type="button" kind="secondary" onClick={onCancel}>
|
|
179
|
+
{t('cancel', 'Cancelar')}
|
|
180
|
+
</Button>
|
|
181
|
+
</div>
|
|
182
|
+
</form>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export default AddDrugPrescription;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "../add-drug-order/add-drug-order.scss";
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
import { ChevronRight } from '@carbon/icons-react';
|
|
4
|
-
import { ActionMenuButton } from '@openmrs/esm-styleguide';
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
import { ActionMenuButton2, EventsIcon } from '@openmrs/esm-framework';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
6
4
|
|
|
7
|
-
const handleClick = () => {
|
|
8
|
-
void launchWorkspace2('active-prescriptions');
|
|
9
|
-
};
|
|
10
|
-
|
|
11
5
|
const PrescriptionsActionButton: React.FC = () => {
|
|
12
6
|
const { t } = useTranslation();
|
|
13
7
|
const label = t('activePrescriptions', 'Active prescriptions');
|
|
14
8
|
|
|
15
9
|
return (
|
|
16
|
-
<
|
|
17
|
-
|
|
10
|
+
<ActionMenuButton2
|
|
11
|
+
icon={(props: ComponentProps<typeof EventsIcon>) => <EventsIcon {...props} />}
|
|
18
12
|
label={label}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
workspaceToLaunch={{
|
|
14
|
+
workspaceName: 'active-prescriptions-workspace',
|
|
15
|
+
}}
|
|
22
16
|
/>
|
|
23
17
|
);
|
|
24
18
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { OverflowMenuItem } from '@carbon/react';
|
|
3
|
+
import { CertificateCheck } from '@carbon/react/icons';
|
|
4
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import styles from './prescriptions-action-menu-item.scss';
|
|
7
|
+
|
|
8
|
+
const PrescriptionsActionMenuItem: React.FC = () => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
|
|
11
|
+
const handleClick = useCallback(() => {
|
|
12
|
+
launchWorkspace('active-prescriptions-workspace');
|
|
13
|
+
}, []);
|
|
14
|
+
|
|
15
|
+
const label = t('prescriptionsActionMenuItem', 'Active prescriptions');
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<OverflowMenuItem
|
|
19
|
+
itemText={
|
|
20
|
+
<span className={styles.iconOnly} aria-label={label} title={label}>
|
|
21
|
+
<CertificateCheck size={16} aria-hidden="true" />
|
|
22
|
+
</span>
|
|
23
|
+
}
|
|
24
|
+
onClick={handleClick}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// export default PrescriptionsActionMenuItem;
|