@bahmni/registration-app 0.0.1-dev.131 → 0.0.1-dev.135

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,31 +1,30 @@
1
1
  import { jsx as t, jsxs as p, Fragment as J } from "react/jsx-runtime";
2
- import { u as W, C as Q, J as Y, I as Z, $ as ee, S as re, R as ae, c as oe, F as te, q as x, D as ne, a as se, b as me, d as de, v as G, h as ie, W as v } from "./index-D_Nrhuhz.js";
2
+ import { u as W, C as Q, J as Y, I as Z, $ as ee, S as re, R as ae, c as oe, F as te, q as x, D as ne, a as se, b as me, d as de, v as G, h as ie, W as y } from "./index-C2Cjutln.js";
3
3
  import { useQuery as h } from "@tanstack/react-query";
4
- import { useState as q, useMemo as $, useCallback as y } from "react";
5
- import { createPortal as le } from "react-dom";
6
- const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", $e = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", ge = "_rowLabel_1pd36_58", he = "_rowValue_1pd36_67", ye = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", Ae = "_memberLabel_1pd36_86", Me = "_memberValue_1pd36_94", Te = "_abnormalValue_1pd36_102", Le = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
7
- formsTableBody: ce,
8
- customAccordianItem: ue,
9
- formContent: pe,
10
- formDetailsContainer: be,
11
- observation: _e,
12
- groupContainer: fe,
13
- rowContainer: $e,
14
- groupLabel: Ne,
15
- rowLabel: ge,
16
- rowValue: he,
17
- groupMembers: ye,
4
+ import { useState as U, useMemo as $, useCallback as v } from "react";
5
+ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", Ne = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75", ve = "_memberRow_1pd36_81", ye = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Me = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Le = "_nestedGroupMembers_1pd36_141", o = {
6
+ formsTableBody: le,
7
+ customAccordianItem: ce,
8
+ formContent: ue,
9
+ formDetailsContainer: pe,
10
+ observation: be,
11
+ groupContainer: _e,
12
+ rowContainer: fe,
13
+ groupLabel: $e,
14
+ rowLabel: Ne,
15
+ rowValue: ge,
16
+ groupMembers: he,
18
17
  memberRow: ve,
19
- memberLabel: Ae,
20
- memberValue: Me,
21
- abnormalValue: Te,
22
- commentSection: Le,
18
+ memberLabel: ye,
19
+ memberValue: Ae,
20
+ abnormalValue: Me,
21
+ commentSection: Te,
23
22
  commentText: Re,
24
23
  nestedGroup: Ce,
25
24
  nestedGroupLabel: De,
26
- nestedGroupMembers: Oe
27
- }, Fe = "ABNORMAL", U = (e) => {
28
- const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Fe;
25
+ nestedGroupMembers: Le
26
+ }, Oe = "ABNORMAL", q = (e) => {
27
+ const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Oe;
29
28
  return { units: s, rangeString: c, isAbnormal: a };
30
29
  }, k = ({
31
30
  member: e,
@@ -70,7 +69,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
70
69
  ]
71
70
  }
72
71
  );
