@cc-openmrs/cc-esm-active-prescriptions 1.0.71 → 1.0.72
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/499.js +1 -1
- package/dist/695.js +2 -0
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-patient-lists-app.js +1 -1
- package/dist/openmrs-esm-patient-lists-app.js.buildmanifest.json +50 -29
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/prescription-form/prescription-form.component.tsx +237 -0
- package/src/prescription.store.tsx +81 -0
- package/src/prescriptions-actions/add-drug-prescription/add-drug-prescription.page.tsx +65 -0
- package/src/root.component.tsx +20 -277
- package/src/root.scss +0 -27
- package/dist/818.js +0 -2
- /package/dist/{818.js.LICENSE.txt → 695.js.LICENSE.txt} +0 -0
package/src/root.component.tsx
CHANGED
|
@@ -1,34 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* support from `@openmrs/esm-framework`. Check out `Greeter` to see
|
|
4
|
-
* usage of the configuration system, and check out `PatientGetter` to
|
|
5
|
-
* see data fetching using the OpenMRS FHIR API.
|
|
6
|
-
*
|
|
7
|
-
* Check out the Config docs:
|
|
8
|
-
* https://openmrs.github.io/openmrs-esm-core/#/main/config
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import React, { useMemo, useState } from 'react';
|
|
12
|
-
import { PrescriptionService } from './prescriptions.service';
|
|
13
|
-
import { Workspace2 } from '@openmrs/esm-framework';
|
|
14
|
-
import {
|
|
15
|
-
Button,
|
|
16
|
-
Checkbox,
|
|
17
|
-
ComboBox,
|
|
18
|
-
InlineLoading,
|
|
19
|
-
InlineNotification,
|
|
20
|
-
Tab,
|
|
21
|
-
TabList,
|
|
22
|
-
TabPanel,
|
|
23
|
-
TabPanels,
|
|
24
|
-
Tabs,
|
|
25
|
-
TextArea,
|
|
26
|
-
TextInput,
|
|
27
|
-
} from '@carbon/react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MemoryRouter, Route, Routes } from 'react-router-dom';
|
|
28
3
|
import { useTranslation } from 'react-i18next';
|
|
29
|
-
import {
|
|
30
|
-
import
|
|
31
|
-
import
|
|
4
|
+
import { Workspace2 } from '@openmrs/esm-framework';
|
|
5
|
+
import { PrescriptionProvider } from './prescription.store';
|
|
6
|
+
import PrescriptionForm from './prescription-form/prescription-form.component';
|
|
7
|
+
import AddDrugPrescriptionPage from './prescriptions-actions/add-drug-prescription/add-drug-prescription.page';
|
|
32
8
|
|
|
33
9
|
interface RootProps {
|
|
34
10
|
patientUuid?: string;
|
|
@@ -41,254 +17,21 @@ interface RootProps {
|
|
|
41
17
|
|
|
42
18
|
const Root: React.FC<RootProps> = ({ patientUuid, patient }) => {
|
|
43
19
|
const { t } = useTranslation();
|
|
44
|
-
const [activeTab, setActiveTab] = useState<'new' | 'past'>('new');
|
|
45
|
-
const [selectedLocation, setSelectedLocation] = useState<Location | null>(null);
|
|
46
|
-
const [policyNumber, setPolicyNumber] = useState('');
|
|
47
|
-
const [digitallySigned, setDigitallySigned] = useState(false);
|
|
48
|
-
const [printRequested, setPrintRequested] = useState(false);
|
|
49
|
-
const [observations, setObservations] = useState('');
|
|
50
|
-
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
51
|
-
const [submitError, setSubmitError] = useState<string | null>(null);
|
|
52
|
-
|
|
53
|
-
// Lista de medicamentos da prescrição — escopo da prescrição
|
|
54
|
-
const [prescriptionOrders, setPrescriptionOrders] = useState<PrescriptionDrugItem[]>([]);
|
|
55
|
-
const [showAddMedication, setShowAddMedication] = useState(false);
|
|
56
|
-
const [editIndex, setEditIndex] = useState<number | null>(null);
|
|
57
|
-
|
|
58
|
-
const locations = useLocations();
|
|
59
|
-
const locationItems = useMemo(() => locations ?? [], [locations]);
|
|
60
|
-
|
|
61
|
-
const handleSaveMedication = (item: PrescriptionDrugItem) => {
|
|
62
|
-
if (editIndex !== null) {
|
|
63
|
-
setPrescriptionOrders((prev) => prev.map((m, idx) => (idx === editIndex ? item : m)));
|
|
64
|
-
setEditIndex(null);
|
|
65
|
-
} else {
|
|
66
|
-
setPrescriptionOrders((prev) => [...prev, item]);
|
|
67
|
-
}
|
|
68
|
-
setShowAddMedication(false);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const handleRemoveMedication = (idx: number) => {
|
|
72
|
-
setPrescriptionOrders((prev) => prev.filter((_, i) => i !== idx));
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const openEditMedication = (idx: number) => {
|
|
76
|
-
setEditIndex(idx);
|
|
77
|
-
setShowAddMedication(true);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const handleSubmitPrescription = async () => {
|
|
81
|
-
if (!patientUuid || !selectedLocation || prescriptionOrders.length === 0) return;
|
|
82
|
-
setIsSubmitting(true);
|
|
83
|
-
setSubmitError(null);
|
|
84
|
-
try {
|
|
85
|
-
const payload = {
|
|
86
|
-
patientUuid,
|
|
87
|
-
patientName: patient?.name?.[0]
|
|
88
|
-
? `${patient.name[0].given?.join(' ')} ${patient.name[0].family}`.trim()
|
|
89
|
-
: '',
|
|
90
|
-
patientBirthDate: patient?.birthDate ?? '',
|
|
91
|
-
patientGender: patient?.gender ?? '',
|
|
92
|
-
providerUuid: '',
|
|
93
|
-
providerName: '',
|
|
94
|
-
locationUuid: selectedLocation.uuid,
|
|
95
|
-
locationName: selectedLocation.display,
|
|
96
|
-
policyNumber,
|
|
97
|
-
orderUuids: prescriptionOrders.map((o) => o.drug.uuid),
|
|
98
|
-
digitallySigned,
|
|
99
|
-
printRequested,
|
|
100
|
-
observations,
|
|
101
|
-
};
|
|
102
|
-
await PrescriptionService.createPrescription(payload as any);
|
|
103
|
-
// Limpar após sucesso
|
|
104
|
-
setPrescriptionOrders([]);
|
|
105
|
-
setSelectedLocation(null);
|
|
106
|
-
setPolicyNumber('');
|
|
107
|
-
setDigitallySigned(false);
|
|
108
|
-
setPrintRequested(false);
|
|
109
|
-
setObservations('');
|
|
110
|
-
} catch (e: any) {
|
|
111
|
-
setSubmitError(e?.message ?? t('submitError', 'Erro ao salvar a prescrição.'));
|
|
112
|
-
} finally {
|
|
113
|
-
setIsSubmitting(false);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
20
|
return (
|
|
118
|
-
<
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<Tabs
|
|
133
|
-
selectedIndex={activeTab === 'new' ? 0 : 1}
|
|
134
|
-
onChange={({ selectedIndex }) => setActiveTab(selectedIndex === 0 ? 'new' : 'past')}
|
|
135
|
-
>
|
|
136
|
-
<TabList aria-label={t('visitTimingLabel', 'A visita é')}>
|
|
137
|
-
<Tab>{t('visitTimingNew', 'Nova')}</Tab>
|
|
138
|
-
<Tab>{t('visitTimingPast', 'No passado')}</Tab>
|
|
139
|
-
</TabList>
|
|
140
|
-
<TabPanels>
|
|
141
|
-
<TabPanel className={styles.tabContent}>
|
|
142
|
-
{/* Local da visita */}
|
|
143
|
-
<div className={styles.fieldGroup}>
|
|
144
|
-
<ComboBox
|
|
145
|
-
id="visit-location"
|
|
146
|
-
items={locationItems}
|
|
147
|
-
itemToString={(item) => item?.display ?? ''}
|
|
148
|
-
selectedItem={selectedLocation}
|
|
149
|
-
onChange={({ selectedItem }) => setSelectedLocation((selectedItem as Location) ?? null)}
|
|
150
|
-
placeholder={t('visitLocationPlaceholder', 'Selecione o local')}
|
|
151
|
-
titleText={t('visitLocationHeading', 'Local da visita')}
|
|
152
|
-
helperText={t('visitLocationHelper', 'Selecione onde a visita ocorrerá.')}
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
{/* Número da apólice */}
|
|
157
|
-
<div className={styles.fieldGroup}>
|
|
158
|
-
<TextInput
|
|
159
|
-
id="insurance-policy"
|
|
160
|
-
labelText={t('insurancePolicyNumberLabel', 'Número da apólice (opcional)')}
|
|
161
|
-
placeholder={t('insurancePolicyNumberPlaceholder', 'Digite o número da apólice')}
|
|
162
|
-
value={policyNumber}
|
|
163
|
-
onChange={(event) => setPolicyNumber(event.target.value)}
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
|
|
167
|
-
{/* Assinatura digital e impressão */}
|
|
168
|
-
<div className={styles.fieldGroup}>
|
|
169
|
-
<Checkbox
|
|
170
|
-
id="sign-prescription-checkbox"
|
|
171
|
-
labelText={t('signPrescriptionLabel', 'Assinar digitalmente a prescrição')}
|
|
172
|
-
checked={digitallySigned}
|
|
173
|
-
onChange={(_: any, { checked }: any) => setDigitallySigned(checked)}
|
|
174
|
-
/>
|
|
175
|
-
<Checkbox
|
|
176
|
-
id="print-prescription-checkbox"
|
|
177
|
-
labelText={t('printPrescriptionLabel', 'Imprimir a prescrição')}
|
|
178
|
-
checked={printRequested}
|
|
179
|
-
onChange={(_: any, { checked }: any) => setPrintRequested(checked)}
|
|
180
|
-
/>
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
{/* Observações */}
|
|
184
|
-
<div className={styles.fieldGroup}>
|
|
185
|
-
<TextArea
|
|
186
|
-
id="observations"
|
|
187
|
-
labelText={t('observations', 'Observações')}
|
|
188
|
-
placeholder={t('observationsPlaceholder', 'Observações da prescrição...')}
|
|
189
|
-
value={observations}
|
|
190
|
-
onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => setObservations(event.target.value)}
|
|
191
|
-
rows={3}
|
|
192
|
-
/>
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
{/* Lista de medicamentos da prescrição */}
|
|
196
|
-
<div className={styles.fieldGroup}>
|
|
197
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 8 }}>
|
|
198
|
-
<h3 style={{ margin: 0 }}>{t('medicationsList', 'Medicamentos')}</h3>
|
|
199
|
-
<Button
|
|
200
|
-
size="sm"
|
|
201
|
-
hasIconOnly
|
|
202
|
-
kind="ghost"
|
|
203
|
-
renderIcon={() => (
|
|
204
|
-
<svg width="20" height="20" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
205
|
-
<path d="M16 6V26" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
|
|
206
|
-
<path d="M6 16H26" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
|
|
207
|
-
</svg>
|
|
208
|
-
)}
|
|
209
|
-
iconDescription={t('addMedication', 'Adicionar medicamento')}
|
|
210
|
-
onClick={() => { setEditIndex(null); setShowAddMedication(true); }}
|
|
211
|
-
/>
|
|
212
|
-
</div>
|
|
213
|
-
|
|
214
|
-
{prescriptionOrders.length === 0 ? (
|
|
215
|
-
<p>{t('noMedicationsAdded', 'Nenhum medicamento adicionado ainda.')}</p>
|
|
216
|
-
) : (
|
|
217
|
-
<ul className={styles.medicationsList}>
|
|
218
|
-
{prescriptionOrders.map((order, idx) => (
|
|
219
|
-
<li key={idx} className={styles.medicationItem}>
|
|
220
|
-
<span>
|
|
221
|
-
<b>{order.drug.display}</b> — {order.dosage} {order.unit}
|
|
222
|
-
{order.route ? ` · ${order.route}` : ''} · {order.frequency}
|
|
223
|
-
</span>
|
|
224
|
-
<Button size="sm" kind="ghost" onClick={() => openEditMedication(idx)}>
|
|
225
|
-
{t('edit', 'Editar')}
|
|
226
|
-
</Button>
|
|
227
|
-
<Button size="sm" kind="danger--ghost" onClick={() => handleRemoveMedication(idx)}>
|
|
228
|
-
{t('remove', 'Remover')}
|
|
229
|
-
</Button>
|
|
230
|
-
</li>
|
|
231
|
-
))}
|
|
232
|
-
</ul>
|
|
233
|
-
)}
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
{/* Formulário de adição/edição de medicamento — modal overlay */}
|
|
237
|
-
{showAddMedication && (
|
|
238
|
-
<div className={styles.overlayBackdrop} onClick={(e) => { if (e.target === e.currentTarget) { setShowAddMedication(false); setEditIndex(null); } }}>
|
|
239
|
-
<div className={styles.overlayPanel}>
|
|
240
|
-
<h3>
|
|
241
|
-
{editIndex !== null
|
|
242
|
-
? t('editMedication', 'Editar medicamento')
|
|
243
|
-
: t('addMedication', 'Adicionar medicamento')}
|
|
244
|
-
</h3>
|
|
245
|
-
<AddDrugPrescription
|
|
246
|
-
initialData={editIndex !== null ? prescriptionOrders[editIndex] : undefined}
|
|
247
|
-
onSave={handleSaveMedication}
|
|
248
|
-
onCancel={() => { setShowAddMedication(false); setEditIndex(null); }}
|
|
249
|
-
/>
|
|
250
|
-
</div>
|
|
251
|
-
</div>
|
|
252
|
-
)}
|
|
253
|
-
|
|
254
|
-
{/* Erro de envio */}
|
|
255
|
-
{submitError && (
|
|
256
|
-
<InlineNotification
|
|
257
|
-
lowContrast
|
|
258
|
-
kind="error"
|
|
259
|
-
title={t('submitError', 'Erro ao salvar a prescrição.')}
|
|
260
|
-
subtitle={submitError}
|
|
261
|
-
onCloseButtonClick={() => setSubmitError(null)}
|
|
262
|
-
/>
|
|
263
|
-
)}
|
|
264
|
-
|
|
265
|
-
{/* Botão de salvar prescrição */}
|
|
266
|
-
<div style={{ display: 'flex', gap: 8, marginTop: 16 }}>
|
|
267
|
-
<Button
|
|
268
|
-
kind="primary"
|
|
269
|
-
disabled={!patientUuid || !selectedLocation || prescriptionOrders.length === 0 || isSubmitting}
|
|
270
|
-
onClick={handleSubmitPrescription}
|
|
271
|
-
>
|
|
272
|
-
{isSubmitting
|
|
273
|
-
? <InlineLoading description={t('saving', 'Salvando...')} />
|
|
274
|
-
: t('createPrescriptionButtonLabel', 'Salvar Prescrição')}
|
|
275
|
-
</Button>
|
|
276
|
-
</div>
|
|
277
|
-
</TabPanel>
|
|
278
|
-
|
|
279
|
-
<TabPanel className={styles.tabContent}>
|
|
280
|
-
<InlineNotification
|
|
281
|
-
lowContrast
|
|
282
|
-
kind="info"
|
|
283
|
-
title={t('inPastTabPlaceholderTitle', 'Receitas históricas em breve')}
|
|
284
|
-
subtitle={t('inPastTabPlaceholderSubtitle', 'Volte para Nova para gerenciar medicamentos atuais.')}
|
|
285
|
-
/>
|
|
286
|
-
</TabPanel>
|
|
287
|
-
</TabPanels>
|
|
288
|
-
</Tabs>
|
|
289
|
-
</section>
|
|
290
|
-
</div>
|
|
291
|
-
</Workspace2>
|
|
21
|
+
<PrescriptionProvider>
|
|
22
|
+
<MemoryRouter>
|
|
23
|
+
<Workspace2
|
|
24
|
+
title={t('activePrescriptionsWorkspaceTitle', 'Prescrições ativas')}
|
|
25
|
+
hasUnsavedChanges={false}
|
|
26
|
+
>
|
|
27
|
+
<Routes>
|
|
28
|
+
<Route path="/" element={<PrescriptionForm patientUuid={patientUuid} patient={patient} />} />
|
|
29
|
+
<Route path="/medications/new" element={<AddDrugPrescriptionPage />} />
|
|
30
|
+
<Route path="/medications/:index/edit" element={<AddDrugPrescriptionPage />} />
|
|
31
|
+
</Routes>
|
|
32
|
+
</Workspace2>
|
|
33
|
+
</MemoryRouter>
|
|
34
|
+
</PrescriptionProvider>
|
|
292
35
|
);
|
|
293
36
|
};
|
|
294
37
|
|
package/src/root.scss
CHANGED
|
@@ -111,31 +111,4 @@
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.overlayBackdrop {
|
|
115
|
-
position: fixed;
|
|
116
|
-
inset: 0;
|
|
117
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
118
|
-
z-index: 9000;
|
|
119
|
-
display: flex;
|
|
120
|
-
align-items: center;
|
|
121
|
-
justify-content: center;
|
|
122
|
-
}
|
|
123
114
|
|
|
124
|
-
.overlayPanel {
|
|
125
|
-
background-color: var(--cds-layer, #ffffff);
|
|
126
|
-
border-radius: layout.$spacing-02;
|
|
127
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
|
|
128
|
-
width: 100%;
|
|
129
|
-
max-width: 520px;
|
|
130
|
-
max-height: 90vh;
|
|
131
|
-
overflow-y: auto;
|
|
132
|
-
padding: layout.$spacing-07;
|
|
133
|
-
display: flex;
|
|
134
|
-
flex-direction: column;
|
|
135
|
-
gap: layout.$spacing-05;
|
|
136
|
-
|
|
137
|
-
h3 {
|
|
138
|
-
@include type.type-style('heading-03');
|
|
139
|
-
margin: 0;
|
|
140
|
-
}
|
|
141
|
-
}
|
package/dist/818.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 818.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[818],{6052(e,n,t){t.d(n,{A:()=>l});var a=t(2996),i=t.n(a),o=t(159),r=t.n(o)()(i());r.push([e.id,".-cc-esm-active-prescriptions__root__workspace___\\+xqk5{padding:2rem;display:flex;flex-direction:column;gap:1.5rem;background-color:var(--cds-layer, #ffffff);min-height:100%}.-cc-esm-active-prescriptions__root__header___G1X3T{display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__subtitle___kRieu{font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:var(--cds-text-secondary, #525252);margin:0;max-width:48rem}.-cc-esm-active-prescriptions__root__section___61mCr{background-color:var(--cds-layer-accent, #f4f4f4);padding:1rem;border-radius:.25rem;box-shadow:0 1px 2px rgba(0,0,0,.08)}.-cc-esm-active-prescriptions__root__fieldLabel___F2zAd{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);margin-bottom:.5rem}.-cc-esm-active-prescriptions__root__tabContent___DnbmQ{padding:1rem 0 0;display:flex;flex-direction:column;gap:1.5rem}.-cc-esm-active-prescriptions__root__fieldGroup___3aiba{display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__helperText___sr2T2{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252);margin:0}.-cc-esm-active-prescriptions__root__ordersList___jcCvy{border:1px solid var(--cds-border-subtle, #e0e0e0);border-radius:.25rem;padding:.75rem;display:flex;flex-direction:column;gap:.5rem;background-color:var(--cds-layer, #ffffff)}.-cc-esm-active-prescriptions__root__orderLabel___3oBY3{display:flex;flex-direction:column;align-items:flex-start;gap:.125rem}.-cc-esm-active-prescriptions__root__orderName___QGKUy{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);font-weight:600}.-cc-esm-active-prescriptions__root__orderMeta___S7cGO{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252)}.-cc-esm-active-prescriptions__root__selectionSummary___TD9ka{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252);margin:.25rem 0 0}.-cc-esm-active-prescriptions__root__medicationsList___sxtXB{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__medicationItem___YlIOL{display:flex;align-items:center;gap:.5rem;padding:.5rem;background-color:var(--cds-layer, #ffffff);border:1px solid var(--cds-border-subtle, #e0e0e0);border-radius:.25rem}.-cc-esm-active-prescriptions__root__medicationItem___YlIOL span{flex:1;font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px)}.-cc-esm-active-prescriptions__root__overlayBackdrop___SX20r{position:fixed;inset:0;background-color:rgba(0,0,0,.5);z-index:9000;display:flex;align-items:center;justify-content:center}.-cc-esm-active-prescriptions__root__overlayPanel___C1FVo{background-color:var(--cds-layer, #ffffff);border-radius:.25rem;box-shadow:0 8px 32px rgba(0,0,0,.24);width:100%;max-width:520px;max-height:90vh;overflow-y:auto;padding:2rem;display:flex;flex-direction:column;gap:1rem}.-cc-esm-active-prescriptions__root__overlayPanel___C1FVo h3{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);margin:0}","",{version:3,sources:["webpack://./src/root.scss","webpack://./node_modules/@carbon/layout/scss/generated/_spacing.scss","webpack://./node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAGA,wDACE,YCqCW,CDpCX,YAAA,CACA,qBAAA,CACA,UC6BW,CD5BX,0CAAA,CACA,eAAA,CAGF,oDACE,YAAA,CACA,qBAAA,CACA,SCMW,CDHb,sDEg1BI,gDAAA,CAAA,+CAAA,CAAA,mDAAA,CAAA,wDAAA,CF90BF,wCAAA,CACA,QAAA,CACA,eAAA,CAGF,qDACE,iDAAA,CACA,YCIW,CDHX,oBCZW,CDaX,oCAAA,CAGF,wDEk0BI,2DAAA,CAAA,0DAAA,CAAA,8DAAA,CAAA,mEAAA,CFh0BF,mBCbW,CDgBb,wDACE,gBAAA,CACA,YAAA,CACA,qBAAA,CACA,UCLW,CDQb,wDACE,YAAA,CACA,qBAAA,CACA,SC1BW,CD6Bb,wDEgzBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF9yBF,wCAAA,CACA,QAAA,CAGF,wDACE,kDAAA,CACA,oBC1CW,CD2CX,cCjCW,CDkCX,YAAA,CACA,qBAAA,CACA,SCzCW,CD0CX,0CAAA,CAGF,wDACE,YAAA,CACA,qBAAA,CACA,sBAAA,CACA,WC3DW,CD8Db,uDEyxBI,wDAAA,CAAA,uDAAA,CAAA,2DAAA,CAAA,gEAAA,CFvxBF,eAAA,CAGF,uDEoxBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CFlxBF,wCAAA,CAGF,8DE+wBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF7wBF,wCAAA,CACA,iBAAA,CAGF,6DACE,eAAA,CACA,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CACA,SC1EW,CD6Eb,4DACE,YAAA,CACA,kBAAA,CACA,SChFW,CDiFX,aCjFW,CDkFX,0CAAA,CACA,kDAAA,CACA,oBCzFW,CD2FX,iEACE,MAAA,CEsvBA,wDAAA,CAAA,uDAAA,CAAA,2DAAA,CAAA,gEAAA,CFjvBJ,6DACE,cAAA,CACA,OAAA,CACA,+BAAA,CACA,YAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CAGF,0DACE,0CAAA,CACA,oBC7GW,CD8GX,qCAAA,CACA,UAAA,CACA,eAAA,CACA,eAAA,CACA,eAAA,CACA,YC1FW,CD2FX,YAAA,CACA,qBAAA,CACA,QCvGW,CDyGX,6DE0tBE,kDAAA,CAAA,kDAAA,CAAA,kDAAA,CAAA,sDAAA,CFxtBA,QAAA",sourcesContent:["@use '@carbon/layout';\n@use '@carbon/type';\n\n.workspace {\n padding: layout.$spacing-07;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-06;\n background-color: var(--cds-layer, #ffffff);\n min-height: 100%;\n}\n\n.header {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.subtitle {\n @include type.type-style('body-01');\n color: var(--cds-text-secondary, #525252);\n margin: 0;\n max-width: 48rem;\n}\n\n.section {\n background-color: var(--cds-layer-accent, #f4f4f4);\n padding: layout.$spacing-05;\n border-radius: layout.$spacing-02;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n}\n\n.fieldLabel {\n @include type.type-style('heading-compact-01');\n margin-bottom: layout.$spacing-03;\n}\n\n.tabContent {\n padding: layout.$spacing-05 0 0;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-06;\n}\n\n.fieldGroup {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.helperText {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n margin: 0;\n}\n\n.ordersList {\n border: 1px solid var(--cds-border-subtle, #e0e0e0);\n border-radius: layout.$spacing-02;\n padding: layout.$spacing-04;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n background-color: var(--cds-layer, #ffffff);\n}\n\n.orderLabel {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: layout.$spacing-01;\n}\n\n.orderName {\n @include type.type-style('body-compact-01');\n font-weight: 600;\n}\n\n.orderMeta {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n}\n\n.selectionSummary {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n margin: layout.$spacing-02 0 0;\n}\n\n.medicationsList {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.medicationItem {\n display: flex;\n align-items: center;\n gap: layout.$spacing-03;\n padding: layout.$spacing-03;\n background-color: var(--cds-layer, #ffffff);\n border: 1px solid var(--cds-border-subtle, #e0e0e0);\n border-radius: layout.$spacing-02;\n\n span {\n flex: 1;\n @include type.type-style('body-compact-01');\n }\n}\n\n.overlayBackdrop {\n position: fixed;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 9000;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.overlayPanel {\n background-color: var(--cds-layer, #ffffff);\n border-radius: layout.$spacing-02;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);\n width: 100%;\n max-width: 520px;\n max-height: 90vh;\n overflow-y: auto;\n padding: layout.$spacing-07;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-05;\n\n h3 {\n @include type.type-style('heading-03');\n margin: 0;\n }\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n","//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.4,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('regular'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n font-weight: font-family.font-weight('light'),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n caption-01: $caption-01,\n caption-02: $caption-02,\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n) !default;\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO: move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),r.locals={workspace:"-cc-esm-active-prescriptions__root__workspace___+xqk5",header:"-cc-esm-active-prescriptions__root__header___G1X3T",subtitle:"-cc-esm-active-prescriptions__root__subtitle___kRieu",section:"-cc-esm-active-prescriptions__root__section___61mCr",fieldLabel:"-cc-esm-active-prescriptions__root__fieldLabel___F2zAd",tabContent:"-cc-esm-active-prescriptions__root__tabContent___DnbmQ",fieldGroup:"-cc-esm-active-prescriptions__root__fieldGroup___3aiba",helperText:"-cc-esm-active-prescriptions__root__helperText___sr2T2",ordersList:"-cc-esm-active-prescriptions__root__ordersList___jcCvy",orderLabel:"-cc-esm-active-prescriptions__root__orderLabel___3oBY3",orderName:"-cc-esm-active-prescriptions__root__orderName___QGKUy",orderMeta:"-cc-esm-active-prescriptions__root__orderMeta___S7cGO",selectionSummary:"-cc-esm-active-prescriptions__root__selectionSummary___TD9ka",medicationsList:"-cc-esm-active-prescriptions__root__medicationsList___sxtXB",medicationItem:"-cc-esm-active-prescriptions__root__medicationItem___YlIOL",overlayBackdrop:"-cc-esm-active-prescriptions__root__overlayBackdrop___SX20r",overlayPanel:"-cc-esm-active-prescriptions__root__overlayPanel___C1FVo"};const l=r},1063(e,n,t){t.r(n),t.d(n,{default:()=>F});var a=t(6072);function i(e,n,t,a,i,o,r){try{var l=e[o](r),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(a,i)}function o(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var r=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t;return n=e,t=[{key:"createPrescription",value:function(e){return(n=function(){return function(e,n){var t,a,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(r,"next",{value:s(0)}),l(r,"throw",{value:s(1)}),l(r,"return",{value:s(2)}),"function"==typeof Symbol&&l(r,Symbol.iterator,{value:function(){return this}}),r;function s(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,l[0]&&(o=0)),o;)try{if(t=1,a&&(i=2&l[0]?a.return:l[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;switch(a=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,a=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=n.call(e,o)}catch(e){l=[6,e],a=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,function(n){return[2,fetch("/api/prescriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})]})},function(){var e=this,t=arguments;return new Promise(function(a,o){var r=n.apply(e,t);function l(e){i(r,a,o,l,s,"next",e)}function s(e){i(r,a,o,l,s,"throw",e)}l(void 0)})})();var n}}],null&&o(n.prototype,null),t&&o(n,t),e}(),l=t(7224),s=t(3323),c=t(2076),p=t(5072),u=t.n(p),d=t(7825),f=t.n(d),g=t(7659),y=t.n(g),h=t(5056),m=t.n(h),b=t(540),v=t.n(b),A=t(1113),$=t.n(A),_=t(6052),C={};C.styleTagTransform=$(),C.setAttributes=m(),C.insert=y().bind(null,"head"),C.domAPI=f(),C.insertStyleElement=v(),u()(_.A,C);const x=_.A&&_.A.locals?_.A.locals:void 0;var w=t(9324);function k(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function z(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function E(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,o=[],r=!0,l=!1;try{for(t=t.call(e);!(r=(a=t.next()).done)&&(o.push(a.value),!n||o.length!==n);r=!0);}catch(e){l=!0,i=e}finally{try{r||null==t.return||t.return()}finally{if(l)throw i}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return k(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?k(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=[{value:"mg"},{value:"ml"},{value:"g"},{value:"mcg"},{value:"comprimido(s)"}],M=[{value:"Oral"},{value:"Intravenoso (IV)"},{value:"Intramuscular (IM)"},{value:"Subcutâneo (SC)"},{value:"Tópico"},{value:"Inalatório"},{value:"Sublingual"}],D=[{value:"1x ao dia"},{value:"2x ao dia"},{value:"3x ao dia"},{value:"4x ao dia"},{value:"6/6h"},{value:"8/8h"},{value:"12/12h"},{value:"Se necessário"}];const T=function(e){var n,t,i,o,r,p,u,d,f,g,y,h,m,b,v=e.initialData,A=e.onSave,$=e.onCancel,_=(0,c.useTranslation)().t,C=E((0,a.useState)(null!==(n=null==v||null===(b=v.drug)||void 0===b?void 0:b.name)&&void 0!==n?n:""),2),x=C[0],k=C[1],T=E((0,a.useState)(null!==(t=null==v?void 0:v.drug)&&void 0!==t?t:null),2),I=T[0],N=T[1],B=E((0,a.useState)(null!==(i=null==v?void 0:v.dosage)&&void 0!==i?i:""),2),P=B[0],F=B[1],L=E((0,a.useState)(null!==(o=null==v?void 0:v.unit)&&void 0!==o?o:""),2),O=L[0],q=L[1],j=E((0,a.useState)(null!==(r=null==v?void 0:v.route)&&void 0!==r?r:""),2),G=j[0],W=j[1],Y=E((0,a.useState)(null!==(p=null==v?void 0:v.frequency)&&void 0!==p?p:""),2),U=Y[0],X=Y[1],K=E((0,a.useState)(null!==(u=null==v?void 0:v.patientInstructions)&&void 0!==u?u:""),2),Q=K[0],R=K[1],V=E((0,a.useState)(null!==(d=null==v?void 0:v.asNeeded)&&void 0!==d&&d),2),H=V[0],J=V[1],Z=E((0,a.useState)(null!==(f=null==v?void 0:v.asNeededCondition)&&void 0!==f?f:""),2),ee=Z[0],ne=Z[1],te=E((0,a.useState)(null!==(g=null==v?void 0:v.indication)&&void 0!==g?g:""),2),ae=te[0],ie=te[1],oe=function(e){var n,t,a=(null==e?void 0:e.length)>=3?"".concat(l.restBaseUrl,"/drug?q=").concat(encodeURIComponent(e),"&v=custom:(uuid,name,display)&limit=10"):null,i=(0,w.Ay)(a,l.openmrsFetch),o=i.data,r=i.isValidating;return{drugs:null!==(n=null==o||null===(t=o.data)||void 0===t?void 0:t.results)&&void 0!==n?n:[],isLoading:r}}(x),re=oe.drugs,le=oe.isLoading;return a.createElement("form",{onSubmit:function(e){e.preventDefault(),I&&P&&O&&U&&A({drug:I,dosage:P,unit:O,route:G,frequency:U,patientInstructions:Q||void 0,asNeeded:H,asNeededCondition:H&&ee||void 0,indication:ae||void 0})},style:{display:"flex",flexDirection:"column",gap:"1rem"}},a.createElement(s.a32,{id:"drug-search",titleText:_("drugName","Medicamento"),placeholder:_("drugSearchPlaceholder","Digite para buscar (mín. 3 letras)..."),items:re.map(function(e){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.forEach(function(n){z(e,n,t[n])})}return e}({id:e.uuid,label:e.display||e.name},e)}),itemToString:function(e){var n;return null!==(n=null==e?void 0:e.label)&&void 0!==n?n:""},selectedItem:I?{id:I.uuid,label:I.display}:null,onInputChange:function(e){k(e),e||N(null)},onChange:function(e){var n,t=e.selectedItem;t&&N({uuid:t.uuid,name:t.name,display:null!==(n=t.display)&&void 0!==n?n:t.name})},disabled:le,helperText:le?_("searching","Buscando..."):void 0}),a.createElement(s.ksK,{id:"dosage",labelText:_("dosage","Dose"),value:P,onChange:function(e){return F(e.target.value)},required:!0}),a.createElement(s.a32,{id:"unit",titleText:_("unit","Unidade"),items:S,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(y=S.find(function(e){return e.value===O}))&&void 0!==y?y:null,onChange:function(e){var n,t=e.selectedItem;return q(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(s.a32,{id:"route",titleText:_("route","Via de administração"),items:M,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(h=M.find(function(e){return e.value===G}))&&void 0!==h?h:null,onChange:function(e){var n,t=e.selectedItem;return W(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(s.a32,{id:"frequency",titleText:_("frequency","Frequência"),items:D,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(m=D.find(function(e){return e.value===U}))&&void 0!==m?m:null,onChange:function(e){var n,t=e.selectedItem;return X(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(s.ksK,{id:"patient-instructions",labelText:_("patientInstructions","Instruções ao paciente"),value:Q,onChange:function(e){return R(e.target.value)}}),a.createElement(s.Sc0,{id:"as-needed",labelText:_("asNeeded","Tomar se necessário (P.R.N.)"),checked:H,onChange:function(e,n){var t=n.checked;return J(t)}}),H&&a.createElement(s.ksK,{id:"as-needed-condition",labelText:_("asNeededCondition","Motivo P.R.N."),value:ee,onChange:function(e){return ne(e.target.value)}}),a.createElement(s.ksK,{id:"indication",labelText:_("indication","Indicação"),value:ae,onChange:function(e){return ie(e.target.value)}}),a.createElement("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"}},a.createElement(s.$nd,{type:"submit",kind:"primary",disabled:!(I&&P&&O&&U)},_("saveMedication","Salvar medicamento")),a.createElement(s.$nd,{type:"button",kind:"secondary",onClick:$},_("cancel","Cancelar"))))};function I(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function N(e,n,t,a,i,o,r){try{var l=e[o](r),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(a,i)}function B(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,o=[],r=!0,l=!1;try{for(t=t.call(e);!(r=(a=t.next()).done)&&(o.push(a.value),!n||o.length!==n);r=!0);}catch(e){l=!0,i=e}finally{try{r||null==t.return||t.return()}finally{if(l)throw i}}return o}}(e,n)||P(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,n){if(e){if("string"==typeof e)return I(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?I(e,n):void 0}}const F=function(e){var n=e.patientUuid,t=e.patient,i=(0,c.useTranslation)().t,o=B((0,a.useState)("new"),2),p=o[0],u=o[1],d=B((0,a.useState)(null),2),f=d[0],g=d[1],y=B((0,a.useState)(""),2),h=y[0],m=y[1],b=B((0,a.useState)(!1),2),v=b[0],A=b[1],$=B((0,a.useState)(!1),2),_=$[0],C=$[1],w=B((0,a.useState)(""),2),k=w[0],z=w[1],E=B((0,a.useState)(!1),2),S=E[0],M=E[1],D=B((0,a.useState)(null),2),F=D[0],L=D[1],O=B((0,a.useState)([]),2),q=O[0],j=O[1],G=B((0,a.useState)(!1),2),W=G[0],Y=G[1],U=B((0,a.useState)(null),2),X=U[0],K=U[1],Q=(0,l.useLocations)(),R=(0,a.useMemo)(function(){return null!=Q?Q:[]},[Q]);return a.createElement(l.Workspace2,{title:i("activePrescriptionsWorkspaceTitle","Prescrições ativas"),hasUnsavedChanges:!1},a.createElement("div",{className:x.workspace},a.createElement("div",{className:x.header},a.createElement("h2",null,i("activePrescriptionsWorkspaceTitle","Prescrições ativas")),a.createElement("p",{className:x.subtitle},i("activePrescriptionsHelper","Revise o contexto do paciente, escolha os detalhes da visita e adicione os medicamentos à prescrição."))),a.createElement("section",{className:x.section},a.createElement("p",{className:x.fieldLabel},i("visitTimingLabel","A visita é")),a.createElement(s.tUM,{selectedIndex:"new"===p?0:1,onChange:function(e){var n=e.selectedIndex;return u(0===n?"new":"past")}},a.createElement(s.wbY,{"aria-label":i("visitTimingLabel","A visita é")},a.createElement(s.ozo,null,i("visitTimingNew","Nova")),a.createElement(s.ozo,null,i("visitTimingPast","No passado"))),a.createElement(s.T2N,null,a.createElement(s.KpK,{className:x.tabContent},a.createElement("div",{className:x.fieldGroup},a.createElement(s.a32,{id:"visit-location",items:R,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.display)&&void 0!==n?n:""},selectedItem:f,onChange:function(e){var n=e.selectedItem;return g(null!=n?n:null)},placeholder:i("visitLocationPlaceholder","Selecione o local"),titleText:i("visitLocationHeading","Local da visita"),helperText:i("visitLocationHelper","Selecione onde a visita ocorrerá.")})),a.createElement("div",{className:x.fieldGroup},a.createElement(s.ksK,{id:"insurance-policy",labelText:i("insurancePolicyNumberLabel","Número da apólice (opcional)"),placeholder:i("insurancePolicyNumberPlaceholder","Digite o número da apólice"),value:h,onChange:function(e){return m(e.target.value)}})),a.createElement("div",{className:x.fieldGroup},a.createElement(s.Sc0,{id:"sign-prescription-checkbox",labelText:i("signPrescriptionLabel","Assinar digitalmente a prescrição"),checked:v,onChange:function(e,n){var t=n.checked;return A(t)}}),a.createElement(s.Sc0,{id:"print-prescription-checkbox",labelText:i("printPrescriptionLabel","Imprimir a prescrição"),checked:_,onChange:function(e,n){var t=n.checked;return C(t)}})),a.createElement("div",{className:x.fieldGroup},a.createElement(s.fs1,{id:"observations",labelText:i("observations","Observações"),placeholder:i("observationsPlaceholder","Observações da prescrição..."),value:k,onChange:function(e){return z(e.target.value)},rows:3})),a.createElement("div",{className:x.fieldGroup},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},a.createElement("h3",{style:{margin:0}},i("medicationsList","Medicamentos")),a.createElement(s.$nd,{size:"sm",hasIconOnly:!0,kind:"ghost",renderIcon:function(){return a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M16 6V26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),a.createElement("path",{d:"M6 16H26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))},iconDescription:i("addMedication","Adicionar medicamento"),onClick:function(){K(null),Y(!0)}})),0===q.length?a.createElement("p",null,i("noMedicationsAdded","Nenhum medicamento adicionado ainda.")):a.createElement("ul",{className:x.medicationsList},q.map(function(e,n){return a.createElement("li",{key:n,className:x.medicationItem},a.createElement("span",null,a.createElement("b",null,e.drug.display)," — ",e.dosage," ",e.unit,e.route?" · ".concat(e.route):""," · ",e.frequency),a.createElement(s.$nd,{size:"sm",kind:"ghost",onClick:function(){return function(e){K(e),Y(!0)}(n)}},i("edit","Editar")),a.createElement(s.$nd,{size:"sm",kind:"danger--ghost",onClick:function(){return function(e){j(function(n){return n.filter(function(n,t){return t!==e})})}(n)}},i("remove","Remover")))}))),W&&a.createElement("div",{className:x.overlayBackdrop,onClick:function(e){e.target===e.currentTarget&&(Y(!1),K(null))}},a.createElement("div",{className:x.overlayPanel},a.createElement("h3",null,null!==X?i("editMedication","Editar medicamento"):i("addMedication","Adicionar medicamento")),a.createElement(T,{initialData:null!==X?q[X]:void 0,onSave:function(e){null!==X?(j(function(n){return n.map(function(n,t){return t===X?e:n})}),K(null)):j(function(n){return(t=n,function(e){if(Array.isArray(e))return I(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e]);var t}),Y(!1)},onCancel:function(){Y(!1),K(null)}}))),F&&a.createElement(s.jeF,{lowContrast:!0,kind:"error",title:i("submitError","Erro ao salvar a prescrição."),subtitle:F,onCloseButtonClick:function(){return L(null)}}),a.createElement("div",{style:{display:"flex",gap:8,marginTop:16}},a.createElement(s.$nd,{kind:"primary",disabled:!n||!f||0===q.length||S,onClick:function(){return(e=function(){var e,a,o,l,s,c,p;return function(e,n){var t,a,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(r,"next",{value:s(0)}),l(r,"throw",{value:s(1)}),l(r,"return",{value:s(2)}),"function"==typeof Symbol&&l(r,Symbol.iterator,{value:function(){return this}}),r;function s(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,l[0]&&(o=0)),o;)try{if(t=1,a&&(i=2&l[0]?a.return:l[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;switch(a=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,a=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=n.call(e,o)}catch(e){l=[6,e],a=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,function(u){switch(u.label){case 0:if(!n||!f||0===q.length)return[2];M(!0),L(null),u.label=1;case 1:return u.trys.push([1,3,4,5]),s={patientUuid:n,patientName:(null==t||null===(o=t.name)||void 0===o?void 0:o[0])?"".concat(null===(l=t.name[0].given)||void 0===l?void 0:l.join(" ")," ").concat(t.name[0].family).trim():"",patientBirthDate:null!==(e=null==t?void 0:t.birthDate)&&void 0!==e?e:"",patientGender:null!==(a=null==t?void 0:t.gender)&&void 0!==a?a:"",providerUuid:"",providerName:"",locationUuid:f.uuid,locationName:f.display,policyNumber:h,orderUuids:q.map(function(e){return e.drug.uuid}),digitallySigned:v,printRequested:_,observations:k},[4,r.createPrescription(s)];case 2:return u.sent(),j([]),g(null),m(""),A(!1),C(!1),z(""),[3,5];case 3:return c=u.sent(),L(null!==(p=null==c?void 0:c.message)&&void 0!==p?p:i("submitError","Erro ao salvar a prescrição.")),[3,5];case 4:return M(!1),[7];case 5:return[2]}})},function(){var n=this,t=arguments;return new Promise(function(a,i){var o=e.apply(n,t);function r(e){N(o,a,i,r,l,"next",e)}function l(e){N(o,a,i,r,l,"throw",e)}r(void 0)})})();var e}},S?a.createElement(s.OuH,{description:i("saving","Salvando...")}):i("createPrescriptionButtonLabel","Salvar Prescrição")))),a.createElement(s.KpK,{className:x.tabContent},a.createElement(s.jeF,{lowContrast:!0,kind:"info",title:i("inPastTabPlaceholderTitle","Receitas históricas em breve"),subtitle:i("inPastTabPlaceholderSubtitle","Volte para Nova para gerenciar medicamentos atuais.")})))))))}},8493(e,n,t){var a=t(6072),i="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},o=a.useState,r=a.useEffect,l=a.useLayoutEffect,s=a.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!i(e,t)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),a=o({inst:{value:t,getSnapshot:n}}),i=a[0].inst,p=a[1];return l(function(){i.value=t,i.getSnapshot=n,c(i)&&p({inst:i})},[e,t,n]),r(function(){return c(i)&&p({inst:i}),e(function(){c(i)&&p({inst:i})})},[e]),s(t),t};n.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:p},9888(e,n,t){e.exports=t(8493)}}]);
|
|
File without changes
|