@bahmni/clinical-app 0.0.1-dev.106 → 0.0.1-dev.108
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/FormsTable-BhgvFijg-DpVuvYKa.js +318 -0
- package/dist/{LNWAZHJI-D6If__2Q.js → LNWAZHJI-CSzbmhBu.js} +5 -5
- package/dist/{MWZ6AO7Z-CQ9Hlb01.js → MWZ6AO7Z-BHBRGSOE.js} +7 -7
- package/dist/{YPM2AS64-lJoMtftK.js → YPM2AS64--kUlzXUl.js} +1 -1
- package/dist/components/consultationPad/ConsultationPad.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationForms.d.ts.map +1 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts +2 -1
- package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
- package/dist/constants/forms.d.ts +7 -0
- package/dist/constants/forms.d.ts.map +1 -1
- package/dist/{index-C_onZcPP.js → index-jQa2f6J7.js} +7744 -7699
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/locales/locale_en.json +12 -3
- package/dist/locales/locale_es.json +12 -3
- package/dist/stores/observationFormsStore.d.ts +4 -2
- package/dist/stores/observationFormsStore.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/FormsTable-C7PUueUt-BJlenAuA.js +0 -259
package/dist/index.js
CHANGED
|
@@ -217,17 +217,26 @@
|
|
|
217
217
|
"OBSERVATION_FORMS_ERROR_LOADING_FORMS": "Error loading forms. Please try again later.",
|
|
218
218
|
"OBSERVATION_FORMS_FORM_ALREADY_ADDED": "Already added",
|
|
219
219
|
"OBSERVATION_FORMS_LOADING_FORMS": "Loading forms...",
|
|
220
|
+
"OBSERVATION_FORMS_MANDATORY_ERROR_MESSAGE": "Please fix errors in observation forms before submitting the consultation.",
|
|
221
|
+
"OBSERVATION_FORMS_MANDATORY_ERROR_TITLE": "Observation Forms Have Errors.",
|
|
220
222
|
"OBSERVATION_FORMS_NO_FORMS_FOUND": "No matching forms found",
|
|
221
223
|
"OBSERVATION_FORMS_SEARCH_ARIA_LABEL": "Search for observation forms",
|
|
222
224
|
"OBSERVATION_FORMS_SEARCH_PLACEHOLDER": "Search to add observation form",
|
|
223
225
|
"OBSERVATION_FORMS_SECTION_TITLE": "Observation Forms",
|
|
224
|
-
"
|
|
226
|
+
"OBSERVATION_FORM_CONTINUE_ANYWAY_BUTTON": "Continue Anyway",
|
|
225
227
|
"OBSERVATION_FORM_DISCARD_BUTTON": "Discard Form",
|
|
226
228
|
"OBSERVATION_FORM_LOADING_METADATA": "Loading form's metadata...",
|
|
227
229
|
"OBSERVATION_FORM_LOADING_METADATA_ERROR": "Error loading form metadata",
|
|
228
230
|
"OBSERVATION_FORM_SAVE_BUTTON": "Save Form",
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_SUBTITLE_EMPTY": "Please fill in some data before saving.",
|
|
232
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_SUBTITLE_INVALID": "Please fill in the fields with valid data.",
|
|
233
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_SUBTITLE_MANDATORY": "Please fill in all required fields before saving.",
|
|
234
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_TITLE_EMPTY": "The form is empty.",
|
|
235
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_TITLE_INVALID": "Invalid data entry:",
|
|
236
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_TITLE_MANDATORY": "Some required fields are missing.",
|
|
237
|
+
"OBSERVATION_ADDED_FORM_VALIDATION_ERROR_TITLE_INVALID": "Invalid data entry",
|
|
238
|
+
"OBSERVATION_ADDED_FORM_VALIDATION_ERROR_TITLE_MANDATORY": "Required fields missing",
|
|
239
|
+
"OBSERVATION_ADDED_FORM_VALIDATION_ERROR_TITLE_EMPTY": "No data filled",
|
|
231
240
|
"PARTICIPANT": "Participant(s)",
|
|
232
241
|
"PATIENT_HEADER_LABEL": "Patient Header",
|
|
233
242
|
"PINNED_FORMS_INVALID_DATA": "Invalid pinned forms data",
|
|
@@ -217,17 +217,26 @@
|
|
|
217
217
|
"OBSERVATION_FORMS_ERROR_LOADING_FORMS": "Error al cargar formularios. Por favor, inténtelo de nuevo más tarde.",
|
|
218
218
|
"OBSERVATION_FORMS_FORM_ALREADY_ADDED": "Ya agregado",
|
|
219
219
|
"OBSERVATION_FORMS_LOADING_FORMS": "Cargando formularios...",
|
|
220
|
+
"OBSERVATION_FORMS_MANDATORY_ERROR_MESSAGE": "Por favor corrija los errores en los formularios de observación antes de enviar la consulta.",
|
|
221
|
+
"OBSERVATION_FORMS_MANDATORY_ERROR_TITLE": "Los Formularios de Observación Tienen Errores",
|
|
220
222
|
"OBSERVATION_FORMS_NO_FORMS_FOUND": "No se encontraron formularios coincidentes",
|
|
221
223
|
"OBSERVATION_FORMS_SEARCH_ARIA_LABEL": "Buscar formularios de observación",
|
|
222
224
|
"OBSERVATION_FORMS_SEARCH_PLACEHOLDER": "Buscar para agregar formulario de observación",
|
|
223
225
|
"OBSERVATION_FORMS_SECTION_TITLE": "Formularios de Observación",
|
|
224
|
-
"
|
|
226
|
+
"OBSERVATION_FORM_CONTINUE_ANYWAY_BUTTON": "Continuar de todos modos",
|
|
225
227
|
"OBSERVATION_FORM_DISCARD_BUTTON": "Descartar Formulario",
|
|
226
228
|
"OBSERVATION_FORM_LOADING_METADATA": "Cargando los metadatos del formulario...",
|
|
227
229
|
"OBSERVATION_FORM_LOADING_METADATA_ERROR": "Error al cargar los metadatos del formulario",
|
|
228
230
|
"OBSERVATION_FORM_SAVE_BUTTON": "Guardar Formulario",
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_SUBTITLE_EMPTY": "Por favor complete algunos datos antes de guardar.",
|
|
232
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_SUBTITLE_INVALID": "Por favor complete los campos con datos válidos.",
|
|
233
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_SUBTITLE_MANDATORY": "Por favor complete todos los campos obligatorios antes de guardar.",
|
|
234
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_TITLE_EMPTY": "No se han completado datos.",
|
|
235
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_TITLE_INVALID": "Entrada de datos inválida.",
|
|
236
|
+
"OBSERVATION_FORM_VALIDATION_ERROR_TITLE_MANDATORY": "Faltan campos obligatorios",
|
|
237
|
+
"OBSERVATION_ADDED_FORM_VALIDATION_ERROR_TITLE_INVALID": "Entrada de datos inválida",
|
|
238
|
+
"OBSERVATION_ADDED_FORM_VALIDATION_ERROR_TITLE_MANDATORY": "Faltan campos obligatorios",
|
|
239
|
+
"OBSERVATION_ADDED_FORM_VALIDATION_ERROR_TITLE_EMPTY": "No se han introducido datos",
|
|
231
240
|
"PARTICIPANT": "Partícipe(es)",
|
|
232
241
|
"PATIENT_HEADER_LABEL": "Cabecera del Paciente",
|
|
233
242
|
"PINNED_FORMS_INVALID_DATA": "Datos de formularios anclados no válidos",
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ObservationForm, Form2Observation } from '@bahmni/services';
|
|
2
|
+
import { VALIDATION_STATE_EMPTY, VALIDATION_STATE_MANDATORY, VALIDATION_STATE_INVALID } from '../constants/forms';
|
|
2
3
|
export interface ObservationFormData {
|
|
3
4
|
formUuid: string;
|
|
4
5
|
formName: string;
|
|
5
6
|
observations: Form2Observation[];
|
|
6
7
|
timestamp: number;
|
|
8
|
+
validationState?: null | typeof VALIDATION_STATE_EMPTY | typeof VALIDATION_STATE_MANDATORY | typeof VALIDATION_STATE_INVALID;
|
|
7
9
|
}
|
|
8
10
|
export interface ObservationFormsState {
|
|
9
11
|
selectedForms: ObservationForm[];
|
|
@@ -11,8 +13,8 @@ export interface ObservationFormsState {
|
|
|
11
13
|
viewingForm: ObservationForm | null;
|
|
12
14
|
addForm: (form: ObservationForm) => void;
|
|
13
15
|
removeForm: (formUuid: string) => void;
|
|
14
|
-
updateFormData: (formUuid: string, observations: Form2Observation[]) => void;
|
|
15
|
-
getFormData: (formUuid: string) =>
|
|
16
|
+
updateFormData: (formUuid: string, observations: Form2Observation[], validationState?: null | typeof VALIDATION_STATE_EMPTY | typeof VALIDATION_STATE_MANDATORY | typeof VALIDATION_STATE_INVALID) => void;
|
|
17
|
+
getFormData: (formUuid: string) => ObservationFormData | undefined;
|
|
16
18
|
setViewingForm: (form: ObservationForm | null) => void;
|
|
17
19
|
getAllObservations: () => Form2Observation[];
|
|
18
20
|
getObservationFormsData: () => Record<string, Form2Observation[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observationFormsStore.d.ts","sourceRoot":"","sources":["../../src/stores/observationFormsStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"observationFormsStore.d.ts","sourceRoot":"","sources":["../../src/stores/observationFormsStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EACZ,IAAI,GACJ,OAAO,sBAAsB,GAC7B,OAAO,0BAA0B,GACjC,OAAO,wBAAwB,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC/C,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,gBAAgB,EAAE,EAChC,eAAe,CAAC,EACZ,IAAI,GACJ,OAAO,sBAAsB,GAC7B,OAAO,0BAA0B,GACjC,OAAO,wBAAwB,KAChC,IAAI,CAAC;IACV,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,mBAAmB,GAAG,SAAS,CAAC;IACnE,cAAc,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,kBAAkB,EAAE,MAAM,gBAAgB,EAAE,CAAC;IAC7C,uBAAuB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClE,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;CACvC;AAUD,eAAO,MAAM,wBAAwB,oFAwJpC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as _, Fragment as K } from "react/jsx-runtime";
|
|
2
|
-
import { u as Q, C as J, a as p, b as X, V as z, Q as I, A as Y, _ as W, l as Z, E as ee, t as S, G as re, e as ae, X as oe, c as ne, J as te } from "./index-C_onZcPP.js";
|
|
3
|
-
import { useState as U, useMemo as u, useCallback as f } from "react";
|
|
4
|
-
import { createPortal as se } from "react-dom";
|
|
5
|
-
const de = "_formsTableBody_ua0cn_1", me = "_customAccordianItem_ua0cn_6", ie = "_formContent_ua0cn_18", ce = "_formDetailsContainer_ua0cn_25", le = "_observation_ua0cn_30", ue = "_groupContainer_ua0cn_39", _e = "_rowContainer_ua0cn_43", be = "_groupLabel_ua0cn_48", pe = "_rowLabel_ua0cn_58", fe = "_rowValue_ua0cn_67", he = "_groupMembers_ua0cn_75", Ne = "_memberRow_ua0cn_81", ge = "_memberLabel_ua0cn_86", ye = "_memberValue_ua0cn_94", ve = "_commentSection_ua0cn_102", Me = "_commentText_ua0cn_108", Ce = "_nestedGroup_ua0cn_117", Le = "_nestedGroupLabel_ua0cn_124", Ae = "_nestedGroupMembers_ua0cn_133", o = {
|
|
6
|
-
formsTableBody: de,
|
|
7
|
-
customAccordianItem: me,
|
|
8
|
-
formContent: ie,
|
|
9
|
-
formDetailsContainer: ce,
|
|
10
|
-
observation: le,
|
|
11
|
-
groupContainer: ue,
|
|
12
|
-
rowContainer: _e,
|
|
13
|
-
groupLabel: be,
|
|
14
|
-
rowLabel: pe,
|
|
15
|
-
rowValue: fe,
|
|
16
|
-
groupMembers: he,
|
|
17
|
-
memberRow: Ne,
|
|
18
|
-
memberLabel: ge,
|
|
19
|
-
memberValue: ye,
|
|
20
|
-
commentSection: ve,
|
|
21
|
-
commentText: Me,
|
|
22
|
-
nestedGroup: Ce,
|
|
23
|
-
nestedGroupLabel: Le,
|
|
24
|
-
nestedGroupMembers: Ae
|
|
25
|
-
}, V = ({
|
|
26
|
-
member: r,
|
|
27
|
-
depth: m = 0
|
|
28
|
-
}) => {
|
|
29
|
-
const i = r.groupMembers && r.groupMembers.length > 0, n = r.conceptNameToDisplay ?? r.concept?.shortName ?? r.concept?.name;
|
|
30
|
-
return i ? /* @__PURE__ */ _("div", { className: o.nestedGroup, children: [
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
className: o.nestedGroupLabel,
|
|
35
|
-
style: { paddingLeft: `${m * 16}px` },
|
|
36
|
-
children: n
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */ e("div", { className: o.nestedGroupMembers, children: r.groupMembers?.map((c, b) => /* @__PURE__ */ e(
|
|
40
|
-
V,
|
|
41
|
-
{
|
|
42
|
-
member: c,
|
|
43
|
-
depth: m + 1
|
|
44
|
-
},
|
|
45
|
-
`${c.concept.uuid}`
|
|
46
|
-
)) })
|
|
47
|
-
] }) : /* @__PURE__ */ _(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: o.memberRow,
|
|
51
|
-
style: { paddingLeft: `${m * 16}px` },
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ e("p", { className: o.memberLabel, children: n }),
|
|
54
|
-
/* @__PURE__ */ e("p", { className: o.memberValue, children: r.valueAsString })
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}, Oe = ({
|
|
59
|
-
observation: r,
|
|
60
|
-
index: m
|
|
61
|
-
}) => {
|
|
62
|
-
const i = r.groupMembers && r.groupMembers.length > 0;
|
|
63
|
-
return /* @__PURE__ */ _(
|
|
64
|
-
"div",
|
|
65
|
-
{
|
|
66
|
-
className: o.observation,
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ _(
|
|
69
|
-
"div",
|
|
70
|
-
{
|
|
71
|
-
className: i ? o.groupContainer : o.rowContainer,
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ e("p", { className: i ? o.groupLabel : o.rowLabel, children: r.conceptNameToDisplay }),
|
|
74
|
-
i ? /* @__PURE__ */ e("div", { className: o.groupMembers, children: r.groupMembers?.map((n, c) => /* @__PURE__ */ e(
|
|
75
|
-
V,
|
|
76
|
-
{
|
|
77
|
-
member: n,
|
|
78
|
-
depth: 0
|
|
79
|
-
},
|
|
80
|
-
`${n.concept.uuid}`
|
|
81
|
-
)) }) : /* @__PURE__ */ e("p", { className: o.rowValue, children: r.valueAsString })
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
r.comment && /* @__PURE__ */ e("div", { className: o.commentSection, children: /* @__PURE__ */ _("span", { className: o.commentText, children: [
|
|
86
|
-
r.comment,
|
|
87
|
-
r.providers?.[0]?.name && ` - by ${r.providers[0].name}`
|
|
88
|
-
] }) })
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
`${r.concept.uuid}-${m}`
|
|
92
|
-
);
|
|
93
|
-
}, Ge = ({
|
|
94
|
-
episodeOfCareUuids: r,
|
|
95
|
-
encounterUuids: m,
|
|
96
|
-
config: i
|
|
97
|
-
}) => {
|
|
98
|
-
const { t: n } = Q(), c = J(), [b, v] = U(!1), [d, M] = U(null), $ = i?.numberOfVisits, {
|
|
99
|
-
data: h = [],
|
|
100
|
-
isLoading: C,
|
|
101
|
-
isError: L,
|
|
102
|
-
error: q
|
|
103
|
-
} = p({
|
|
104
|
-
queryKey: ["forms", c, r],
|
|
105
|
-
queryFn: () => ae(c, void 0, $),
|
|
106
|
-
enabled: !!c
|
|
107
|
-
}), A = u(() => !m || m.length === 0 ? h : h.filter(
|
|
108
|
-
(a) => m.includes(a.encounterUuid)
|
|
109
|
-
), [h, m]), { data: O = [] } = p({
|
|
110
|
-
queryKey: ["observationForms"],
|
|
111
|
-
queryFn: oe
|
|
112
|
-
}), R = f(
|
|
113
|
-
(a) => O.find((t) => t.name === a)?.uuid,
|
|
114
|
-
[O]
|
|
115
|
-
), N = u(() => {
|
|
116
|
-
if (d)
|
|
117
|
-
return R(d.formName);
|
|
118
|
-
}, [d, R]), {
|
|
119
|
-
data: Re,
|
|
120
|
-
isLoading: x,
|
|
121
|
-
error: T
|
|
122
|
-
} = p({
|
|
123
|
-
queryKey: ["formMetadata", N],
|
|
124
|
-
queryFn: () => ne(N),
|
|
125
|
-
enabled: !!N && b
|
|
126
|
-
}), {
|
|
127
|
-
data: g,
|
|
128
|
-
isLoading: k,
|
|
129
|
-
error: D
|
|
130
|
-
} = p({
|
|
131
|
-
queryKey: ["formsEncounter", d?.encounterUuid],
|
|
132
|
-
queryFn: () => te(d.encounterUuid, !0),
|
|
133
|
-
enabled: !!d?.encounterUuid && b
|
|
134
|
-
}), F = u(() => !g?.observations || !d?.formName ? [] : g.observations.filter(
|
|
135
|
-
(a) => "formFieldPath" in a && typeof a.formFieldPath == "string" && a.formFieldPath.includes(d.formName)
|
|
136
|
-
), [g?.observations, d?.formName]), E = u(
|
|
137
|
-
() => [
|
|
138
|
-
{ key: "recordedOn", header: n("FORM_RECORDED_ON") },
|
|
139
|
-
{ key: "recordedBy", header: n("FORM_RECORDED_BY") }
|
|
140
|
-
],
|
|
141
|
-
[n]
|
|
142
|
-
), H = u(
|
|
143
|
-
() => [
|
|
144
|
-
{ key: "recordedOn", sortable: !0 },
|
|
145
|
-
{ key: "recordedBy", sortable: !0 }
|
|
146
|
-
],
|
|
147
|
-
[]
|
|
148
|
-
), G = u(() => {
|
|
149
|
-
const a = A.reduce(
|
|
150
|
-
(t, s) => {
|
|
151
|
-
const l = s.formName;
|
|
152
|
-
t[l] ??= [];
|
|
153
|
-
const y = s.providers.map((P) => P.providerName).filter(Boolean).join(", ");
|
|
154
|
-
return t[l].push({
|
|
155
|
-
id: s.encounterUuid,
|
|
156
|
-
formName: s.formName,
|
|
157
|
-
recordedOn: X(s.encounterDateTime, n, re).formattedResult,
|
|
158
|
-
recordedBy: y ?? "--",
|
|
159
|
-
encounterDateTime: s.encounterDateTime,
|
|
160
|
-
encounterUuid: s.encounterUuid
|
|
161
|
-
}), t;
|
|
162
|
-
},
|
|
163
|
-
{}
|
|
164
|
-
);
|
|
165
|
-
return Object.entries(a).map(
|
|
166
|
-
([t, s]) => ({
|
|
167
|
-
formName: t,
|
|
168
|
-
records: s.sort(
|
|
169
|
-
(l, y) => y.encounterDateTime - l.encounterDateTime
|
|
170
|
-
)
|
|
171
|
-
})
|
|
172
|
-
).sort((t, s) => t.formName.localeCompare(s.formName));
|
|
173
|
-
}, [A, n]), w = f((a) => {
|
|
174
|
-
M(a), v(!0);
|
|
175
|
-
}, []), j = f(() => {
|
|
176
|
-
v(!1), M(null);
|
|
177
|
-
}, []), B = f(
|
|
178
|
-
(a, t) => {
|
|
179
|
-
switch (t) {
|
|
180
|
-
case "recordedOn":
|
|
181
|
-
return /* @__PURE__ */ e(z, { onClick: () => w(a), children: a.recordedOn });
|
|
182
|
-
case "recordedBy":
|
|
183
|
-
return a.recordedBy;
|
|
184
|
-
default:
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
[w]
|
|
189
|
-
);
|
|
190
|
-
return /* @__PURE__ */ _(K, { children: [
|
|
191
|
-
/* @__PURE__ */ e("div", { "data-testid": "forms-table", children: C || L || G.length === 0 ? /* @__PURE__ */ e(
|
|
192
|
-
I,
|
|
193
|
-
{
|
|
194
|
-
headers: E,
|
|
195
|
-
ariaLabel: n("FORMS_HEADING"),
|
|
196
|
-
rows: [],
|
|
197
|
-
loading: C,
|
|
198
|
-
errorStateMessage: L ? q?.message : void 0,
|
|
199
|
-
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
200
|
-
renderCell: B,
|
|
201
|
-
className: o.formsTableBody,
|
|
202
|
-
"data-testid": "sortable-data-table"
|
|
203
|
-
}
|
|
204
|
-
) : /* @__PURE__ */ e(Y, { align: "start", children: G.map((a, t) => {
|
|
205
|
-
const { formName: s, records: l } = a;
|
|
206
|
-
return /* @__PURE__ */ e(
|
|
207
|
-
W,
|
|
208
|
-
{
|
|
209
|
-
title: s,
|
|
210
|
-
className: o.customAccordianItem,
|
|
211
|
-
testId: "accordian-table-title",
|
|
212
|
-
open: t === 0,
|
|
213
|
-
children: /* @__PURE__ */ e(
|
|
214
|
-
I,
|
|
215
|
-
{
|
|
216
|
-
headers: E,
|
|
217
|
-
ariaLabel: n("FORMS_HEADING"),
|
|
218
|
-
rows: l,
|
|
219
|
-
loading: !1,
|
|
220
|
-
errorStateMessage: "",
|
|
221
|
-
sortable: H,
|
|
222
|
-
emptyStateMessage: n("FORMS_UNAVAILABLE"),
|
|
223
|
-
renderCell: B,
|
|
224
|
-
className: o.formsTableBody,
|
|
225
|
-
"data-testid": "sortable-data-table"
|
|
226
|
-
}
|
|
227
|
-
)
|
|
228
|
-
},
|
|
229
|
-
s
|
|
230
|
-
);
|
|
231
|
-
}) }) }),
|
|
232
|
-
b && d && se(
|
|
233
|
-
/* @__PURE__ */ e(
|
|
234
|
-
Z,
|
|
235
|
-
{
|
|
236
|
-
open: b,
|
|
237
|
-
onRequestClose: j,
|
|
238
|
-
modalHeading: d.formName,
|
|
239
|
-
modalLabel: `${d.recordedOn} | ${d.recordedBy}`,
|
|
240
|
-
passiveModal: !0,
|
|
241
|
-
size: "md",
|
|
242
|
-
testId: "form-details-modal",
|
|
243
|
-
children: /* @__PURE__ */ e("div", { className: o.formContent, children: x || k ? /* @__PURE__ */ e(ee, { width: "100%", lineCount: 3 }) : T ? /* @__PURE__ */ e("div", { children: S(T).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : D ? /* @__PURE__ */ e("div", { children: S(D).message ?? n("ERROR_FETCHING_FORM_DATA") }) : F.length > 0 ? /* @__PURE__ */ e("div", { className: o.formDetailsContainer, children: F.map((a, t) => /* @__PURE__ */ e(
|
|
244
|
-
Oe,
|
|
245
|
-
{
|
|
246
|
-
observation: a,
|
|
247
|
-
index: t
|
|
248
|
-
},
|
|
249
|
-
`${a.concept.uuid}`
|
|
250
|
-
)) }) : /* @__PURE__ */ e("div", { children: n("NO_FORM_DATA_AVAILABLE") }) })
|
|
251
|
-
}
|
|
252
|
-
),
|
|
253
|
-
document.getElementById("actionAreaLayout") ?? document.body
|
|
254
|
-
)
|
|
255
|
-
] });
|
|
256
|
-
};
|
|
257
|
-
export {
|
|
258
|
-
Ge as default
|
|
259
|
-
};
|