@bahmni/widgets 0.0.1-dev.185 → 0.0.1-dev.187

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.
@@ -1,30 +1,30 @@
1
1
  import { jsxs as b, jsx as n, Fragment as H } from "react/jsx-runtime";
2
- import { d as M, Q as re, e as te, f as ae, r as oe, g as se, Y as ne, u as de, A as ie, M as le, L as ce, h as me, O as ue, K as pe, k as be, P as fe, _ as U, j as _e, G as he, b as $e, T as ye, l as k, c as ge } from "./index-DMWvpiRC.js";
3
- import { useQueryClient as ve, useQuery as L } from "@tanstack/react-query";
4
- import { useState as x, useMemo as g, useCallback as F } from "react";
2
+ import { c as M, Z as re, X as te, e as ae, d as oe, f as se, J as ne, u as de, N as ie, q as le, g as ce, x as me, h as ue, j as pe, M as be, R as fe, t as P, B as _e, k as he, b as $e, _ as ye, T as U, i as ge } from "./index-DwHCZ4D7.js";
3
+ import { useQueryClient as ve, useQuery as F } from "@tanstack/react-query";
4
+ import { useState as k, useMemo as g, useCallback as L } from "react";
5
5
  import { useTranslation as Ne } from "react-i18next";
6
- const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe = "_formContent_1pd36_18", Me = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Te = "_rowContainer_1pd36_43", we = "_groupLabel_1pd36_48", De = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", Ae = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Ee = "_memberLabel_1pd36_86", Be = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", Pe = "_commentText_1pd36_116", qe = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", ke = "_nestedGroupMembers_1pd36_141", o = {
6
+ const Oe = "_formsTableBody_1pd36_1", Fe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Me = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", we = "_rowContainer_1pd36_43", De = "_groupLabel_1pd36_48", Te = "_rowLabel_1pd36_58", Ve = "_rowValue_1pd36_67", Be = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Ae = "_memberLabel_1pd36_86", Ee = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", qe = "_commentText_1pd36_116", xe = "_nestedGroup_1pd36_125", Pe = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
7
7
  formsTableBody: Oe,
8
- customAccordianItem: Le,
9
- formContent: Fe,
8
+ customAccordianItem: Fe,
9
+ formContent: Le,
10
10
  formDetailsContainer: Me,
11
11
  observation: Re,
12
12
  groupContainer: Ce,
13
- rowContainer: Te,
14
- groupLabel: we,
15
- rowLabel: De,
13
+ rowContainer: we,
14
+ groupLabel: De,
15
+ rowLabel: Te,
16
16
  rowValue: Ve,
17
- groupMembers: Ae,
17
+ groupMembers: Be,
18
18
  memberRow: Ie,
19
- memberLabel: Ee,
20
- memberValue: Be,
19
+ memberLabel: Ae,
20
+ memberValue: Ee,
21
21
  abnormalValue: Ge,
22
22
  commentSection: Se,
23
- commentText: Pe,
24
- nestedGroup: qe,
25
- nestedGroupLabel: Ue,
26
- nestedGroupMembers: ke
27
- }, K = (e) => {
23
+ commentText: qe,
24
+ nestedGroup: xe,
25
+ nestedGroupLabel: Pe,
26
+ nestedGroupMembers: Ue
27
+ }, j = (e) => {
28
28
  const r = re(e);
29
29
  return r === "Image" ? /* @__PURE__ */ n(
30
30
  te,
@@ -34,7 +34,7 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
34
34
  id: `${e}-img`
35
35
  }
36
36
  ) : r === "Video" ? /* @__PURE__ */ n(ae, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ n(oe, { id: `${e}-pdf`, src: e }) : e;
37
- }, j = (e) => {
37
+ }, K = (e) => {
38
38
  const r = e.observationValue?.unit, a = e.observationValue?.referenceRange?.low?.value, d = e.observationValue?.referenceRange?.high?.value, s = a != null, c = d != null, i = s && c ? ` (${a} - ${d})` : s ? ` (>${a})` : c ? ` (<${d})` : "", t = e.observationValue?.isAbnormal === !0;
39
39
  return { units: r, rangeString: i, isAbnormal: t };
40
40
  }, Q = ({
@@ -81,7 +81,7 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
81
81
  ]
82
82
  }
83
83
  );
