@bahmni/widgets 0.0.1-dev.193 → 0.0.1-dev.195

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,17 +1,17 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { k, l as C, t as M, Q as V, J as q, r as K, o as w, e as G, u as P, a as H, Y, L as j, i as J, g as z, m as W, n as X, p as Z, c as x } from "./index-D3jK_TZZ.js";
2
+ import { l as M, m as C, t as V, X as q, J as w, r as K, o as Q, d as G, u as P, a as j, n as H, p as J, j as X, e as z, s as W, v as Y, w as Z, c as x } from "./index-DfF8askw.js";
3
3
  import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as h } from "react";
5
5
  import { useTranslation as D } from "react-i18next";
6
6
  const U = (t, c, i, l, r) => {
7
- const s = M(t, c, r), o = s.value, a = V(o);
7
+ const s = V(t, c, r), o = s.value, a = q(o);
8
8
  let n = o;
9
- a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(w, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
9
+ a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
10
10
  const u = r("OBSERVATIONS_RECORDED_BY", {
11
11
  provider: s.provider
12
12
  }), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
13
13
  return /* @__PURE__ */ d(
14
- q,
14
+ w,
15
15
  {
16
16
  header: s.header,
17
17
  value: n,
@@ -38,7 +38,7 @@ const U = (t, c, i, l, r) => {
38
38
  title: c = ""
39
39
  }) => {
40
40
  const { t: i } = D(), l = (r, s, o) => {
41
- const a = k(r.encounterDetails, i);
41
+ const a = M(r.encounterDetails, i);
42
42
  return /* @__PURE__ */ S(
43
43
  C,
44
44
  {
@@ -79,20 +79,20 @@ const U = (t, c, i, l, r) => {
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, r = se(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = H(), { t: a } = D(), n = ee({
82
+ const c = t, { conceptNames: i = [], conceptUuid: l = [] } = c, r = se(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = j(), { t: a } = D(), n = ee({
83
83
  queries: i.map((e) => ({
84
84
  queryKey: ie(e),
85
- queryFn: () => Y(e),
85
+ queryFn: () => H(e),
86
86
  enabled: !!e
87
87
  }))
88
88
  });
89
89
  $(() => {
90
90
  n.forEach((e, m) => {
91
91
  if (e.isError && !r.current.has(m)) {
92
- const O = i[m];
92
+ const g = i[m];
93
93
  o({
94
94
  title: a("ERROR_DEFAULT_TITLE"),
95
- message: a("ERROR_FETCHING_CONCEPT", { conceptName: O }),
95
+ message: a("ERROR_FETCHING_CONCEPT", { conceptName: g }),
96
96
  type: "error"
97
97
  }), r.current.add(m);
98
98
  } else e.isError || r.current.delete(m);
@@ -101,36 +101,36 @@ const U = (t, c, i, l, r) => {
101
101
  const u = h(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = h(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = h(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
102
102
  data: p,
103
103
  isLoading: f,
104
- isError: g,
104
+ isError: O,
105
105
  refetch: R
106
106
  } = te({
107
107
  queryKey: ce(s, b),
108
- queryFn: () => j(s, b),
108
+ queryFn: () => J(s, b),
109
109
  enabled: !!s && b.length > 0 && v
110
110
  });
111
- J(
111
+ X(
112
112
  (e) => {
113
113
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
114
- (O) => b.includes(O)
114
+ (g) => b.includes(g)
115
115
  ) && R();
116
116
  },
117
117
  [s, R]
118
118
  ), $(() => {
119
- g && o({
119
+ O && o({
120
120
  title: a("ERROR_DEFAULT_TITLE"),
121
121
  message: a("ERROR_FETCHING_OBSERVATIONS"),
122
122
  type: "error"
123
123
  });
124
- }, [g]);
124
+ }, [O]);
125
125
  const T = h(() => {
126
126
  if (!p) return [];
127
127
  const e = z(p), m = W(e);
128
- return X(m);
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
- ], I = f || !v, _ = g && v, L = (!p || p.entry?.length === 0 || b.length === 0) && v, A = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? a("NO_OBSERVATIONS_FOUND") : void 0, Q = T.length > 0 && !I && !_, E = c.titleTranslationKey, y = E ? a(E) : "";
133
+ ], I = f || !v, _ = O && v, A = (!p || p.entry?.length === 0 || b.length === 0) && v, F = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, L = A ? a("NO_OBSERVATIONS_FOUND") : void 0, k = T.length > 0 && !I && !_, E = c.titleTranslationKey, y = E ? a(E) : "";
134
134
  return /* @__PURE__ */ S(
135
135
  "div",
136
136
  {
@@ -149,15 +149,15 @@ const U = (t, c, i, l, r) => {
149
149
  children: /* @__PURE__ */ d("p", { children: y })
150
150
  }
151
151
  ),
152
- Q ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
152
+ k ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
153
153
  x,
154
154
  {
155
155
  headers: B,
156
156
  rows: [],
157
157
  ariaLabel: a("OBSERVATIONS"),
158
158
  loading: I,
159
- errorStateMessage: A,
160
- emptyStateMessage: F,
159
+ errorStateMessage: F,
160
+ emptyStateMessage: L,
161
161
  dataTestId: "observations-table"
162
162
  }
163
163
  )
@@ -1 +1 @@
1
- {"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"AASA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4I5C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0J5C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -3,7 +3,8 @@ export interface FormattedAppointment {
3
3
  readonly uuid: string;
4
4
  readonly appointmentNumber: string;
5
5
  readonly appointmentDate: string;
6
- readonly appointmentSlot: string;
6
+ readonly appointmentStartTime: string;
7
+ readonly appointmentEndTime?: string;
7
8
  readonly service: string;
8
9
  readonly reason: string;
9
10
  readonly status: string;
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/appointments/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/appointments/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/appointments/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AA8FrC,eAAO,MAAM,sBAAsB,GACjC,cAAc,oBAAoB,EAAE,KACnC,oBAAoB,EAatB,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAC9C,UAAU,eAAe,KACxB,oBAAkE,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/appointments/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,YAAY,EAAE,oBAAoB,EAAE,CAAC;AA0DrC,eAAO,MAAM,sBAAsB,GACjC,cAAc,oBAAoB,EAAE,KACnC,oBAAoB,EAatB,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAC9C,UAAU,eAAe,KACxB,oBAAkE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAsBhD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmOzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DocumentsTable.d.ts","sourceRoot":"","sources":["../../src/documents/DocumentsTable.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBhD,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoOzC,CAAC;AAEF,eAAe,cAAc,CAAC"}