@bahmni/clinical-app 0.0.1-dev.347 → 0.0.1-dev.349

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/{ConsultationPage-C3T8THlO.js → ConsultationPage-3qK8RV6o.js} +12794 -12401
  2. package/dist/{DocumentsTable-D-yL-evA-B1fwtgFW.js → DocumentsTable-CUERw540-DNwq47jg.js} +56 -56
  3. package/dist/FormsTable-BiSt9X9y-GfSnOhAP.js +293 -0
  4. package/dist/{LNWAZHJI-imGBWvAi.js → LNWAZHJI-DklJAly_.js} +2 -2
  5. package/dist/{MWZ6AO7Z-CaczTOj3.js → MWZ6AO7Z-pJNxlx6T.js} +2 -2
  6. package/dist/{Observations-CiATLznu-n-AeVz43.js → Observations-DG-AmCpd-BuJ3kLZo.js} +51 -51
  7. package/dist/{YPM2AS64-BSKjhDOv.js → YPM2AS64-CWWMfFV2.js} +181 -181
  8. package/dist/components/dashboardSection/DashboardSection.d.ts.map +1 -1
  9. package/dist/components/forms/observations/ObservationForms.d.ts.map +1 -1
  10. package/dist/components/forms/observations/ObservationFormsContainer.d.ts +85 -0
  11. package/dist/components/forms/observations/ObservationFormsContainer.d.ts.map +1 -1
  12. package/dist/components/forms/observations/ObservationFormsPanel.d.ts.map +1 -1
  13. package/dist/components/patientHeader/ConsultationActionButton.d.ts.map +1 -1
  14. package/dist/events/startConsultation/models.d.ts +4 -0
  15. package/dist/events/startConsultation/models.d.ts.map +1 -1
  16. package/dist/hook-Dfbe9Yfh.js +12 -0
  17. package/dist/hooks/useObservationFormData.d.ts.map +1 -1
  18. package/dist/{index-C9yfr1HV.js → index-BmPRpoe2.js} +25 -24
  19. package/dist/{index-CjEhPxaX.js → index-DhSka-Il.js} +4 -3
  20. package/dist/{index-DUVzEfOd.js → index-aVz5vm6R.js} +56194 -59858
  21. package/dist/index.css +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/locales/locale_en.json +5 -0
  24. package/dist/locales/locale_es.json +5 -0
  25. package/dist/services/encounterBundleService.d.ts.map +1 -1
  26. package/dist/utils/fhir/observationResourceCreator.d.ts +19 -5
  27. package/dist/utils/fhir/observationResourceCreator.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/FormsTable-BbwKhyCn-DTJMxF2E.js +0 -232
  30. package/dist/hook-CQJXPLXP.js +0 -10
@@ -1,16 +1,16 @@
1
- import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
2
- import { V as G, u as W, o as Y, g as J, p as X, M as Z, Q as ee, z as te } from "./index-DUVzEfOd.js";
1
+ import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
+ import { f as G, u as W, o as X, z as Y, X as J, V as Z, Q as ee, d as te } from "./index-aVz5vm6R.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as c, useCallback as h, useEffect as I, useMemo as _ } from "react";
5
- const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", le = "DocumentsTable-module_documentIframe__ptq5I", ce = "DocumentsTable-module_documentImage__KQVgS", d = {
4
+ import { useState as l, useCallback as _, useEffect as D, useMemo as p } from "react";
5
+ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
8
8
  documentViewerContainer: re,
9
9
  attachmentItem: de,
10
10
  attachmentCounter: se,
11
11
  attachmentError: me,