84
- const { units: p, rangeString: y, isAbnormal: f } = j(e), _ = e.observationValue?.value?.toString(), h = _ ? K(_) : null;
84
+ const { units: p, rangeString: y, isAbnormal: f } = K(e), _ = e.observationValue?.value?.toString(), h = _ ? j(_) : null;
85
85
  return /* @__PURE__ */ b(H, { children: [
86
86
  /* @__PURE__ */ b(
87
87
  "div",
@@ -134,13 +134,13 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
134
134
  }
135
135
  )
136
136
  ] });
137
- }, xe = ({
137
+ }, ke = ({
138
138
  observation: e,
139
139
  index: r,
140
140
  formName: a = "",
141
141
  comment: d
142
142
  }) => {
143
- const s = e.members && e.members.length > 0, { units: c, rangeString: i, isAbnormal: t } = j(e), p = a ? `${a}-` : "", y = e.observationValue?.value?.toString(), f = y ? K(y) : null;
143
+ const s = e.members && e.members.length > 0, { units: c, rangeString: i, isAbnormal: t } = K(e), p = a ? `${a}-` : "", y = e.observationValue?.value?.toString(), f = y ? j(y) : null;
144
144
  return /* @__PURE__ */ b(
145
145
  "div",
146
146
  {
@@ -217,14 +217,14 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
217
217
  );
218
218
  }, He = (e) => e ? e.extension?.find(
219
219
  (a) => a.url === ne
220
- )?.valueString : void 0, Ke = (e) => {
220
+ )?.valueString : void 0, je = (e) => {
221
221
  if (e)
222
222
  return e.note?.[0]?.text;
223
- }, je = (e, r) => e.entry?.find((a) => a.resource?.id === r)?.resource, w = (e, r) => {
224
- const a = je(e, r);
223
+ }, Ke = (e, r) => e.entry?.find((a) => a.resource?.id === r)?.resource, D = (e, r) => {
224
+ const a = Ke(e, r);
225
225
  return a ? {
226
226
  formFieldPath: He(a),
227
- comment: Ke(a)
227
+ comment: je(a)
228
228
  } : {};
229
229
  }, Qe = (e, r) => {
230
230
  if (!e?.entry || !r)
@@ -232,60 +232,60 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
232
232
  const a = se(e);
233
233
  return [
234
234
  ...a.observations.map((s) => {
235
- const { formFieldPath: c, comment: i } = w(
235
+ const { formFieldPath: c, comment: i } = D(
236
236
  e,
237
237
  s.id
238
238
  );
239
239
  return { obs: s, formFieldPath: c, comment: i };
240
240
  }),
241
241
  ...a.groupedObservations.flatMap((s) => {
242
- const { formFieldPath: c } = w(e, s.id);
242
+ const { formFieldPath: c } = D(e, s.id);
243
243
  return (s.members ?? []).map((i) => {
244
- const { comment: t } = w(e, i.id);
244
+ const { comment: t } = D(e, i.id);
245
245
  return { obs: i, formFieldPath: c, comment: t };
246
246
  });
247
247
  })
248
248
  ].filter(
249
249
  ({ formFieldPath: s }) => !s || s.includes(r)
250
250
  );
251
- }, Ze = ({
251
+ }, Ye = ({
252
252
  episodeOfCareUuids: e,
253
253
  encounterUuids: r,
254
254
  config: a
255
255
  }) => {
256
- const { t: d } = Ne(), s = de(), [c, i] = x(!1), [t, p] = x(null), y = a?.numberOfVisits, f = ie(
256
+ const { t: d } = Ne(), s = de(), [c, i] = k(!1), [t, p] = k(null), y = a?.numberOfVisits, f = ie(
257
257
  e,
258
258
  r
259
259
  ), _ = ve(), {
260
260
  data: h = [],
261
261
  isLoading: v,
262
262
  isError: N,
263
- error: Y,
263
+ error: X,
264
264
  refetch: z
265
- } = L({
265
+ } = F({
266
266
  queryKey: ["forms", s, e],
267
267
  queryFn: () => le(s, void 0, y),
268
268
  enabled: !!s && !f
269
- }), D = g(() => !r || r.length === 0 ? h : h.filter(
269
+ }), T = g(() => !r || r.length === 0 ? h : h.filter(
270
270
  (l) => r.includes(l.encounterUuid)
271
- ), [h, r]), { data: V = [] } = L({
271
+ ), [h, r]), { data: V = [] } = F({
272
272
  queryKey: ["observationForms"],
273
273
  queryFn: () => ce()
274
- }), A = F(
274
+ }), B = L(
275
275
  (l) => V.find((m) => m.name === l)?.uuid,
276
276
  [V]
277
277
  ), R = g(() => {
278
278
  if (t)
279
- return A(t.formName);
280
- }, [t, A]), { isLoading: W, error: I } = L({
279
+ return B(t.formName);
280
+ }, [t, B]), { isLoading: J, error: I } = F({
281
281
  queryKey: ["formMetadata", R],
282
282
  queryFn: () => me(R),
283
283
  enabled: !!R && c
284
284
  }), {
285
285
  data: C,
286
- isLoading: J,
287
- error: E
288
- } = L({
286
+ isLoading: Z,
287
+ error: A
288
+ } = F({
289
289
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
290
290
  queryFn: () => ue(t.encounterUuid),
291
291
  enabled: !!t?.encounterUuid && c
@@ -296,7 +296,7 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
296
296
  },
297
297
  [s]
298
298
  );
299
- const B = g(() => !C || !t?.formName ? [] : Qe(
299
+ const E = g(() => !C || !t?.formName ? [] : Qe(
300
300
  C,
301
301
  t.formName
302
302
  ), [C, t?.formName]), G = g(
@@ -305,23 +305,23 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
305
305
  { key: "recordedBy", header: d("FORM_RECORDED_BY") }
306
306
  ],
307
307
  [d]
308
- ), X = g(
308
+ ), W = g(
309
309
  () => [
310
310
  { key: "recordedOn", sortable: !0 },
311
311
  { key: "recordedBy", sortable: !0 }
312
312
  ],
313
313
  []
314
314
  ), S = g(() => {
315
- const l = D.reduce(
315
+ const l = T.reduce(
316
316
  (m, u) => {
317
317
  const O = u.formName;
318
318
  m[O] ??= [];
319
- const T = u.providers.map((ee) => ee.providerName).filter(Boolean).join(", ");
319
+ const w = u.providers.map((ee) => ee.providerName).filter(Boolean).join(", ");
320
320
  return m[O].push({
321
321
  id: u.encounterUuid,
322
322
  formName: u.formName,
323
323
  recordedOn: be(u.encounterDateTime, d, ge).formattedResult,
324
- recordedBy: T ?? "--",
324
+ recordedBy: w ?? "--",
325
325
  encounterDateTime: u.encounterDateTime,
326
326
  encounterUuid: u.encounterUuid
327
327
  }), m;
@@ -332,38 +332,38 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
332
332
  ([m, u]) => ({
333
333
  formName: m,
334
334
  records: u.sort(
335
- (O, T) => T.encounterDateTime - O.encounterDateTime
335
+ (O, w) => w.encounterDateTime - O.encounterDateTime
336
336
  )
337
337
  })
338
338
  ).sort((m, u) => m.formName.localeCompare(u.formName));
339
- }, [D, d]), P = F((l) => {
339
+ }, [T, d]), q = L((l) => {
340
340
  p(l), i(!0);
341
- }, []), Z = F(() => {
341
+ }, []), Y = L(() => {
342
342
  i(!1), p(null);
343
- }, []), q = F(
343
+ }, []), x = L(
344
344
  (l, $) => {
345
345
  switch ($) {
346
346
  case "recordedOn":
347
- return /* @__PURE__ */ n(fe, { onClick: () => P(l), children: l.recordedOn });
347
+ return /* @__PURE__ */ n(fe, { onClick: () => q(l), children: l.recordedOn });
348
348
  case "recordedBy":
349
349
  return l.recordedBy;
350
350
  default:
351
351
  return null;
352
352
  }
353
353
  },
354
- [P]
354
+ [q]
355
355
  );
356
356
  return /* @__PURE__ */ b(H, { children: [
357
357
  /* @__PURE__ */ n("div", { "data-testid": "forms-table", children: v || N || S.length === 0 || f ? /* @__PURE__ */ n(
358
- U,
358
+ P,
359
359
  {
360
360
  headers: G,
361
361
  ariaLabel: d("FORMS_HEADING"),
362
362
  rows: [],
363
363
  loading: v,
364
- errorStateMessage: N ? Y?.message : void 0,
364
+ errorStateMessage: N ? X?.message : void 0,
365
365
  emptyStateMessage: d("FORMS_UNAVAILABLE"),
366
- renderCell: q,
366
+ renderCell: x,
367
367
  className: o.formsTableBody,
368
368
  dataTestId: "forms-table"
369
369
  }
@@ -377,16 +377,16 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
377
377
  testId: `accordian-title-${m}`,
378
378
  open: $ === 0,
379
379
  children: /* @__PURE__ */ n(
380
- U,
380
+ P,
381
381
  {
382
382
  headers: G,
383
383
  ariaLabel: d("FORMS_HEADING"),
384
384
  rows: u,
385
385
  loading: !1,
386
386
  errorStateMessage: "",
387
- sortable: X,
387
+ sortable: W,
388
388
  emptyStateMessage: d("FORMS_UNAVAILABLE"),
389
- renderCell: q,
389
+ renderCell: x,
390
390
  className: o.formsTableBody,
391
391
  dataTestId: `forms-table-${m}`
392
392
  }
@@ -401,14 +401,14 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
401
401
  id: "modalIdForActionAreaLayout",
402
402
  portalId: "main-display-area",
403
403
  open: c,
404
- onRequestClose: Z,
404
+ onRequestClose: Y,
405
405
  modalHeading: t.formName,
406
406
  modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
407
407
  passiveModal: !0,
408
408
  size: "md",
409
409
  testId: "form-details-modal",
410
- children: /* @__PURE__ */ n("div", { className: o.formContent, children: W || J ? /* @__PURE__ */ n(ye, { width: "100%", lineCount: 3 }) : I ? /* @__PURE__ */ n("div", { children: k(I).message ?? d("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ n("div", { children: k(E).message ?? d("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ n("div", { className: o.formDetailsContainer, children: B.map(({ obs: l, comment: $ }, m) => /* @__PURE__ */ n(
411
- xe,
410
+ children: /* @__PURE__ */ n("div", { className: o.formContent, children: J || Z ? /* @__PURE__ */ n(ye, { width: "100%", lineCount: 3 }) : I ? /* @__PURE__ */ n("div", { children: U(I).message ?? d("ERROR_FETCHING_FORM_METADATA") }) : A ? /* @__PURE__ */ n("div", { children: U(A).message ?? d("ERROR_FETCHING_FORM_DATA") }) : E.length > 0 ? /* @__PURE__ */ n("div", { className: o.formDetailsContainer, children: E.map(({ obs: l, comment: $ }, m) => /* @__PURE__ */ n(
411
+ ke,
412
412
  {
413
413
  observation: l,
414
414
  index: m,
@@ -422,5 +422,5 @@ const Oe = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Fe =
422
422
  ] });
423
423
  };
424
424
  export {
425
- Ze as default
425
+ Ye as default
426
426
  };
@@ -1,17 +1,17 @@
1
- import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { m as K, n as C, t as Q, Q as w, o as M, e as V, f as k, r as G, u as P, a as H, q as j, R as z, K as Y, g as J, p as W, s as X, v as Z, _ as x } from "./index-DMWvpiRC.js";
1
+ import { jsx as l, jsxs as S } from "react/jsx-runtime";
2
+ import { l as M, m as C, n as Q, Z as V, G as k, X as q, e as G, d as K, u as j, a as P, o as H, p as X, j as Z, f as z, r as J, s as Y, v as W, t as x } from "./index-DwHCZ4D7.js";
3
3
  import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as E } from "react";
5
5
  import { useTranslation as D } from "react-i18next";
6
- const U = (t, c, i, l, a) => {
7
- const s = Q(t, c), o = s.value, r = w(o);
6
+ const U = (t, c, i, d, a) => {
7
+ const s = Q(t, c), o = s.value, r = V(o);
8
8
  let n = o;
9
- r === "Image" && (n = /* @__PURE__ */ d(V, { imageSrc: o, alt: o, id: `${o}-img` })), r === "Video" && (n = /* @__PURE__ */ d(k, { id: `${o}-video`, videoSrc: o })), r === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
9
+ r === "Image" && (n = /* @__PURE__ */ l(q, { imageSrc: o, alt: o, id: `${o}-img` })), r === "Video" && (n = /* @__PURE__ */ l(G, { id: `${o}-video`, videoSrc: o })), r === "PDF" && (n = /* @__PURE__ */ l(K, { id: `${o}-pdf`, src: o }));
10
10
  const u = a("OBSERVATIONS_RECORDED_BY", {
11
11
  provider: s.provider
12
- }), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
13
- return /* @__PURE__ */ d(
14
- M,
12
+ }), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = d ? `${d}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
13
+ return /* @__PURE__ */ l(
14
+ k,
15
15
  {
16
16
  header: s.header,
17
17
  value: n,
@@ -22,11 +22,11 @@ const U = (t, c, i, l, a) => {
22
22
  },
23
23
  `obs-${t.id}`
24
24
  );
25
- }, oe = (t, c, i, l, a, s) => /* @__PURE__ */ d(
25
+ }, oe = (t, c, i, d, a, s) => /* @__PURE__ */ l(
26
26
  C,
27
27
  {
28
28
  title: t.display,
29
- id: `grouped-obs-${t.display}-${l}`,
29
+ id: `grouped-obs-${t.display}-${d}`,
30
30
  open: i,
31
31
  children: t.members?.map(
32
32
  (o, r) => U(o, r, a, s, c)
@@ -37,8 +37,8 @@ const U = (t, c, i, l, a) => {
37
37
  groupedData: t,
38
38
  title: c = ""
39
39
  }) => {
40
- const { t: i } = D(), l = (a, s, o) => {
41
- const r = K(a.encounterDetails, i);
40
+ const { t: i } = D(), d = (a, s, o) => {
41
+ const r = M(a.encounterDetails, i);
42
42
  return /* @__PURE__ */ S(
43
43
  C,
44
44
  {
@@ -64,14 +64,14 @@ const U = (t, c, i, l, a) => {
64
64
  `encounter-${a.encounterId}`
65
65
  );
66
66
  };
67
- return /* @__PURE__ */ d(
67
+ return /* @__PURE__ */ l(
68
68
  "div",
69
69
  {
70
70
  id: "obs-by-encounter",
71
71
  "data-testid": "obs-by-encounter-test-id",
72
72
  "aria-label": "obs-by-encounter-aria-label",
73
73
  children: t.map(
74
- (a, s) => l(a, s === 0, s)
74
+ (a, s) => d(a, s === 0, s)
75
75
  )
76
76
  }
77
77
  );
@@ -79,10 +79,10 @@ const U = (t, c, i, l, a) => {
79
79
  observations: ae,
80
80
  title: ne
81
81
  }, ie = (t) => ["conceptUuid", t], ce = (t, c) => ["observations", t, ...c], me = ({ config: t }) => {
82
- const c = t, { conceptNames: i = [], conceptUuid: l = [] } = c, a = se(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = H(), { t: r } = D(), n = ee({
82
+ const c = t, { conceptNames: i = [], conceptUuid: d = [] } = c, a = se(/* @__PURE__ */ new Set()), s = j(), { addNotification: o } = P(), { t: r } = D(), n = ee({
83
83
  queries: i.map((e) => ({
84
84
  queryKey: ie(e),
85
- queryFn: () => j(e),
85
+ queryFn: () => H(e),
86
86
  enabled: !!e
87
87
  }))
88
88
  });
@@ -98,23 +98,23 @@ const U = (t, c, i, l, a) => {
98
98
  } else e.isError || a.current.delete(m);
99
99
  });
100
100
  }, [n, i]);
101
- const u = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = E(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
101
+ const u = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = E(() => [.../* @__PURE__ */ new Set([...u, ...d])], [u, d]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
102
102
  data: p,
103
103
  isLoading: f,
104
104
  isError: O,
105
- refetch: R
105
+ refetch: T
106
106
  } = te({
107
107
  queryKey: ce(s, b),
108
- queryFn: () => z(s, b),
108
+ queryFn: () => X(s, b),
109
109
  enabled: !!s && b.length > 0 && v
110
110
  });
111
- Y(
111
+ Z(
112
112
  (e) => {
113
113
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
114
114
  (g) => b.includes(g)
115
- ) && R();
115
+ ) && T();
116
116
  },
117
- [s, R]
117
+ [s, T]
118
118
  ), $(() => {
119
119
  O && o({
120
120
  title: r("ERROR_DEFAULT_TITLE"),
@@ -122,40 +122,40 @@ const U = (t, c, i, l, a) => {
122
122
  type: "error"
123
123
  });
124
124
  }, [O]);
125
- const T = E(() => {
125
+ const R = E(() => {
126
126
  if (!p) return [];
127
- const e = J(p), m = W(e);
128
- return X(m);
127
+ const e = z(p), m = J(e);
128
+ return Y(m);
129
129
  }, [p]), B = [
130
130
  { key: "name", header: "name" },
131
131
  { key: "value", header: "value" },
132
132
  { key: "form", header: "form" }
133
- ], _ = f || !v, I = O && v, A = (!p || p.entry?.length === 0 || b.length === 0) && v, F = I ? r("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? r("NO_OBSERVATIONS_FOUND") : void 0, q = T.length > 0 && !_ && !I, h = c.titleTranslationKey, y = h ? r(h) : "";
133
+ ], I = f || !v, _ = O && v, A = (!p || p.entry?.length === 0 || b.length === 0) && v, F = _ ? r("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? r("NO_OBSERVATIONS_FOUND") : void 0, w = R.length > 0 && !I && !_, y = c.titleTranslationKey, h = y ? r(y) : "";
134
134
  return /* @__PURE__ */ S(
135
135
  "div",
136
136
  {
137
137
  id: "observations",
138
- "data-testid": h ? `observations-${y}` : "observations",
138
+ "data-testid": y ? `observations-${h}` : "observations",
139
139
  "aria-label": "observations-aria-label",
140
140
  className: N.observations,
141
141
  children: [
142
- /* @__PURE__ */ d(
143
- Z,
142
+ /* @__PURE__ */ l(
143
+ W,
144
144
  {
145
145
  id: "observations-title",
146
- testId: h ? `observations-title-${y}` : "observations-title",
147
- title: y,
146
+ testId: y ? `observations-title-${h}` : "observations-title",
147
+ title: h,
148
148
  className: N.title,
149
- children: /* @__PURE__ */ d("p", { children: y })
149
+ children: /* @__PURE__ */ l("p", { children: h })
150
150
  }
151
151
  ),
152
- q ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
152
+ w ? /* @__PURE__ */ l(re, { groupedData: R, title: h }) : /* @__PURE__ */ l(
153
153
  x,
154
154
  {
155
155
  headers: B,
156
156
  rows: [],
157
157
  ariaLabel: r("OBSERVATIONS"),
158
- loading: _,
158
+ loading: I,
159
159
  errorStateMessage: F,
160
160
  emptyStateMessage: L,
161
161
  dataTestId: "observations-table"
@@ -2,9 +2,8 @@ import { default as React } from 'react';
2
2
  import { WidgetProps } from '../registry/model';
3
3
  export declare const genericServiceRequestQueryKeys: (categoryUuid: string, patientUUID: string, encounterUuids?: string[]) => readonly ["genericServiceRequest", string, string, string[] | undefined];
4
4
  /**
5
- * Component to display patient service requests in a flat sorted table.
6
- * Items are sorted by orderedDate descending (newest first), with priority
7
- * (stat before routine) as a tiebreaker for items with the same orderedDate.
5
+ * Component to display patient service requests grouped by date in accordion format
6
+ * Each accordion item contains a SortableDataTable with service requests for that date
8
7
  */
9
8
  declare const GenericServiceRequestTable: React.FC<WidgetProps>;
10
9
  export default GenericServiceRequestTable;
@@ -1 +1 @@
1
- {"version":3,"file":"GenericServiceRequestTable.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/GenericServiceRequestTable.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAahD,eAAO,MAAM,8BAA8B,GACzC,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,iBAAiB,MAAM,EAAE,6EAEoD,CAAC;AAehF;;;;GAIG;AACH,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+KrD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"GenericServiceRequestTable.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/GenericServiceRequestTable.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAahD,eAAO,MAAM,8BAA8B,GACzC,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,iBAAiB,MAAM,EAAE,6EAEoD,CAAC;AAehF;;;GAGG;AACH,QAAA,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkOrD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAe,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,cAAc,UAAsB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAU,MAAM,KAAG,MAE5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,uBAAuB,EAAE,KAClC,uBAAuB,EAUzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC,GACjD,UAAU,uBAAuB,EAAE,KAClC,uBAAuB,EAMzB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,GAC7B,uBAAuB,EAAE,CA6B3B"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/genericServiceRequest/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAe,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,cAAc,UAAsB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAU,MAAM,KAAG,MAE5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,uBAAuB,EAAE,KAClC,uBAAuB,EAOzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC,GACjD,UAAU,uBAAuB,EAAE,KAClC,uBAAuB,EAMzB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,GAC7B,uBAAuB,EAAE,CA6B3B"}