@bahmni/registration-app 0.0.1-dev.171 → 0.0.1-dev.173

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 (43) hide show
  1. package/dist/{DocumentsTable-TPfrZJSk-CnPlwf3u.js → DocumentsTable-DV_nkz4--BGsIQv3U.js} +1 -1
  2. package/dist/{FormsTable-BSKlMAJe-BWz6Ww8f.js → FormsTable-DL_zg0dG-Dtzz6_q4.js} +97 -97
  3. package/dist/{LNWAZHJI-DYHV_n8s.js → LNWAZHJI-hJhqylVc.js} +5 -5
  4. package/dist/{MWZ6AO7Z-DgMjJOza.js → MWZ6AO7Z-Bh8B_EOv.js} +7 -7
  5. package/dist/{Observations-Diygv8o5-VWfyxp1Z.js → Observations-c94Dp42v-gtJn7WfV.js} +52 -52
  6. package/dist/{YPM2AS64-Dyj543hX.js → YPM2AS64-COjNsPdl.js} +181 -181
  7. package/dist/components/forms/additionalInfo/AdditionalInfo.d.ts.map +1 -1
  8. package/dist/components/forms/contactInfo/ContactInfo.d.ts.map +1 -1
  9. package/dist/components/forms/profile/Profile.d.ts.map +1 -1
  10. package/dist/components/registrationActions/RegistrationActions.d.ts.map +1 -1
  11. package/dist/constants/app.d.ts +1 -0
  12. package/dist/constants/app.d.ts.map +1 -1
  13. package/dist/hooks/useAddressFieldsWithConfig.d.ts.map +1 -1
  14. package/dist/hooks/useFilteredExtensions.d.ts +1 -1
  15. package/dist/hooks/useFilteredExtensions.d.ts.map +1 -1
  16. package/dist/{index-Qc9d1D1J.js → index-DAYe3WiF.js} +33612 -33605
  17. package/dist/index.css +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/locales/locale_en.json +3 -0
  20. package/dist/locales/locale_es.json +2 -0
  21. package/dist/pages/patientSearchPage/index.d.ts.map +1 -1
  22. package/dist/providers/registrationConfig/constants.d.ts +2 -0
  23. package/dist/providers/registrationConfig/constants.d.ts.map +1 -0
  24. package/dist/providers/registrationConfig/context.d.ts +3 -0
  25. package/dist/providers/registrationConfig/context.d.ts.map +1 -0
  26. package/dist/providers/registrationConfig/hook.d.ts +3 -0
  27. package/dist/providers/registrationConfig/hook.d.ts.map +1 -0
  28. package/dist/providers/registrationConfig/index.d.ts +5 -0
  29. package/dist/providers/registrationConfig/index.d.ts.map +1 -0
  30. package/dist/providers/registrationConfig/models.d.ts +84 -0
  31. package/dist/providers/registrationConfig/models.d.ts.map +1 -0
  32. package/dist/providers/registrationConfig/provider.d.ts +4 -0
  33. package/dist/providers/registrationConfig/provider.d.ts.map +1 -0
  34. package/dist/providers/registrationConfig/schema.json.d.ts +406 -0
  35. package/package.json +1 -1
  36. package/dist/contexts/RegistrationConfigContext.d.ts +0 -3
  37. package/dist/contexts/RegistrationConfigContext.d.ts.map +0 -1
  38. package/dist/hooks/useRegistrationConfig.d.ts +0 -3
  39. package/dist/hooks/useRegistrationConfig.d.ts.map +0 -1
  40. package/dist/models/registrationConfig.d.ts +0 -15
  41. package/dist/models/registrationConfig.d.ts.map +0 -1
  42. package/dist/providers/RegistrationConfigProvider.d.ts +0 -9
  43. package/dist/providers/RegistrationConfigProvider.d.ts.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
- import { p as B, f as K, u as N, K as V, l as Q, a as w, d as G, m as j, s as x, n as z, z as H, o as M, A as S, q as P, h as W, D as X, _ as Y, j as J } from "./index-Qc9d1D1J.js";
2
+ import { f as B, n as V, u as N, R as w, h as K, e as Q, $ as j, i as x, j as z, l as G, z as H, q as M, m as S, U as P, D as W, o as X, d as Y, w as J } from "./index-DAYe3WiF.js";
3
3
  import { useQueries as Z, useQuery as ee } from "@tanstack/react-query";