12
- documentIframe: le,
13
- documentImage: ce
12
+ documentIframe: ce,
13
+ documentImage: le
14
14
  }, ue = {
15
15
  documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
16
16
  documentType: "DOCUMENTS_TYPE",
@@ -21,10 +21,10 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
21
21
  function R(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
- function ie(a, g) {
24
+ function ie(a, E) {
25
25
  return a.map((s) => ({
26
26
  key: s,
27
- header: g(ue[s])
27
+ header: E(ue[s])
28
28
  }));
29
29
  }
30
30
  const Te = [
@@ -33,80 +33,80 @@ const Te = [
33
33
  "attachments",
34
34
  "uploadedOn",
35
35
  "uploadedBy"
36
- ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ne = ({ config: a, encounterUuids: g }) => {
37
- const [s, w] = c(!1), [o, M] = c(
36
+ ], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], fe = ({ config: a, encounterUuids: E }) => {
37
+ const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
- ), [V, O] = c(
39
+ ), [V, I] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = G(), { t: n } = W(), { addNotification: U } = Y(), $ = Number(a?.pageSize) || 5, [f, C] = c(1), [u, k] = c($), [F, A] = c(void 0), L = h((e) => {
42
- M(e), w(!0);
43
- }, []), H = h(() => {
44
- w(!1), M(null), O(/* @__PURE__ */ new Set());
45
- }, []), v = h((e) => {
46
- O((t) => new Set(t).add(e));
47
- }, []), { data: i, isLoading: q, isError: b, error: y } = ae({
41
+ ), g = G(), { t: n } = W(), { addNotification: L } = X(), $ = Number(a?.pageSize) || 5, [O, C] = l(1), [u, k] = l($), [F, A] = l(void 0), M = _((e) => {
42
+ U(e), w(!0);
43
+ }, []), q = _(() => {
44
+ w(!1), U(null), I(/* @__PURE__ */ new Set());
45
+ }, []), v = _((e) => {
46
+ I((t) => new Set(t).add(e));
47
+ }, []), { data: i, isLoading: H, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
- E,
51
50
  g,
52
- f,
51
+ E,
52
+ O,
53
53
  u
54
54
  ],
55
- enabled: !!E,
56
- queryFn: () => J(
57
- E,
55
+ enabled: !!g,
56
+ queryFn: () => Y(
58
57
  g,
58
+ E,
59
59
  u,
60
- f
60
+ O
61
61
  )
62
62
  });
63
- I(() => {
63
+ D(() => {
64
64
  i && A(i.total);
65
- }, [i]), I(() => {
65
+ }, [i]), D(() => {
66
66
  C(1), A(void 0);
67
- }, [E]), I(() => {
68
- b && U({
67
+ }, [g]), D(() => {
68
+ b && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, U, n]), I(() => {
73
+ }, [b, y, L, n]), D(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
77
77
  const t = /* @__PURE__ */ new Set(), m = B(o);
78
- for (let l = 0; l < m.length; l++) {
79
- const S = R(m[l].url);
78
+ for (let c = 0; c < m.length; c++) {
79
+ const S = R(m[c].url);
80
80
  try {
81
81
  (await fetch(S, {
82
82
  method: "HEAD",
83
83
  signal: e.signal
84
- })).ok || t.add(l);
85
- } catch (D) {
86
- D instanceof Error && D.name !== "AbortError" && t.add(l);
84
+ })).ok || t.add(c);
85
+ } catch (N) {
86
+ N instanceof Error && N.name !== "AbortError" && t.add(c);
87
87
  }
88
88
  }
89
- e.signal.aborted || O(t);
89
+ e.signal.aborted || I(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const z = h(
92
+ const z = _(
93
93
  (e, t) => {
94
94
  t !== u ? (k(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), N = _(
97
+ ), f = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), Q = _(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), j = _(() => ie(N, n), [N, n]), P = _(
101
- () => N.map((e) => ({
100
+ ), Q = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), j = p(() => ie(f, n), [f, n]), P = p(
101
+ () => f.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
104
104
  })),
105
- [N]
106
- ), T = _(
105
+ [f]
106
+ ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), K = h(
109
+ ), K = _(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -123,9 +123,9 @@ const Te = [
123
123
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
124
124
  case "attachments":
125
125
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
126
- X,
126
+ J,
127
127
  {
128
- onClick: () => L(e),
128
+ onClick: () => M(e),
129
129
  className: d.viewAttachmentsLink,
130
130
  "data-testid": `view-attachments-${e.id}`,
131
131
  children: n("DOCUMENTS_VIEW_ATTACHMENTS")
@@ -135,16 +135,16 @@ const Te = [
135
135
  return null;
136
136
  }
137
137
  },
138
- [L, n]
138
+ [M, n]
139
139
  );
140
- return /* @__PURE__ */ p(x, { children: [
140
+ return /* @__PURE__ */ h(x, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
144
  headers: j,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
146
  rows: Q,
147
- loading: q,
147
+ loading: H,
148
148
  errorStateMessage: b ? y?.message : null,
149
149
  sortable: P,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
@@ -153,7 +153,7 @@ const Te = [
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
- page: f,
156
+ page: O,
157
157
  onPageChange: z
158
158
  }
159
159
  ) }),
@@ -163,20 +163,20 @@ const Te = [
163
163
  id: "modalIdForActionAreaLayout",
164
164
  portalId: "main-display-area",
165
165
  open: s,
166
- onRequestClose: H,
166
+ onRequestClose: q,
167
167
  modalHeading: o.documentIdentifier,
168
168
  passiveModal: !0,
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
172
- const m = R(e.url), l = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), D = V.has(t);
173
- return m === "#" || D ? /* @__PURE__ */ p(
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), N = V.has(t);
173
+ return m === "#" || N ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
177
177
  "data-testid": `attachment-error-${t}`,
178
178
  children: [
179
- T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
179
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
180
180
  t + 1,
181
181
  "/",
182
182
  T.length
@@ -185,13 +185,13 @@ const Te = [
185
185
  ]
186
186
  },
187
187
  `${o.id}-${e.url}`
188
- ) : /* @__PURE__ */ p(
188
+ ) : /* @__PURE__ */ h(
189
189
  "div",
190
190
  {
191
191
  className: d.attachmentItem,
192
192
  "data-testid": `attachment-item-${t}`,
193
193
  children: [
194
- T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
194
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
195
195
  t + 1,
196
196
  "/",
197
197
  T.length
@@ -207,7 +207,7 @@ const Te = [
207
207
  ) : /* @__PURE__ */ r(
208
208
  "iframe",
209
209
  {
210
- src: l ? `${m}#toolbar=0` : m,
210
+ src: c ? `${m}#toolbar=0` : m,
211
211
  className: d.documentIframe,
212
212
  title: o.documentIdentifier,
213
213
  onError: () => v(t)
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- Ne as default
226
+ fe as default
227
227
  };
@@ -0,0 +1,293 @@
1
+ import { jsx as i, jsxs as Q, Fragment as he } from "react/jsx-runtime";
2
+ import { u as ge, f as pe, a as Ne, M as Oe, r as Te, C as be, w as Ee, _ as Ie, b as _e, G as Ae, c as ve, S as Fe, n as z, V as Me, E as K, e as x, X as Se, Q as P, g as Ce, Y as Re, d as Le, T as Ue, W as Be } from "./index-aVz5vm6R.js";
3
+ import { useQueryClient as De, useQuery as T } from "@tanstack/react-query";
4
+ import { useState as X, useMemo as d, useCallback as l } from "react";
5
+ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_modalHeading__wnTmA", we = "FormsTable-module_customAccordianItem__isszs", b = {
6
+ formsTableBody: qe,
7
+ modalHeading: ke,
8
+ customAccordianItem: we
9
+ }, Ve = "startConsultation", Qe = ({
10
+ episodeOfCareUuids: S,
11
+ encounterUuids: u,
12
+ config: Y,
13
+ disableActions: W = !1,
14
+ activeEncounterUuid: h = null
15
+ }) => {
16
+ const { t: n } = ge(), c = pe(), [g, C] = X(!1), [s, R] = X(null), {
17
+ numberOfVisits: Z,
18
+ hideThumbnail: J = !1,
19
+ forms: p
20
+ } = Y ?? {}, ee = Ne(
21
+ Be.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: N } = Oe(), E = ee && !W && !!h, L = Te(
23
+ S,
24
+ u
25
+ ), re = De(), {
26
+ data: U = [],
27
+ isLoading: B,
28
+ isError: D,
29
+ error: ae,
30
+ refetch: oe
31
+ } = T({
32
+ queryKey: ["forms", c, S],
33
+ queryFn: () => be(c, void 0, Z),
34
+ enabled: !!c && !L
35
+ }), q = d(() => {
36
+ let e = U;
37
+ return u && u.length > 0 && (e = e.filter(
38
+ (r) => u.includes(r.encounterUuid)
39
+ )), Array.isArray(p) && p.length > 0 && (e = e.filter(
40
+ (r) => p.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
+ )), e;
42
+ }, [U, u, p]), { data: O = [] } = T({
43
+ queryKey: ["observationForms"],
44
+ queryFn: () => Ee()
45
+ }), k = l(
46
+ (e) => {
47
+ const r = O.find((o) => o.name === e);
48
+ if (!r?.privileges || r.privileges.length === 0) return !0;
49
+ if (!N || N.length === 0) return !1;
50
+ const a = new Set(N.map((o) => o.name));
51
+ return r.privileges.some(
52
+ (o) => a.has(o.privilegeName) && o.editable
53
+ );
54
+ },
55
+ [O, N]
56
+ ), f = l(
57
+ (e) => !h || e.encounterUuid !== h ? !1 : k(e.formName),
58
+ [h, k]
59
+ ), w = l(
60
+ (e) => O.find((r) => r.name === e)?.uuid,
61
+ [O]
62
+ ), I = d(() => {
63
+ if (s)
64
+ return w(s.formName);
65
+ }, [s, w]), {
66
+ data: m,
67
+ isLoading: te,
68
+ isError: se,
69
+ error: _
70
+ } = T({
71
+ queryKey: ["formMetadata", I],
72
+ queryFn: () => Ie(I),
73
+ enabled: !!I && g
74
+ }), {
75
+ data: A,
76
+ isLoading: ne,
77
+ isError: ie,
78
+ error: v
79
+ } = T({
80
+ queryKey: ["formsEncounterFHIR", s?.encounterUuid],
81
+ queryFn: () => _e(s.encounterUuid),
82
+ enabled: !!s?.encounterUuid && g
83
+ });
84
+ Ae(
85
+ (e) => {
86
+ e.patientUUID === c && e.updatedConcepts.size > 0 && (oe(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
87
+ },
88
+ [c]
89
+ );
90
+ const de = d(() => !A?.entry || !s?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [A, s?.formName]), le = d(() => {
91
+ if (!m?.schema) return;
92
+ const e = [], r = (a) => {
93
+ (a ?? []).forEach((o) => {
94
+ const t = o;
95
+ t.id != null && e.push(String(t.id)), t.controls && r(t.controls);
96
+ });
97
+ };
98
+ return r(
99
+ m.schema.controls ?? []
100
+ ), e.length > 0 ? e : void 0;
101
+ }, [m]), me = d(() => {
102
+ if (!m?.schema) return;
103
+ const e = {}, r = (a, o) => {
104
+ for (const t of a)
105
+ if (t.type === "section") {
106
+ const M = t.label?.value ?? "Section";
107
+ r(t.controls ?? [], M);
108
+ } else
109
+ t.id != null && o && (e[String(t.id)] = o), t.controls && r(t.controls, o);
110
+ };
111
+ return r(
112
+ m.schema.controls ?? [],
113
+ null
114
+ ), Object.keys(e).length > 0 ? e : void 0;
115
+ }, [m]), ue = d(() => {
116
+ if (_)
117
+ return z(_).message;
118
+ if (v)
119
+ return z(v).message;
120
+ }, [_, v]), y = d(
121
+ () => [
122
+ { key: "recordedOn", header: n("RECORDED_ON") },
123
+ { key: "recordedBy", header: n("RECORDED_BY") }
124
+ ],
125
+ [n]
126
+ ), V = d(
127
+ () => [...y, { key: "actions", header: n("ACTIONS") }],
128
+ [y, n]
129
+ ), ce = l(
130
+ (e) => E && e.some((r) => f(r)) ? V : y,
131
+ [E, f, V, y]
132
+ ), fe = y, ye = d(
133
+ () => [
134
+ { key: "recordedOn", sortable: !0 },
135
+ { key: "recordedBy", sortable: !0 }
136
+ ],
137
+ []
138
+ ), H = d(() => {
139
+ const e = q.reduce(
140
+ (r, a) => {
141
+ const o = a.formName;
142
+ r[o] ??= [];
143
+ const t = a.providers.map((M) => M.providerName).filter(Boolean).join(", ");
144
+ return r[o].push({
145
+ id: a.encounterUuid,
146
+ formName: a.formName,
147
+ recordedOn: Me(a.encounterDateTime, n, !0).formattedResult,
148
+ recordedBy: t ?? "--",
149
+ encounterDateTime: a.encounterDateTime,
150
+ encounterUuid: a.encounterUuid
151
+ }), r;
152
+ },
153
+ {}
154
+ );
155
+ return Object.entries(e).map(
156
+ ([r, a]) => ({
157
+ formName: r,
158
+ records: a.sort(
159
+ (o, t) => t.encounterDateTime - o.encounterDateTime
160
+ )
161
+ })
162
+ ).sort((r, a) => r.formName.localeCompare(a.formName));
163
+ }, [q, n]), G = l((e) => {
164
+ R(e), C(!0);
165
+ }, []), $ = l(() => {
166
+ C(!1), R(null);
167
+ }, []), F = l((e) => {
168
+ globalThis.dispatchEvent(
169
+ new CustomEvent(Ve, {
170
+ detail: {
171
+ editOnly: "observationForms",
172
+ editTitle: "EDIT_OBSERVATION_FORM_TITLE",
173
+ editEncounterUuid: e.encounterUuid,
174
+ editFormName: e.formName,
175
+ directFormMode: !0
176
+ }
177
+ })
178
+ );
179
+ }, []), j = l(
180
+ (e, r) => {
181
+ switch (r) {
182
+ case "recordedOn":
183
+ return /* @__PURE__ */ i(Se, { onClick: () => G(e), children: e.recordedOn });
184
+ case "recordedBy":
185
+ return e.recordedBy;
186
+ case "actions":
187
+ return f(e) ? /* @__PURE__ */ i(
188
+ K,
189
+ {
190
+ label: n("EDIT_OBSERVATION_FORM"),
191
+ kind: "ghost",
192
+ size: "sm",
193
+ testId: `edit-form-${e.encounterUuid}`,
194
+ onClick: () => F(e),
195
+ children: /* @__PURE__ */ i(x, {})
196
+ }
197
+ ) : null;
198
+ default:
199
+ return null;
200
+ }
201
+ },
202
+ [G, F, f, n]
203
+ );
204
+ return /* @__PURE__ */ Q(he, { children: [
205
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: B || D || H.length === 0 || L ? /* @__PURE__ */ i(
206
+ P,
207
+ {
208
+ headers: fe,
209
+ ariaLabel: n("FORMS_HEADING"),
210
+ rows: [],
211
+ loading: B,
212
+ errorStateMessage: D ? ae?.message : void 0,
213
+ emptyStateMessage: n("FORMS_UNAVAILABLE"),
214
+ renderCell: j,
215
+ className: b.formsTableBody,
216
+ dataTestId: "forms-table"
217
+ }
218
+ ) : /* @__PURE__ */ i(Ce, { align: "start", children: H.map((e, r) => {
219
+ const { formName: a, records: o } = e, t = ce(o);
220
+ return /* @__PURE__ */ i(
221
+ Re,
222
+ {
223
+ title: a,
224
+ className: b.customAccordianItem,
225
+ testId: `accordian-title-${a}`,
226
+ open: r === 0,
227
+ children: /* @__PURE__ */ i(
228
+ P,
229
+ {
230
+ headers: t,
231
+ ariaLabel: n("FORMS_HEADING"),
232
+ rows: o,
233
+ loading: !1,
234
+ errorStateMessage: "",
235
+ sortable: ye,
236
+ emptyStateMessage: n("FORMS_UNAVAILABLE"),
237
+ renderCell: j,
238
+ className: b.formsTableBody,
239
+ dataTestId: `forms-table-${a}`
240
+ }
241
+ )
242
+ },
243
+ a
244
+ );
245
+ }) }) }),
246
+ g && s && /* @__PURE__ */ i(
247
+ Le,
248
+ {
249
+ id: "modalIdForActionAreaLayout",
250
+ portalId: "main-display-area",
251
+ open: g,
252
+ onRequestClose: $,
253
+ modalHeading: /* @__PURE__ */ Q("div", { className: b.modalHeading, children: [
254
+ /* @__PURE__ */ i("span", { children: s.formName }),
255
+ E && f(s) && /* @__PURE__ */ i(
256
+ K,
257
+ {
258
+ label: n("EDIT_OBSERVATION_FORM"),
259
+ kind: "ghost",
260
+ size: "sm",
261
+ testId: `edit-form-modal-${s.encounterUuid}`,
262
+ onClick: () => {
263
+ $(), F(s);
264
+ },
265
+ children: /* @__PURE__ */ i(x, {})
266
+ }
267
+ )
268
+ ] }),
269
+ modalLabel: `${s.recordedOn} | ${s.recordedBy}`,
270
+ passiveModal: !0,
271
+ size: "md",
272
+ testId: "form-details-modal",
273
+ children: /* @__PURE__ */ i(
274
+ Ue,
275
+ {
276
+ observations: de,
277
+ isLoading: te || ne,
278
+ isError: se || ie,
279
+ errorMessage: ue,
280
+ emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
281
+ testIdPrefix: s.formName,
282
+ hideThumbnail: J,
283
+ controlOrder: le,
284
+ sectionMap: me
285
+ }
286
+ )
287
+ }
288
+ )
289
+ ] });
290
+ };
291
+ export {
292
+ Qe as default
293
+ };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BSKjhDOv.js";
2
- import { bJ as d, bK as f, bL as e } from "./index-DUVzEfOd.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CWWMfFV2.js";
2
+ import { bN as d, bO as f, bP as e } from "./index-aVz5vm6R.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-BSKjhDOv.js";
2
- import { bJ as v, bK as C, bL as e } from "./index-DUVzEfOd.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-CWWMfFV2.js";
2
+ import { bN as v, bO as C, bP as e } from "./index-aVz5vm6R.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"