@bahmni/appointments-app 0.0.1-dev.180 → 0.0.1-dev.184

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,27 +1,27 @@
1
1
  import { jsx as s, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
- import { u as ee, f as re, E as ae, d as te, a as A, H as oe, b as ne, D as se, A as U, e as de, Y as me, G as ie, y as le, Z as q, P as ce, p as ue, T as F, g as be, h as pe, i as _e, j as fe, U as $e, q as ge, W as ve, F as he } from "./index-H6K1pL7a.js";
3
- import { useState as H, useMemo as h, useCallback as R } from "react";
4
- const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Fe = "_observation_1pd36_30", Le = "_groupContainer_1pd36_39", Ce = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Ie = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Me = "_groupMembers_1pd36_75", Ve = "_memberRow_1pd36_81", Se = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Ee = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", xe = "_commentText_1pd36_116", Be = "_nestedGroup_1pd36_125", Ge = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
5
- formsTableBody: ye,
6
- customAccordianItem: Ne,
7
- formContent: Ae,
8
- formDetailsContainer: Re,
9
- observation: Fe,
2
+ import { u as ee, M as re, i as ae, c as te, a as A, S as oe, j as ne, C as se, b as U, f as de, m as me, Y as ie, V as le, d as q, e as ce, P as ue, g as F, h as be, y as pe, x as fe, k as _e, F as $e, l as ve, q as ge, K as he, U as ye } from "./index-Dan8Ownz.js";
3
+ import { useState as z, useMemo as h, useCallback as C } from "react";
4
+ const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Ce = "_formContent_1pd36_18", Fe = "_formDetailsContainer_1pd36_25", Re = "_observation_1pd36_30", Le = "_groupContainer_1pd36_39", Me = "_rowContainer_1pd36_43", Oe = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Ie = "_rowValue_1pd36_67", Se = "_groupMembers_1pd36_75", Te = "_memberRow_1pd36_81", De = "_memberLabel_1pd36_86", we = "_memberValue_1pd36_94", xe = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", o = {
5
+ formsTableBody: Ne,
6
+ customAccordianItem: Ae,
7
+ formContent: Ce,
8
+ formDetailsContainer: Fe,
9
+ observation: Re,
10
10
  groupContainer: Le,
11
- rowContainer: Ce,
11
+ rowContainer: Me,
12
12
  groupLabel: Oe,
13
- rowLabel: Ie,
14
- rowValue: Te,
15
- groupMembers: Me,
16
- memberRow: Ve,
17
- memberLabel: Se,
18
- memberValue: De,
19
- abnormalValue: Ee,
20
- commentSection: we,
21
- commentText: xe,
22
- nestedGroup: Be,
23
- nestedGroupLabel: Ge,
24
- nestedGroupMembers: Ue
13
+ rowLabel: Ve,
14
+ rowValue: Ie,
15
+ groupMembers: Se,
16
+ memberRow: Te,
17
+ memberLabel: De,
18
+ memberValue: we,
19
+ abnormalValue: xe,
20
+ commentSection: Ee,
21
+ commentText: Be,
22
+ nestedGroup: Ge,
23
+ nestedGroupLabel: Ue,
24
+ nestedGroupMembers: qe
25
25
  }, K = (e) => {
26
26
  const r = be(e);
27
27
  return r === "Image" ? /* @__PURE__ */ s(
@@ -31,11 +31,11 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
31
31
  alt: e,
32
32
  id: `${e}-img`
33
33
  }
34
- ) : r === "Video" ? /* @__PURE__ */ s(_e, { id: `${e}-video`, videoSrc: e }) : e;
35
- }, k = (e) => {
34
+ ) : r === "Video" ? /* @__PURE__ */ s(fe, { id: `${e}-video`, videoSrc: e }) : r === "PDF" ? /* @__PURE__ */ s(_e, { id: `${e}-pdf`, src: e }) : e;
35
+ }, j = (e) => {
36
36
  const r = e.observationValue?.unit, n = e.observationValue?.referenceRange?.low?.value, a = e.observationValue?.referenceRange?.high?.value, d = n != null, c = a != null, m = d && c ? ` (${n} - ${a})` : d ? ` (>${n})` : c ? ` (<${a})` : "", t = e.observationValue?.isAbnormal === !0;
37
37
  return { units: r, rangeString: m, isAbnormal: t };
38
- }, j = ({
38
+ }, k = ({
39
39
  member: e,
40
40
  depth: r = 0,
41
41
  memberIndex: n = 0,
@@ -65,7 +65,7 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
65
65
  className: o.nestedGroupMembers,
66
66
  "data-testid": `${t}obs-nested-group-members-${m}-${n}`,
67
67
  children: e.members?.map((y, N) => /* @__PURE__ */ s(
68
- j,
68
+ k,
69
69
  {
70
70
  member: y,
71
71
  depth: r + 1,
@@ -79,7 +79,7 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
79
79
  ]
80
80
  }
81
81
  );
82
- const { units: b, rangeString: g, isAbnormal: _ } = k(e), f = e.observationValue?.value?.toString(), $ = f ? K(f) : null;
82
+ const { units: b, rangeString: v, isAbnormal: f } = j(e), _ = e.observationValue?.value?.toString(), $ = _ ? K(_) : null;
83
83
  return /* @__PURE__ */ p(P, { children: [
84
84
  /* @__PURE__ */ p(
85
85
  "div",
@@ -93,12 +93,12 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
93
93
  {
94
94
  className: F(
95
95
  o.memberLabel,
96
- _ ? o.abnormalValue : ""
96
+ f ? o.abnormalValue : ""
97
97
  ),
98
98
  "data-testid": `${t}obs-member-label-${m}-${n}`,
99
99
  children: [
100
100
  m,
101
- g
101
+ v
102
102
  ]
103
103
  }
104
104
  ),
@@ -107,7 +107,7 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
107
107
  {
108
108
  className: F(
109
109
  o.memberValue,
110
- _ ? o.abnormalValue : ""
110
+ f ? o.abnormalValue : ""
111
111
  ),
112
112
  "data-testid": `${t}obs-member-value-${m}-${n}`,
113
113
  children: [
@@ -132,13 +132,13 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
132
132
  }
133
133
  )
134
134
  ] });
135
- }, qe = ({
135
+ }, ze = ({
136
136
  observation: e,
137
137
  index: r,
138
138
  formName: n = "",
139
139
  comment: a
140
140
  }) => {
141
- const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = k(e), b = n ? `${n}-` : "", g = e.observationValue?.value?.toString(), _ = g ? K(g) : null;
141
+ const d = e.members && e.members.length > 0, { units: c, rangeString: m, isAbnormal: t } = j(e), b = n ? `${n}-` : "", v = e.observationValue?.value?.toString(), f = v ? K(v) : null;
142
142
  return /* @__PURE__ */ p(
143
143
  "div",
144
144
  {
@@ -170,15 +170,15 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
170
170
  {
171
171
  className: o.groupMembers,
172
172
  "data-testid": `${b}observation-group-members-${e.display}-${r}`,
173
- children: e.members?.map((f, $) => /* @__PURE__ */ s(
174
- j,
173
+ children: e.members?.map((_, $) => /* @__PURE__ */ s(
174
+ k,
175
175
  {
176
- member: f,
176
+ member: _,
177
177
  depth: 0,
178
178
  memberIndex: $,
179
179
  formName: n
180
180
  },
181
- `${f.id}`
181
+ `${_.id}`
182
182
  ))
183
183
  }
184
184
  ) : /* @__PURE__ */ p(
@@ -190,7 +190,7 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
190
190
  ),
191
191
  "data-testid": `${b}observation-value-${e.display}-${r}`,
192
192
  children: [
193
- _,
193
+ f,
194
194
  c && ` ${c}`
195
195
  ]
196
196
  }
@@ -213,16 +213,16 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
213
213
  },
214
214
  `${e.id}-${r}`
215
215
  );
216
- }, He = (e) => e ? e.extension?.find(
217
- (r) => r.url === fe
218
- )?.valueString : void 0, Pe = (e) => {
216
+ }, Pe = (e) => e ? e.extension?.find(
217
+ (r) => r.url === $e
218
+ )?.valueString : void 0, Ke = (e) => {
219
219
  if (e)
220
220
  return e.note?.[0]?.text;
221
- }, Ke = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, I = (e, r) => {
222
- const n = Ke(e, r);
221
+ }, je = (e, r) => e.entry?.find((n) => n.resource?.id === r)?.resource, O = (e, r) => {
222
+ const n = je(e, r);
223
223
  return n ? {
224
- formFieldPath: He(n),
225
- comment: Pe(n)
224
+ formFieldPath: Pe(n),
225
+ comment: Ke(n)
226
226
  } : {};
227
227
  }, ke = (e, r) => {
228
228
  if (!e?.entry || !r)
@@ -230,16 +230,16 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
230
230
  const n = ce(e);
231
231
  return [
232
232
  ...n.observations.map((a) => {
233
- const { formFieldPath: d, comment: c } = I(
233
+ const { formFieldPath: d, comment: c } = O(
234
234
  e,
235
235
  a.id
236
236
  );
237
237
  return { obs: a, formFieldPath: d, comment: c };
238
238
  }),
239
239
  ...n.groupedObservations.flatMap((a) => {
240
- const { formFieldPath: d } = I(e, a.id);
240
+ const { formFieldPath: d } = O(e, a.id);
241
241
  return (a.members ?? []).map((c) => {
242
- const { comment: m } = I(e, c.id);
242
+ const { comment: m } = O(e, c.id);
243
243
  return { obs: c, formFieldPath: d, comment: m };
244
244
  });
245
245
  })
@@ -251,75 +251,75 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
251
251
  encounterUuids: r,
252
252
  config: n
253
253
  }) => {
254
- const { t: a } = ee(), d = re(), [c, m] = H(!1), [t, b] = H(null), g = n?.numberOfVisits, _ = ae(
254
+ const { t: a } = ee(), d = re(), [c, m] = z(!1), [t, b] = z(null), v = n?.numberOfVisits, f = ae(
255
255
  e,
256
256
  r
257
- ), f = te(), {
257
+ ), _ = te(), {
258
258
  data: $ = [],
259
259
  isLoading: y,
260
260
  isError: N,
261
- error: Q,
261
+ error: H,
262
262
  refetch: Y
263
263
  } = A({
264
264
  queryKey: ["forms", d, e],
265
- queryFn: () => $e(d, void 0, g),
266
- enabled: !!d && !_
267
- }), T = h(() => !r || r.length === 0 ? $ : $.filter(
265
+ queryFn: () => ve(d, void 0, v),
266
+ enabled: !!d && !f
267
+ }), V = h(() => !r || r.length === 0 ? $ : $.filter(
268
268
  (i) => r.includes(i.encounterUuid)
269
- ), [$, r]), { data: M = [] } = A({
269
+ ), [$, r]), { data: I = [] } = A({
270
270
  queryKey: ["observationForms"],
271
271
  queryFn: () => ge()
272
- }), V = R(
273
- (i) => M.find((u) => u.name === i)?.uuid,
274
- [M]
275
- ), L = h(() => {
272
+ }), S = C(
273
+ (i) => I.find((u) => u.name === i)?.uuid,
274
+ [I]
275
+ ), R = h(() => {
276
276
  if (t)
277
- return V(t.formName);
278
- }, [t, V]), { isLoading: Z, error: S } = A({
279
- queryKey: ["formMetadata", L],
280
- queryFn: () => ve(L),
281
- enabled: !!L && c
277
+ return S(t.formName);
278
+ }, [t, S]), { isLoading: Q, error: T } = A({
279
+ queryKey: ["formMetadata", R],
280
+ queryFn: () => he(R),
281
+ enabled: !!R && c
282
282
  }), {
283
- data: C,
284
- isLoading: z,
283
+ data: L,
284
+ isLoading: Z,
285
285
  error: D
286
286
  } = A({
287
287
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
288
- queryFn: () => he(t.encounterUuid),
288
+ queryFn: () => ye(t.encounterUuid),
289
289
  enabled: !!t?.encounterUuid && c
290
290
  });
291
291
  oe(
292
292
  (i) => {
293
- i.patientUUID === d && i.updatedConcepts.size > 0 && (Y(), f.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
293
+ i.patientUUID === d && i.updatedConcepts.size > 0 && (Y(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
294
294
  },
295
295
  [d]
296
296
  );
297
- const E = h(() => !C || !t?.formName ? [] : ke(
298
- C,
297
+ const w = h(() => !L || !t?.formName ? [] : ke(
298
+ L,
299
299
  t.formName
300
- ), [C, t?.formName]), w = h(
300
+ ), [L, t?.formName]), x = h(
301
301
  () => [
302
302
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
303
303
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
304
304
  ],
305
305
  [a]
306
- ), W = h(
306
+ ), J = h(
307
307
  () => [
308
308
  { key: "recordedOn", sortable: !0 },
309
309
  { key: "recordedBy", sortable: !0 }
310
310
  ],
311
311
  []
312
- ), x = h(() => {
313
- const i = T.reduce(
312
+ ), E = h(() => {
313
+ const i = V.reduce(
314
314
  (u, l) => {
315
- const v = l.formName;
316
- u[v] ??= [];
317
- const O = l.providers.map((J) => J.providerName).filter(Boolean).join(", ");
318
- return u[v].push({
315
+ const g = l.formName;
316
+ u[g] ??= [];
317
+ const M = l.providers.map((X) => X.providerName).filter(Boolean).join(", ");
318
+ return u[g].push({
319
319
  id: l.encounterUuid,
320
320
  formName: l.formName,
321
321
  recordedOn: ne(l.encounterDateTime, a, ue).formattedResult,
322
- recordedBy: O ?? "--",
322
+ recordedBy: M ?? "--",
323
323
  encounterDateTime: l.encounterDateTime,
324
324
  encounterUuid: l.encounterUuid
325
325
  }), u;
@@ -330,15 +330,15 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
330
330
  ([u, l]) => ({
331
331
  formName: u,
332
332
  records: l.sort(
333
- (v, O) => O.encounterDateTime - v.encounterDateTime
333
+ (g, M) => M.encounterDateTime - g.encounterDateTime
334
334
  )
335
335
  })
336
336
  ).sort((u, l) => u.formName.localeCompare(l.formName));
337
- }, [T, a]), B = R((i) => {
337
+ }, [V, a]), B = C((i) => {
338
338
  b(i), m(!0);
339
- }, []), X = R(() => {
339
+ }, []), W = C(() => {
340
340
  m(!1), b(null);
341
- }, []), G = R(
341
+ }, []), G = C(
342
342
  (i, u) => {
343
343
  switch (u) {
344
344
  case "recordedOn":
@@ -352,21 +352,21 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
352
352
  [B]
353
353
  );
354
354
  return /* @__PURE__ */ p(P, { children: [
355
- /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: y || N || x.length === 0 || _ ? /* @__PURE__ */ s(
355
+ /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: y || N || E.length === 0 || f ? /* @__PURE__ */ s(
356
356
  U,
357
357
  {
358
- headers: w,
358
+ headers: x,
359
359
  ariaLabel: a("FORMS_HEADING"),
360
360
  rows: [],
361
361
  loading: y,
362
- errorStateMessage: N ? Q?.message : void 0,
362
+ errorStateMessage: N ? H?.message : void 0,
363
363
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
364
364
  renderCell: G,
365
365
  className: o.formsTableBody,
366
366
  dataTestId: "forms-table"
367
367
  }
368
- ) : /* @__PURE__ */ s(de, { align: "start", children: x.map((i, u) => {
369
- const { formName: l, records: v } = i;
368
+ ) : /* @__PURE__ */ s(de, { align: "start", children: E.map((i, u) => {
369
+ const { formName: l, records: g } = i;
370
370
  return /* @__PURE__ */ s(
371
371
  me,
372
372
  {
@@ -377,12 +377,12 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
377
377
  children: /* @__PURE__ */ s(
378
378
  U,
379
379
  {
380
- headers: w,
380
+ headers: x,
381
381
  ariaLabel: a("FORMS_HEADING"),
382
- rows: v,
382
+ rows: g,
383
383
  loading: !1,
384
384
  errorStateMessage: "",
385
- sortable: W,
385
+ sortable: J,
386
386
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
387
387
  renderCell: G,
388
388
  className: o.formsTableBody,
@@ -399,14 +399,14 @@ const ye = "_formsTableBody_1pd36_1", Ne = "_customAccordianItem_1pd36_6", Ae =
399
399
  id: "modalIdForActionAreaLayout",
400
400
  portalId: "main-display-area",
401
401
  open: c,
402
- onRequestClose: X,
402
+ onRequestClose: W,
403
403
  modalHeading: t.formName,
404
404
  modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
405
405
  passiveModal: !0,
406
406
  size: "md",
407
407
  testId: "form-details-modal",
408
- children: /* @__PURE__ */ s("div", { className: o.formContent, children: Z || z ? /* @__PURE__ */ s(le, { width: "100%", lineCount: 3 }) : S ? /* @__PURE__ */ s("div", { children: q(S).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : D ? /* @__PURE__ */ s("div", { children: q(D).message ?? a("ERROR_FETCHING_FORM_DATA") }) : E.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: E.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
409
- qe,
408
+ children: /* @__PURE__ */ s("div", { className: o.formContent, children: Q || Z ? /* @__PURE__ */ s(le, { width: "100%", lineCount: 3 }) : T ? /* @__PURE__ */ s("div", { children: q(T).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : D ? /* @__PURE__ */ s("div", { children: q(D).message ?? a("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ s("div", { className: o.formDetailsContainer, children: w.map(({ obs: i, comment: u }, l) => /* @__PURE__ */ s(
409
+ ze,
410
410
  {
411
411
  observation: i,
412
412
  index: l,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Cx7-cBu2.js";
2
- import { r as d, s as f, t as e } from "./index-H6K1pL7a.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-ExjRSLUJ.js";
2
+ import { $ as d, a0 as f, a1 as e } from "./index-Dan8Ownz.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,9 +1,9 @@
1
- import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Cx7-cBu2.js";
2
- import { r as v, s as C, t as e } from "./index-H6K1pL7a.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-ExjRSLUJ.js";
2
+ import { $ as v, a0 as C, a1 as e } from "./index-Dan8Ownz.js";
3
3
  var h = (t) => {
4
- const [r, o] = l({
4
+ const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), s = C(() => {
6
+ }), a = v(), l = C(() => {
7
7
  const n = r.theme_preference || c;
8
8
  return n !== "system" ? n : a();
9
9
  });
@@ -16,7 +16,7 @@ var h = (t) => {
16
16
  setLocalStore: o,
17
17
  get children() {
18
18
  return e(i.Provider, {
19
- value: s,
19
+ value: l,
20
20
  get children() {
21
21
  return e(m, {
22
22
  get children() {