@bahmni/widgets 0.0.1-dev.134 → 0.0.1-dev.140

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,9 +1,9 @@
1
- import { jsxs as b, jsx as o, Fragment as Y } from "react/jsx-runtime";
2
- import { c as L, u as J, x as W, z as Z, H as ee, B as te, M as re, X as ae, l as oe, K as U, g as se, a as ne, p as de, b as ce, d as q, e as le } from "./index-xqzBm5Np.js";
1
+ import { jsxs as b, jsx as a, Fragment as Y } from "react/jsx-runtime";
2
+ import { c as L, u as J, K as W, r as Z, e as ee, t as te, G as re, o as oe, l as ae, a as U, g as se, M as ne, p as ce, X as de, b as q, i as le } from "./index-vEmxSiGJ.js";
3
3
  import { useQuery as y } from "@tanstack/react-query";
4
- import { useState as H, useMemo as g, useCallback as M } from "react";
4
+ import { useState as k, useMemo as g, useCallback as M } from "react";
5
5
  import { useTranslation as me } from "react-i18next";
6
- const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Ae = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", Ce = "_nestedGroupLabel_1pd36_132", Fe = "_nestedGroupMembers_1pd36_141", a = {
6
+ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", $e = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Ae = "_commentSection_1pd36_110", Oe = "_commentText_1pd36_116", Re = "_nestedGroup_1pd36_125", Ce = "_nestedGroupLabel_1pd36_132", Fe = "_nestedGroupMembers_1pd36_141", o = {
7
7
  formsTableBody: ie,
8
8
  customAccordianItem: ue,
9
9
  formContent: pe,
@@ -24,13 +24,13 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
24
24
  nestedGroup: Re,
25
25
  nestedGroupLabel: Ce,
26
26
  nestedGroupMembers: Fe