4
- import { useRef as te, useEffect as $, useMemo as f } from "react";
5
- const A = (t, d, i, l, r) => {
6
- const a = P(t, d), s = a.value, o = W(s);
7
- let n = s;
8
- o === "Image" && (n = /* @__PURE__ */ c(Y, { imageSrc: s, alt: s, id: `${s}-img` })), o === "Video" && (n = /* @__PURE__ */ c(J, { id: `${s}-video`, videoSrc: s }));
9
- const b = r("OBSERVATIONS_RECORDED_BY", {
4
+ import { useRef as te, useEffect as _, useMemo as E } from "react";
5
+ const D = (t, d, i, l, s) => {
6
+ const a = P(t, d), r = a.value, o = W(r);
7
+ let n = r;
8
+ o === "Image" && (n = /* @__PURE__ */ c(Y, { imageSrc: r, alt: r, id: `${r}-img` })), o === "Video" && (n = /* @__PURE__ */ c(J, { id: `${r}-video`, videoSrc: r }));
9
+ const b = s("OBSERVATIONS_RECORDED_BY", {
10
10
  provider: a.provider
11
11
  }), p = t.display, v = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", u = l ? `${l}-${v}-${p}-${i}-${d}` : `${v}-${p}-${i}-${d}`;
12
12
  return /* @__PURE__ */ c(
@@ -21,46 +21,46 @@ const A = (t, d, i, l, r) => {
21
21
  },
22
22
  `obs-${t.id}`
23
23
  );
24
- }, ae = (t, d, i, l, r, a) => /* @__PURE__ */ c(
24
+ }, ae = (t, d, i, l, s, a) => /* @__PURE__ */ c(
25
25
  S,
26
26
  {
27
27
  title: t.display,
28
28
  id: `grouped-obs-${t.display}-${l}`,
29
29
  open: i,
30
30
  children: t.members?.map(
31
- (s, o) => A(s, o, r, a, d)
31
+ (r, o) => D(r, o, s, a, d)
32
32
  )
33
33
  },
34
34
  `grouped-obs-${t.id}`
35
- ), re = ({
35
+ ), se = ({
36
36
  groupedData: t,
37
37
  title: d = ""
38
38
  }) => {
39
- const { t: i } = N(), l = (r, a, s) => {
40
- const o = M(r.encounterDetails, i);
39
+ const { t: i } = N(), l = (s, a, r) => {
40
+ const o = M(s.encounterDetails, i);
41
41
  return /* @__PURE__ */ I(
42
42
  S,
43
43
  {
44
44
  title: o,
45
- id: `encounter-${r.encounterId}`,
45
+ id: `encounter-${s.encounterId}`,
46
46
  open: a,
47
47
  children: [
48
- r.observations.map(
49
- (n, b) => A(n, b, s, d, i)
48
+ s.observations.map(
49
+ (n, b) => D(n, b, r, d, i)
50
50
  ),
51
- r.groupedObservations.map(
51
+ s.groupedObservations.map(
52
52
  (n, b) => ae(
53
53
  n,
54
54
  i,
55
55
  a,
56
56
  b,
57
- s,
57
+ r,
58
58
  d
59
59
  )
60
60
  )
61
61
  ]
62
62
  },
63
- `encounter-${r.encounterId}`
63
+ `encounter-${s.encounterId}`
64
64
  );
65
65
  };
66
66
  return /* @__PURE__ */ c(
@@ -70,93 +70,93 @@ const A = (t, d, i, l, r) => {
70
70
  "data-testid": "obs-by-encounter-test-id",
71
71
  "aria-label": "obs-by-encounter-aria-label",
72
72
  children: t.map(
73
- (r, a) => l(r, a === 0, a)
73
+ (s, a) => l(s, a === 0, a)
74
74
  )
75
75
  }
76
76
  );
77
- }, se = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
78
- observations: se,
77
+ }, re = "_observations_kfbhq_1", oe = "_title_kfbhq_12", T = {
78
+ observations: re,
79
79
  title: oe
80
80
  }, ie = (t) => ["conceptUuid", t], ne = (t, d) => ["observations", t, ...d], be = ({ config: t }) => {
81
- const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, r = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: s } = K(), { t: o } = N(), n = Z({
81
+ const d = t, { conceptNames: i = [], conceptUuid: l = [] } = d, s = te(/* @__PURE__ */ new Set()), a = B(), { addNotification: r } = V(), { t: o } = N(), n = Z({
82
82
  queries: i.map((e) => ({
83
83
  queryKey: ie(e),
84
- queryFn: () => V(e),
84
+ queryFn: () => w(e),
85
85
  enabled: !!e
86
86
  }))
87
87
  });
88
- $(() => {
88
+ _(() => {
89
89
  n.forEach((e, m) => {
90
- if (e.isError && !r.current.has(m)) {
90
+ if (e.isError && !s.current.has(m)) {
91
91
  const k = i[m];
92
- s({
92
+ r({
93
93
  title: o("ERROR_DEFAULT_TITLE"),
94
94
  message: o("ERROR_FETCHING_CONCEPT", { conceptName: k }),
95
95
  type: "error"
96
- }), r.current.add(m);
97
- } else e.isError || r.current.delete(m);
96
+ }), s.current.add(m);
97
+ } else e.isError || s.current.delete(m);
98
98
  });
99
99
  }, [n, i]);
100
- const b = f(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = f(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = f(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
100
+ const b = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), p = E(() => [.../* @__PURE__ */ new Set([...b, ...l])], [b, l]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
101
101
  data: u,
102
- isLoading: D,
103
- isError: h,
104
- refetch: R
102
+ isLoading: U,
103
+ isError: f,
104
+ refetch: g
105
105
  } = ee({
106
106
  queryKey: ne(a, p),
107
- queryFn: () => Q(a, p),
107
+ queryFn: () => K(a, p),
108
108
  enabled: !!a && p.length > 0 && v
109
109
  });
110
- w(
110
+ Q(
111
111
  (e) => {
112
112
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
113
113
  (m) => p.includes(m)
114
- ) && R();
114
+ ) && g();
115
115
  },
116
- [a, R]
117
- ), $(() => {
118
- h && s({
116
+ [a, g]
117
+ ), _(() => {
118
+ f && r({
119
119
  title: o("ERROR_DEFAULT_TITLE"),
120
120
  message: o("ERROR_FETCHING_OBSERVATIONS"),
121
121
  type: "error"
122
122
  });
123
- }, [h]);
124
- const _ = f(() => {
123
+ }, [f]);
124
+ const h = E(() => {
125
125
  if (!u) return [];
126
- const e = G(u), m = j(e);
127
- return x(m);
128
- }, [u]), C = [
126
+ const e = j(u), m = x(e);
127
+ return z(m);
128
+ }, [u]), q = [
129
129
  { key: "name", header: "name" },
130
130
  { key: "value", header: "value" },
131
131
  { key: "form", header: "form" }
132
- ], g = D || !v, O = h && v, F = (!u || u.entry?.length === 0 || p.length === 0) && v, L = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = F ? o("NO_OBSERVATIONS_FOUND") : void 0, q = _.length > 0 && !g && !O, E = d.titleTranslationKey, y = E ? o(E) : "";
132
+ ], $ = U || !v, O = f && v, A = (!u || u.entry?.length === 0 || p.length === 0) && v, C = O ? o("ERROR_FETCHING_OBSERVATIONS") : null, F = A ? o("NO_OBSERVATIONS_FOUND") : void 0, L = h.length > 0 && !$ && !O, R = d.titleTranslationKey, y = R ? o(R) : "";
133
133
  return /* @__PURE__ */ I(
134
134
  "div",
135
135
  {
136
136
  id: "observations",
137
- "data-testid": E ? `observations-${y}` : "observations",
137
+ "data-testid": R ? `observations-${y}` : "observations",
138
138
  "aria-label": "observations-aria-label",
139
139
  className: T.observations,
140
140
  children: [
141
141
  /* @__PURE__ */ c(
142
- z,
142
+ G,
143
143
  {
144
144
  id: "observations-title",
145
- testId: E ? `observations-title-${y}` : "observations-title",
145
+ testId: R ? `observations-title-${y}` : "observations-title",
146
146
  title: y,
147
147
  className: T.title,
148
148
  children: /* @__PURE__ */ c("p", { children: y })
149
149
  }
150
150
  ),
151
- q ? /* @__PURE__ */ c(re, { groupedData: _, title: y }) : /* @__PURE__ */ c(
151
+ L ? /* @__PURE__ */ c(se, { groupedData: h, title: y }) : /* @__PURE__ */ c(
152
152
  H,
153
153
  {
154
- headers: C,
154
+ headers: q,
155
155
  rows: [],
156
156
  ariaLabel: o("OBSERVATIONS"),
157
- loading: g,
158
- errorStateMessage: L,
159
- emptyStateMessage: U,
157
+ loading: $,
158
+ errorStateMessage: C,
159
+ emptyStateMessage: F,
160
160
  dataTestId: "observations-table"
161
161
  }
162
162
  )