73
- const { units: a, rangeString: b, isAbnormal: _ } = U(e);
72
+ const { units: a, rangeString: b, isAbnormal: _ } = q(e);
74
73
  return /* @__PURE__ */ p(
75
74
  "div",
76
75
  {
@@ -81,7 +80,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
81
80
  /* @__PURE__ */ p(
82
81
  "p",
83
82
  {
84
- className: v(
83
+ className: y(
85
84
  o.memberLabel,
86
85
  _ ? o.abnormalValue : ""
87
86
  ),
@@ -95,7 +94,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
95
94
  /* @__PURE__ */ p(
96
95
  "p",
97
96
  {
98
- className: v(
97
+ className: y(
99
98
  o.memberValue,
100
99
  _ ? o.abnormalValue : ""
101
100
  ),
@@ -109,12 +108,12 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
109
108
  ]
110
109
  }
111
110
  );
112
- }, Ie = ({
111
+ }, Fe = ({
113
112
  observation: e,
114
113
  index: s,
115
114
  formName: d = ""
116
115
  }) => {
117
- const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = U(e), a = d ? `${d}-` : "";
116
+ const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = q(e), a = d ? `${d}-` : "";
118
117
  return /* @__PURE__ */ p(
119
118
  "div",
120
119
  {
@@ -130,7 +129,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
130
129
  /* @__PURE__ */ p(
131
130
  "p",
132
131
  {
133
- className: v(
132
+ className: y(
134
133
  r ? o.groupLabel : o.rowLabel,
135
134
  !r && c ? o.abnormalValue : ""
136
135
  ),
@@ -160,7 +159,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
160
159
  ) : /* @__PURE__ */ p(
161
160
  "p",
162
161
  {
163
- className: v(
162
+ className: y(
164
163
  o.rowValue,
165
164
  c ? o.abnormalValue : ""
166
165
  ),
@@ -189,37 +188,37 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
189
188
  },
190
189
  `${e.concept.uuid}-${s}`
191
190
  );
192
- }, Ge = ({
191
+ }, Ve = ({
193
192
  episodeOfCareUuids: e,
194
193
  encounterUuids: s,
195
194
  config: d
196
195
  }) => {
197
- const { t: r } = W(), u = Q(), [m, c] = q(!1), [a, b] = q(null), _ = d?.numberOfVisits, N = Y(
196
+ const { t: r } = W(), u = Q(), [m, c] = U(!1), [a, b] = U(null), _ = d?.numberOfVisits, N = Y(
198
197
  e,
199
198
  s
200
199
  ), {
201
200
  data: g = [],
202
- isLoading: L,
203
- isError: R,
204
- error: H
201
+ isLoading: R,
202
+ isError: C,
203
+ error: X
205
204
  } = h({
206
205
  queryKey: ["forms", u, e],
207
206
  queryFn: () => Z(u, void 0, _),
208
207
  enabled: !!u && !N
209
- }), C = $(() => !s || s.length === 0 ? g : g.filter(
208
+ }), D = $(() => !s || s.length === 0 ? g : g.filter(
210
209
  (n) => s.includes(n.encounterUuid)
211
- ), [g, s]), { data: D = [] } = h({
210
+ ), [g, s]), { data: L = [] } = h({
212
211
  queryKey: ["observationForms"],
213
212
  queryFn: () => ee()
214
- }), O = y(
215
- (n) => D.find((l) => l.name === n)?.uuid,
216
- [D]
213
+ }), O = v(
214
+ (n) => L.find((l) => l.name === n)?.uuid,
215
+ [L]
217
216
  ), A = $(() => {
218
217
  if (a)
219
218
  return O(a.formName);
220
219
  }, [a, O]), {
221
- data: we,
222
- isLoading: X,
220
+ data: Ie,
221
+ isLoading: j,
223
222
  error: F
224
223
  } = h({
225
224
  queryKey: ["formMetadata", A],
@@ -227,7 +226,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
227
226
  enabled: !!A && m
228
227
  }), {
229
228
  data: M,
230
- isLoading: j,
229
+ isLoading: H,
231
230
  error: I
232
231
  } = h({
233
232
  queryKey: ["formsEncounter", a?.encounterUuid],
@@ -247,8 +246,8 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
247
246
  { key: "recordedBy", sortable: !0 }
248
247
  ],
249
248
  []
250
- ), B = $(() => {
251
- const n = C.reduce(
249
+ ), E = $(() => {
250
+ const n = D.reduce(
252
251
  (l, i) => {
253
252
  const f = i.formName;
254
253
  l[f] ??= [];
@@ -272,38 +271,38 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
272
271
  )
273
272
  })
274
273
  ).sort((l, i) => l.formName.localeCompare(i.formName));
275
- }, [C, r]), E = y((n) => {
274
+ }, [D, r]), B = v((n) => {
276
275
  b(n), c(!0);
277
- }, []), P = y(() => {
276
+ }, []), P = v(() => {
278
277
  c(!1), b(null);
279
- }, []), V = y(
278
+ }, []), V = v(
280
279
  (n, l) => {
281
280
  switch (l) {
282
281
  case "recordedOn":
283
- return /* @__PURE__ */ t(te, { onClick: () => E(n), children: n.recordedOn });
282
+ return /* @__PURE__ */ t(te, { onClick: () => B(n), children: n.recordedOn });
284
283
  case "recordedBy":
285
284
  return n.recordedBy;
286
285
  default:
287
286
  return null;
288
287
  }
289
288
  },
290
- [E]
289
+ [B]
291
290
  );
292
291
  return /* @__PURE__ */ p(J, { children: [
293
- /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || R || B.length === 0 || N ? /* @__PURE__ */ t(
292
+ /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: R || C || E.length === 0 || N ? /* @__PURE__ */ t(
294
293
  x,
295
294
  {
296
295
  headers: S,
297
296
  ariaLabel: r("FORMS_HEADING"),
298
297
  rows: [],
299
- loading: L,
300
- errorStateMessage: R ? H?.message : void 0,
298
+ loading: R,
299
+ errorStateMessage: C ? X?.message : void 0,
301
300
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
302
301
  renderCell: V,
303
302
  className: o.formsTableBody,
304
303
  dataTestId: "forms-table"
305
304
  }
306
- ) : /* @__PURE__ */ t(ne, { align: "start", children: B.map((n, l) => {
305
+ ) : /* @__PURE__ */ t(ne, { align: "start", children: E.map((n, l) => {
307
306
  const { formName: i, records: f } = n;
308
307
  return /* @__PURE__ */ t(
309
308
  se,
@@ -331,33 +330,30 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
331
330
  i
332
331
  );
333
332
  }) }) }),
334
- m && a && le(
335
- /* @__PURE__ */ t(
336
- me,
337
- {
338
- id: "modalIdForActionAreaLayout",
339
- open: m,
340
- onRequestClose: P,
341
- modalHeading: a.formName,
342
- modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
343
- passiveModal: !0,
344
- size: "md",
345
- testId: "form-details-modal",
346
- children: /* @__PURE__ */ t("div", { className: o.formContent, children: X || j ? /* @__PURE__ */ t(de, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ t("div", { children: G(I).message ?? r("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: w.map((n, l) => /* @__PURE__ */ t(
347
- Ie,
348
- {
349
- observation: n,
350
- index: l,
351
- formName: a.formName
352
- },
353
- `${n.concept.uuid}`
354
- )) }) : /* @__PURE__ */ t("div", { children: r("NO_FORM_DATA_AVAILABLE") }) })
355
- }
356
- ),
357
- document.getElementById("actionAreaLayout") ?? document.body
333
+ m && a && /* @__PURE__ */ t(
334
+ me,
335
+ {
336
+ id: "modalIdForActionAreaLayout",
337
+ open: m,
338
+ onRequestClose: P,
339
+ modalHeading: a.formName,
340
+ modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
341
+ passiveModal: !0,
342
+ size: "md",
343
+ testId: "form-details-modal",
344
+ children: /* @__PURE__ */ t("div", { className: o.formContent, children: j || H ? /* @__PURE__ */ t(de, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : I ? /* @__PURE__ */ t("div", { children: G(I).message ?? r("ERROR_FETCHING_FORM_DATA") }) : w.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: w.map((n, l) => /* @__PURE__ */ t(
345
+ Fe,
346
+ {
347
+ observation: n,
348
+ index: l,
349
+ formName: a.formName
350
+ },
351
+ `${n.concept.uuid}`
352
+ )) }) : /* @__PURE__ */ t("div", { children: r("NO_FORM_DATA_AVAILABLE") }) })
353
+ }
358
354
  )
359
355
  ] });
360
356
  };
361
357
  export {
362
- Ge as default
358
+ Ve as default
363
359
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Dz2qGqyu.js";
2
- import { k as d, l as f, m as e } from "./index-D_Nrhuhz.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-3c5FwiSl.js";
2
+ import { k as d, l as f, m as e } from "./index-C2Cjutln.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-Dz2qGqyu.js";
2
- import { k as v, l as C, m as e } from "./index-D_Nrhuhz.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-3c5FwiSl.js";
2
+ import { k as v, l as C, m as e } from "./index-C2Cjutln.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _, jsx as b } from "react/jsx-runtime";
2
- import { C as F, T as U, u as I, L as X, e as k, o as x, q as K, f as Q, g as D, O as j, j as G, p as H, i as P } from "./index-D_Nrhuhz.js";
2
+ import { C as F, T as U, u as I, L as X, e as k, o as x, q as K, f as Q, g as D, O as j, j as G, p as H, i as P } from "./index-C2Cjutln.js";
3
3
  import { useQueries as Y, useQuery as Z } from "@tanstack/react-query";
4
4
  import { useRef as z, useEffect as T, useMemo as h } from "react";
5
5
  const J = "normal", W = "http://terminology.hl7.org/CodeSystem/referencerange-meaning", ee = "A", te = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", ne = (e, n) => e?.date ? Q(e.date, n).formattedResult : n("DATE_ERROR_PARSE"), re = (e) => {
@@ -1,4 +1,4 @@
1
- import { n as we, r as z, s as xt, t as B, l as q, m as y, P as Ro, w as ye, x as R, y as _, z as k, A as N, B as A, E as bs, G as ir, H as $e, K as U, M as Hn, N as Vn, Q as dt, U as D, V as xs, X as cn, Y as Be, Z as ws, _ as qt, a0 as zt, a1 as $s, a2 as Cs, a3 as $n, a4 as Ss, a5 as Nr, a6 as Bt, a7 as zo, a8 as ks, a9 as Es, aa as j, ab as Ur, ac as Ms, ad as Ds, ae as sr, af as As, ag as Ts, ah as zn, ai as Fs, aj as Is, ak as Z, al as Ps, am as Ls } from "./index-D_Nrhuhz.js";
1
+ import { n as we, r as z, s as xt, t as B, l as q, m as y, P as Ro, w as ye, x as R, y as _, z as k, A as N, B as A, E as bs, G as ir, H as $e, K as U, M as Hn, N as Vn, Q as dt, U as D, V as xs, X as cn, Y as Be, Z as ws, _ as qt, a0 as zt, a1 as $s, a2 as Cs, a3 as $n, a4 as Ss, a5 as Nr, a6 as Bt, a7 as zo, a8 as ks, a9 as Es, aa as j, ab as Ur, ac as Ms, ad as Ds, ae as sr, af as As, ag as Ts, ah as zn, ai as Fs, aj as Is, ak as Z, al as Ps, am as Ls } from "./index-C2Cjutln.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useAddressFields.d.ts","sourceRoot":"","sources":["../../src/hooks/useAddressFields.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,wBAAwB,EAAE,OAAO,CAAC;IAClC,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,YAAY,EAAE,EAC7B,MAAM,EAAE,sBAAsB,EAC9B,cAAc,CAAC,EAAE,WAAW;;;;;;;sBAjCd,MAAM;cACd,MAAM;kBACF,OAAO;;6BAiHP,YAAY,KAAG,OAAO;mCA0DlB,MAAM,gBAAgB,oBAAoB;mCAgD1C,MAAM,SAAS,MAAM;+BAarB,MAAM,KAAG,MAAM,GAAG,SAAS;kCAxF3B,MAAM;;iCAuG4B,WAAW;EAoB5D"}
1
+ {"version":3,"file":"useAddressFields.d.ts","sourceRoot":"","sources":["../../src/hooks/useAddressFields.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,wBAAwB,EAAE,OAAO,CAAC;IAClC,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB;IACtC,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,YAAY,EAAE,EAC7B,MAAM,EAAE,sBAAsB,EAC9B,cAAc,CAAC,EAAE,WAAW;;;;;;;sBAjCd,MAAM;cACd,MAAM;kBACF,OAAO;;6BAiHP,YAAY,KAAG,OAAO;mCAkElB,MAAM,gBAAgB,oBAAoB;mCA+CN,MAAM,SAAS,MAAM;+BAUzD,MAAM,KAAG,MAAM,GAAG,SAAS;kCA5F3B,MAAM;;iCA2G4B,WAAW;EAoB5D"}