27
- }, ve = "ABNORMAL", k = (e) => {
28
- const s = e.concept?.units, c = e.concept?.lowNormal, t = e.concept?.hiNormal, u = c != null, n = t != null, l = u && n ? ` (${c} - ${t})` : u ? ` (>${c})` : n ? ` (<${t})` : "", r = e.interpretation && e.interpretation.toUpperCase() === ve;
27
+ }, ve = "ABNORMAL", K = (e) => {
28
+ const s = e.concept?.units, d = e.concept?.lowNormal, t = e.concept?.hiNormal, u = d != null, n = t != null, l = u && n ? ` (${d} - ${t})` : u ? ` (>${d})` : n ? ` (<${t})` : "", r = e.interpretation && e.interpretation.toUpperCase() === ve;
29
29
  return { units: s, rangeString: l, isAbnormal: r };
30
30
  }, P = ({
31
31
  member: e,
32
32
  depth: s = 0,
33
- memberIndex: c = 0,
33
+ memberIndex: d = 0,
34
34
  formName: t = ""
35
35
  }) => {
36
36
  const u = e.groupMembers && e.groupMembers.length > 0, n = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, l = t ? `${t}-` : "";
@@ -38,24 +38,24 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
38
38
  return /* @__PURE__ */ b(
39
39
  "div",
40
40
  {
41
- className: a.nestedGroup,
42
- "data-testid": `${l}obs-nested-group-${n}-${c}`,
41
+ className: o.nestedGroup,
42
+ "data-testid": `${l}obs-nested-group-${n}-${d}`,
43
43
  children: [
44
- /* @__PURE__ */ o(
44
+ /* @__PURE__ */ a(
45
45
  "div",
46
46
  {
47
- className: a.nestedGroupLabel,
48
- "data-testid": `${l}obs-nested-group-label-${n}-${c}`,
47
+ className: o.nestedGroupLabel,
48
+ "data-testid": `${l}obs-nested-group-label-${n}-${d}`,
49
49
  style: { paddingLeft: `${s * 16}px` },
50
50
  children: n
51
51
  }
52
52
  ),
53
- /* @__PURE__ */ o(
53
+ /* @__PURE__ */ a(
54
54
  "div",
55
55
  {
56
- className: a.nestedGroupMembers,
57
- "data-testid": `${l}obs-nested-group-members-${n}-${c}`,
58
- children: e.groupMembers?.map((N, $) => /* @__PURE__ */ o(
56
+ className: o.nestedGroupMembers,
57
+ "data-testid": `${l}obs-nested-group-members-${n}-${d}`,
58
+ children: e.groupMembers?.map((N, $) => /* @__PURE__ */ a(
59
59
  P,
60
60
  {
61
61
  member: N,
@@ -70,22 +70,22 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
70
70
  ]
71
71
  }
72
72
  );
73
- const { units: r, rangeString: _, isAbnormal: f } = k(e);
73
+ const { units: r, rangeString: _, isAbnormal: f } = K(e);
74
74
  return /* @__PURE__ */ b(
75
75
  "div",
76
76
  {
77
- className: a.memberRow,
78
- "data-testid": `${l}obs-member-row-${n}-${c}`,
77
+ className: o.memberRow,
78
+ "data-testid": `${l}obs-member-row-${n}-${d}`,
79
79
  style: { paddingLeft: `${s * 16}px` },
80
80
  children: [
81
81
  /* @__PURE__ */ b(
82
82
  "p",
83
83
  {
84
84
  className: L(
85
- a.memberLabel,
86
- f ? a.abnormalValue : ""
85
+ o.memberLabel,
86
+ f ? o.abnormalValue : ""
87
87
  ),
88
- "data-testid": `${l}obs-member-label-${n}-${c}`,
88
+ "data-testid": `${l}obs-member-label-${n}-${d}`,
89
89
  children: [
90
90
  n,
91
91
  _
@@ -96,10 +96,10 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
96
96
  "p",
97
97
  {
98
98
  className: L(
99
- a.memberValue,
100
- f ? a.abnormalValue : ""
99
+ o.memberValue,
100
+ f ? o.abnormalValue : ""
101
101
  ),
102
- "data-testid": `${l}obs-member-value-${n}-${c}`,
102
+ "data-testid": `${l}obs-member-value-${n}-${d}`,
103
103
  children: [
104
104
  e.valueAsString,
105
105
  r && ` ${r}`
@@ -112,47 +112,47 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
112
112
  }, we = ({
113
113
  observation: e,
114
114
  index: s,
115
- formName: c = ""
115
+ formName: d = ""
116
116
  }) => {
117
- const t = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: n, isAbnormal: l } = k(e), r = c ? `${c}-` : "";
117
+ const t = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: n, isAbnormal: l } = K(e), r = d ? `${d}-` : "";
118
118
  return /* @__PURE__ */ b(
119
119
  "div",
120
120
  {
121
- className: a.observation,
121
+ className: o.observation,
122
122
  "data-testid": `${r}observation-item-${e.conceptNameToDisplay}-${s}`,
123
123
  children: [
124
124
  /* @__PURE__ */ b(
125
125
  "div",
126
126
  {
127
- className: t ? a.groupContainer : a.rowContainer,
127
+ className: t ? o.groupContainer : o.rowContainer,
128
128
  "data-testid": `${r}observation-container-${e.conceptNameToDisplay}-${s}`,
129
129
  children: [
130
130
  /* @__PURE__ */ b(
131
131
  "p",
132
132
  {
133
133
  className: L(
134
- t ? a.groupLabel : a.rowLabel,
135
- !t && l ? a.abnormalValue : ""
134
+ t ? o.groupLabel : o.rowLabel,
135
+ !t && l ? o.abnormalValue : ""
136
136
  ),
137
137
  "data-testid": `${r}observation-label-${e.conceptNameToDisplay}-${s}`,
138
138
  children: [
139
139
  e.conceptNameToDisplay,
140
- !t && n && /* @__PURE__ */ o("span", { className: a.rangeInfo, children: n })
140
+ !t && n && /* @__PURE__ */ a("span", { className: o.rangeInfo, children: n })
141
141
  ]
142
142
  }
143
143
  ),
144
- t ? /* @__PURE__ */ o(
144
+ t ? /* @__PURE__ */ a(
145
145
  "div",
146
146
  {
147
- className: a.groupMembers,
147
+ className: o.groupMembers,
148
148
  "data-testid": `${r}observation-group-members-${e.conceptNameToDisplay}-${s}`,
149
- children: e.groupMembers?.map((_, f) => /* @__PURE__ */ o(
149
+ children: e.groupMembers?.map((_, f) => /* @__PURE__ */ a(
150
150
  P,
151
151
  {
152
152
  member: _,
153
153
  depth: 0,
154
154
  memberIndex: f,
155
- formName: c
155
+ formName: d
156
156
  },
157
157
  `${_.concept.uuid}`
158
158
  ))
@@ -161,8 +161,8 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
161
161
  "p",
162
162
  {
163
163
  className: L(
164
- a.rowValue,
165
- l ? a.abnormalValue : ""
164
+ o.rowValue,
165
+ l ? o.abnormalValue : ""
166
166
  ),
167
167
  "data-testid": `${r}observation-value-${e.conceptNameToDisplay}-${s}`,
168
168
  children: [
@@ -174,12 +174,12 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
174
174
  ]
175
175
  }
176
176
  ),
177
- e.comment && /* @__PURE__ */ o(
177
+ e.comment && /* @__PURE__ */ a(
178
178
  "div",
179
179
  {
180
- className: a.commentSection,
180
+ className: o.commentSection,
181
181
  "data-testid": `${r}observation-comment-${e.conceptNameToDisplay}-${s}`,
182
- children: /* @__PURE__ */ b("span", { className: a.commentText, children: [
182
+ children: /* @__PURE__ */ b("span", { className: o.commentText, children: [
183
183
  e.comment,
184
184
  e.providers?.[0]?.name && ` - by ${e.providers[0].name}`
185
185
  ] })
@@ -192,27 +192,27 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
192
192
  }, Ue = ({
193
193
  episodeOfCareUuids: e,
194
194
  encounterUuids: s,
195
- config: c
195
+ config: d
196
196
  }) => {
197
- const { t } = me(), u = J(), [n, l] = H(!1), [r, _] = H(null), f = c?.numberOfVisits, N = W(
197
+ const { t } = me(), u = J(), [n, l] = k(!1), [r, _] = k(null), f = d?.numberOfVisits, N = W(
198
198
  e,
199
199
  s
200
200
  ), {
201
201
  data: $ = [],
202
202
  isLoading: O,
203
203
  isError: R,
204
- error: K
204
+ error: H
205
205
  } = y({
206
206
  queryKey: ["forms", u, e],
207
207
  queryFn: () => Z(u, void 0, f),
208
208
  enabled: !!u && !N
209
209
  }), C = g(() => !s || s.length === 0 ? $ : $.filter(
210
- (d) => s.includes(d.encounterUuid)
210
+ (c) => s.includes(c.encounterUuid)
211
211
  ), [$, s]), { data: F = [] } = y({
212
212
  queryKey: ["observationForms"],
213
213
  queryFn: () => ee()
214
214
  }), v = M(
215
- (d) => F.find((m) => m.name === d)?.uuid,
215
+ (c) => F.find((m) => m.name === c)?.uuid,
216
216
  [F]
217
217
  ), D = g(() => {
218
218
  if (r)
@@ -227,28 +227,28 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
227
227
  enabled: !!D && n
228
228
  }), {
229
229
  data: T,
230
- isLoading: x,
230
+ isLoading: X,
231
231
  error: E
232
232
  } = y({
233
233
  queryKey: ["formsEncounter", r?.encounterUuid],
234
234
  queryFn: () => re(r.encounterUuid, !0),
235
235
  enabled: !!r?.encounterUuid && n
236
- }), B = g(() => !T?.observations || !r?.formName ? [] : T.observations.filter(
236
+ }), I = g(() => !T?.observations || !r?.formName ? [] : T.observations.filter(
237
237
  (p) => "formFieldPath" in p && typeof p.formFieldPath == "string" && p.formFieldPath.includes(r.formName)
238
- ), [T?.observations, r?.formName]), I = g(
238
+ ), [T?.observations, r?.formName]), B = g(
239
239
  () => [
240
240
  { key: "recordedOn", header: t("FORM_RECORDED_ON") },
241
241
  { key: "recordedBy", header: t("FORM_RECORDED_BY") }
242
242
  ],
243
243
  [t]
244
- ), z = g(
244
+ ), x = g(
245
245
  () => [
246
246
  { key: "recordedOn", sortable: !0 },
247
247
  { key: "recordedBy", sortable: !0 }
248
248
  ],
249
249
  []
250
- ), V = g(() => {
251
- const d = C.reduce(
250
+ ), G = g(() => {
251
+ const c = C.reduce(
252
252
  (m, i) => {
253
253
  const h = i.formName;
254
254
  m[h] ??= [];
@@ -256,7 +256,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
256
256
  return m[h].push({
257
257
  id: i.encounterUuid,
258
258
  formName: i.formName,
259
- recordedOn: ae(i.encounterDateTime, t, le).formattedResult,
259
+ recordedOn: oe(i.encounterDateTime, t, le).formattedResult,
260
260
  recordedBy: A ?? "--",
261
261
  encounterDateTime: i.encounterDateTime,
262
262
  encounterUuid: i.encounterUuid
@@ -264,7 +264,7 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
264
264
  },
265
265
  {}
266
266
  );
267
- return Object.entries(d).map(
267
+ return Object.entries(c).map(
268
268
  ([m, i]) => ({
269
269
  formName: m,
270
270
  records: i.sort(
@@ -272,58 +272,58 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
272
272
  )
273
273
  })
274
274
  ).sort((m, i) => m.formName.localeCompare(i.formName));
275
- }, [C, t]), S = M((d) => {
276
- _(d), l(!0);
277
- }, []), X = M(() => {
275
+ }, [C, t]), V = M((c) => {
276
+ _(c), l(!0);
277
+ }, []), z = M(() => {
278
278
  l(!1), _(null);
279
- }, []), G = M(
280
- (d, p) => {
279
+ }, []), S = M(
280
+ (c, p) => {
281
281
  switch (p) {
282
282
  case "recordedOn":
283
- return /* @__PURE__ */ o(oe, { onClick: () => S(d), children: d.recordedOn });
283
+ return /* @__PURE__ */ a(ae, { onClick: () => V(c), children: c.recordedOn });
284
284
  case "recordedBy":
285
- return d.recordedBy;
285
+ return c.recordedBy;
286
286
  default:
287
287
  return null;
288
288
  }
289
289
  },
290
- [S]
290
+ [V]
291
291
  );
292
292
  return /* @__PURE__ */ b(Y, { children: [
293
- /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: O || R || V.length === 0 || N ? /* @__PURE__ */ o(
293
+ /* @__PURE__ */ a("div", { "data-testid": "forms-table", children: O || R || G.length === 0 || N ? /* @__PURE__ */ a(
294
294
  U,
295
295
  {
296
- headers: I,
296
+ headers: B,
297
297
  ariaLabel: t("FORMS_HEADING"),
298
298
  rows: [],
299
299
  loading: O,
300
- errorStateMessage: R ? K?.message : void 0,
300
+ errorStateMessage: R ? H?.message : void 0,
301
301
  emptyStateMessage: t("FORMS_UNAVAILABLE"),
302
- renderCell: G,
303
- className: a.formsTableBody,
302
+ renderCell: S,
303
+ className: o.formsTableBody,
304
304
  dataTestId: "forms-table"
305
305
  }
306
- ) : /* @__PURE__ */ o(se, { align: "start", children: V.map((d, p) => {
307
- const { formName: m, records: i } = d;
308
- return /* @__PURE__ */ o(
306
+ ) : /* @__PURE__ */ a(se, { align: "start", children: G.map((c, p) => {
307
+ const { formName: m, records: i } = c;
308
+ return /* @__PURE__ */ a(
309
309
  ne,
310
310
  {
311
311
  title: m,
312
- className: a.customAccordianItem,
312
+ className: o.customAccordianItem,
313
313
  testId: `accordian-title-${m}`,
314
314
  open: p === 0,
315
- children: /* @__PURE__ */ o(
315
+ children: /* @__PURE__ */ a(
316
316
  U,
317
317
  {
318
- headers: I,
318
+ headers: B,
319
319
  ariaLabel: t("FORMS_HEADING"),
320
320
  rows: i,
321
321
  loading: !1,
322
322
  errorStateMessage: "",
323
- sortable: z,
323
+ sortable: x,
324
324
  emptyStateMessage: t("FORMS_UNAVAILABLE"),
325
- renderCell: G,
326
- className: a.formsTableBody,
325
+ renderCell: S,
326
+ className: o.formsTableBody,
327
327
  dataTestId: `forms-table-${m}`
328
328
  }
329
329
  )
@@ -331,26 +331,26 @@ const ie = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
331
331
  m
332
332
  );
333
333
  }) }) }),
334
- n && r && /* @__PURE__ */ o(
335
- de,
334
+ n && r && /* @__PURE__ */ a(
335
+ ce,
336
336
  {
337
337
  id: "modalIdForActionAreaLayout",
338
338
  open: n,
339
- onRequestClose: X,
339
+ onRequestClose: z,
340
340
  modalHeading: r.formName,
341
341
  modalLabel: `${r.recordedOn} | ${r.recordedBy}`,
342
342
  passiveModal: !0,
343
343
  size: "md",
344
344
  testId: "form-details-modal",
345
- children: /* @__PURE__ */ o("div", { className: a.formContent, children: j || x ? /* @__PURE__ */ o(ce, { width: "100%", lineCount: 3 }) : w ? /* @__PURE__ */ o("div", { children: q(w).message ?? t("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ o("div", { children: q(E).message ?? t("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ o("div", { className: a.formDetailsContainer, children: B.map((d, p) => /* @__PURE__ */ o(
345
+ children: /* @__PURE__ */ a("div", { className: o.formContent, children: j || X ? /* @__PURE__ */ a(de, { width: "100%", lineCount: 3 }) : w ? /* @__PURE__ */ a("div", { children: q(w).message ?? t("ERROR_FETCHING_FORM_METADATA") }) : E ? /* @__PURE__ */ a("div", { children: q(E).message ?? t("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ a("div", { className: o.formDetailsContainer, children: I.map((c, p) => /* @__PURE__ */ a(
346
346
  we,
347
347
  {
348
- observation: d,
348
+ observation: c,
349
349
  index: p,
350
350
  formName: r.formName
351
351
  },
352
- `${d.concept.uuid}`
353
- )) }) : /* @__PURE__ */ o("div", { children: t("NO_FORM_DATA_AVAILABLE") }) })
352
+ `${c.concept.uuid}`
353
+ )) }) : /* @__PURE__ */ a("div", { children: t("NO_FORM_DATA_AVAILABLE") }) })
354
354
  }
355
355
  )
356
356
  ] });
@@ -1,5 +1,5 @@
1
1
  import { jsx as v, jsxs as _ } from "react/jsx-runtime";
2
- import { J as F, L as N, f as K, h as k, i as q, V as Q, u as G, j as P, k as x, C as H, T as j, K as Y } from "./index-xqzBm5Np.js";
2
+ import { d as F, L as N, w as q, z as K, H as Q, V as k, u as G, f as H, h as P, B as x, T as Y, a as j } from "./index-vEmxSiGJ.js";
3
3
  import { useQueries as z, useQuery as J } from "@tanstack/react-query";
4
4
  import { useRef as W, useEffect as S, useMemo as y } from "react";
5
5
  import { useTranslation as A } from "react-i18next";
@@ -113,9 +113,9 @@ function ue(e, n) {
113
113
  location: t.location?.[0]?.location?.display
114
114
  };
115
115
  }
116
- function D(e, n, t) {
116
+ function w(e, n, t) {
117
117
  const s = O(e.encounter), r = (e.hasMember ?? []).map((o) => O(o)).map((o) => o ? t.get(o) : void 0).filter((o) => !!o).map(
118
- (o) => D(o, n, t)
118
+ (o) => w(o, n, t)
119
119
  );
120
120
  return {
121
121
  id: e.id,
@@ -138,7 +138,7 @@ function ce(e) {
138
138
  const r = [], o = [];
139
139
  return t.forEach((i, a) => {
140
140
  if (s.has(a)) return;
141
- const u = D(
141
+ const u = w(
142
142
  i,
143
143
  n,
144
144
  t
@@ -178,15 +178,15 @@ function de(e) {
178
178
  return !s && !r ? 0 : s ? r ? new Date(r).getTime() - new Date(s).getTime() : -1 : 1;
179
179
  });
180
180
  }
181
- const w = (e, n, t, s, r) => {
182
- const o = se(e, n), i = o.value, a = K(i);
181
+ const D = (e, n, t, s, r) => {
182
+ const o = se(e, n), i = o.value, a = q(i);
183
183
  let u = i;
184
- a === "Image" && (u = /* @__PURE__ */ v(q, { imageSrc: i, alt: i, id: `${i}-img` })), a === "Video" && (u = /* @__PURE__ */ v(Q, { id: `${i}-video`, videoSrc: i }));
184
+ a === "Image" && (u = /* @__PURE__ */ v(Q, { imageSrc: i, alt: i, id: `${i}-img` })), a === "Video" && (u = /* @__PURE__ */ v(k, { id: `${i}-video`, videoSrc: i }));
185
185
  const c = r("OBSERVATIONS_RECORDED_BY", {
186
186
  provider: o.provider
187
187
  }), d = e.display, f = e.observationValue?.isAbnormal ? "abnormal-obs" : "obs", m = s ? `${s}-${f}-${d}-${t}-${n}` : `${f}-${d}-${t}-${n}`;
188
188
  return /* @__PURE__ */ v(
189
- k,
189
+ K,
190
190
  {
191
191
  header: o.header,
192
192
  value: u,
@@ -204,7 +204,7 @@ const w = (e, n, t, s, r) => {
204
204
  id: `grouped-obs-${e.display}-${s}`,
205
205
  open: t,
206
206
  children: e.children.map(
207
- (i, a) => w(i, a, r, o, n)
207
+ (i, a) => D(i, a, r, o, n)
208
208
  )
209
209
  },
210
210
  `grouped-obs-${e.id}`
@@ -222,7 +222,7 @@ const w = (e, n, t, s, r) => {
222
222
  open: o,
223
223
  children: [
224
224
  r.observations.map(
225
- (u, c) => w(u, c, i, n, t)
225
+ (u, c) => D(u, c, i, n, t)
226
226
  ),
227
227
  r.groupedObservations.map(
228
228
  (u, c) => ve(
@@ -254,10 +254,10 @@ const w = (e, n, t, s, r) => {
254
254
  observations: fe,
255
255
  title: ge
256
256
  }, me = (e) => ["conceptUuid", e], be = (e, n) => ["observations", e, ...n], $e = ({ config: e }) => {
257
- const n = e, { conceptNames: t = [], conceptUuid: s = [] } = n, r = W(/* @__PURE__ */ new Set()), o = G(), { addNotification: i } = P(), { t: a } = A(), u = z({
257
+ const n = e, { conceptNames: t = [], conceptUuid: s = [] } = n, r = W(/* @__PURE__ */ new Set()), o = G(), { addNotification: i } = H(), { t: a } = A(), u = z({
258
258
  queries: t.map((l) => ({
259
259
  queryKey: me(l),
260
- queryFn: () => x(l),
260
+ queryFn: () => P(l),
261
261
  enabled: !!l
262
262
  }))
263
263
  });
@@ -279,7 +279,7 @@ const w = (e, n, t, s, r) => {
279
279
  isError: E
280
280
  } = J({
281
281
  queryKey: be(o, d),
282
- queryFn: () => H(o, d),
282
+ queryFn: () => x(o, d),
283
283
  enabled: !!o && d.length > 0 && p
284
284
  });
285
285
  S(() => {
@@ -307,7 +307,7 @@ const w = (e, n, t, s, r) => {
307
307
  className: I.observations,
308
308
  children: [
309
309
  /* @__PURE__ */ v(
310
- j,
310
+ Y,
311
311
  {
312
312
  id: "observations-title",
313
313
  testId: h ? `observations-title-${b}` : "observations-title",
@@ -317,7 +317,7 @@ const w = (e, n, t, s, r) => {
317
317
  }
318
318
  ),
319
319
  L ? /* @__PURE__ */ v(pe, { groupedData: R, title: b }) : /* @__PURE__ */ v(
320
- Y,
320
+ j,
321
321
  {
322
322
  headers: C,
323
323
  rows: [],
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { WidgetProps } from '../registry/model';
3
+ declare const AppointmentsTable: React.FC<WidgetProps>;
4
+ export default AppointmentsTable;
5
+ //# sourceMappingURL=AppointmentsTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA8EhD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6N5C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const APPOINTMENT_STATUS: {
2
+ readonly SCHEDULED: "scheduled";
3
+ readonly CONFIRMED: "confirmed";
4
+ readonly COMPLETED: "completed";
5
+ readonly CANCELLED: "cancelled";
6
+ readonly MISSED: "missed";
7
+ readonly WAITLIST: "waitlist";
8
+ readonly CHECKEDIN: "checkedin";
9
+ };
10
+ export declare const APPOINTMENT_STATUS_CLASS_MAP: Record<string, string>;
11
+ export declare const APPOINTMENT_STATUS_TRANSLATION_MAP: Record<string, string>;
12
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/appointments/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;CAQrB,CAAC;AAEX,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQ/D,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQrE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as AppointmentsTable } from './AppointmentsTable';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appointments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Appointment } from '@bahmni/services';
2
+ export interface FormattedAppointment extends Appointment {
3
+ id?: string;
4
+ appointmentDate: string;
5
+ appointmentTime: string;
6
+ appointmentSlot?: string;
7
+ reason?: string;
8
+ }
9
+ export declare const formatAppointment: (appointment: Appointment & {
10
+ appointmentSlot?: string;
11
+ appointmentNumber?: string;
12
+ }) => FormattedAppointment;
13
+ export declare const sortAppointmentsByDate: (appointments: FormattedAppointment[]) => FormattedAppointment[];
14
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/appointments/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkCD,eAAO,MAAM,iBAAiB,GAC5B,aAAa,WAAW,GAAG;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,KACA,oBAyCF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,cAAc,oBAAoB,EAAE,KACnC,oBAAoB,EAiBtB,CAAC"}