@bahmni/registration-app 0.0.1-dev.234 → 0.0.1-dev.236

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,5 +1,5 @@
1
1
  import { jsx as r, jsxs as _, Fragment as Y } from "react/jsx-runtime";
2
- import { t as K, u as Q, r as W, p as J, x as X, V as Z, o as ee, s as te } from "./index-C8FL8_cr.js";
2
+ import { t as K, u as Q, r as W, p as J, x as X, V as Z, o as ee, s as te } from "./index-DxSWsxDQ.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as m, useCallback as h, useEffect as f, useMemo as T } from "react";
5
5
  const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", me = "_documentImage_1voj8_50", d = {
@@ -1,18 +1,18 @@
1
1
  import { jsx as s, jsxs as W, Fragment as X } from "react/jsx-runtime";
2
- import { u as Z, t as ee, g as re, h as ae, d as te, a as oe, c as se, k as ne, b as v, V as de, x as ie, o as q, J as ue, Q as me, s as le, e as ce, f as fe } from "./index-C8FL8_cr.js";
2
+ import { u as Z, t as ee, g as re, h as ae, d as te, a as oe, c as se, k as ne, b as v, V as de, x as ie, o as S, J as ue, Q as me, s as le, e as ce, f as fe } from "./index-DxSWsxDQ.js";
3
3
  import { useQueryClient as ye, useQuery as c } from "@tanstack/react-query";
4
4
  import { useState as C, useMemo as d, useCallback as f } from "react";
5
- const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
5
+ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", O = {
6
6
  formsTableBody: be,
7
7
  customAccordianItem: ge
8
8
  }, pe = (u) => u ? u.extension?.find(
9
9
  (n) => n.url === fe
10
- )?.valueString : void 0, Ae = ({
10
+ )?.valueString : void 0, Ie = ({
11
11
  episodeOfCareUuids: u,
12
12
  encounterUuids: n,
13
- config: S
13
+ config: k
14
14
  }) => {
15
- const { t: o } = Z(), m = ee(), [l, O] = C(!1), [t, A] = C(null), { numberOfVisits: k, hideThumbnail: V = !1 } = S ?? {}, T = re(
15
+ const { t: o } = Z(), m = ee(), [l, A] = C(!1), [t, I] = C(null), { numberOfVisits: q, hideThumbnail: V = !1 } = k ?? {}, T = re(
16
16
  u,
17
17
  n
18
18
  ), x = ye(), {
@@ -23,20 +23,20 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
23
23
  refetch: K
24
24
  } = c({
25
25
  queryKey: ["forms", m, u],
26
- queryFn: () => ae(m, void 0, k),
26
+ queryFn: () => ae(m, void 0, q),
27
27
  enabled: !!m && !T
28
28
  }), _ = d(() => !n || n.length === 0 ? y : y.filter(
29
29
  (e) => n.includes(e.encounterUuid)
30
- ), [y, n]), { data: F = [] } = c({
30
+ ), [y, n]), { data: D = [] } = c({
31
31
  queryKey: ["observationForms"],
32
32
  queryFn: () => te()
33
- }), L = f(
34
- (e) => F.find((r) => r.name === e)?.uuid,
35
- [F]
33
+ }), F = f(
34
+ (e) => D.find((r) => r.name === e)?.uuid,
35
+ [D]
36
36
  ), b = d(() => {
37
37
  if (t)
38
- return L(t.formName);
39
- }, [t, L]), {
38
+ return F(t.formName);
39
+ }, [t, F]), {
40
40
  isLoading: Q,
41
41
  isError: j,
42
42
  error: g
@@ -68,7 +68,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
68
68
  return v(g).message;
69
69
  if (h)
70
70
  return v(h).message;
71
- }, [g, h]), M = d(
71
+ }, [g, h]), L = d(
72
72
  () => [
73
73
  { key: "recordedOn", header: o("RECORDED_ON") },
74
74
  { key: "recordedBy", header: o("RECORDED_BY") }
@@ -80,7 +80,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
80
80
  { key: "recordedBy", sortable: !0 }
81
81
  ],
82
82
  []
83
- ), D = d(() => {
83
+ ), M = d(() => {
84
84
  const e = _.reduce(
85
85
  (r, a) => {
86
86
  const i = a.formName;
@@ -106,9 +106,9 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
106
106
  })
107
107
  ).sort((r, a) => r.formName.localeCompare(a.formName));
108
108
  }, [_, o]), R = f((e) => {
109
- A(e), O(!0);
109
+ I(e), A(!0);
110
110
  }, []), P = f(() => {
111
- O(!1), A(null);
111
+ A(!1), I(null);
112
112
  }, []), U = f(
113
113
  (e, r) => {
114
114
  switch (r) {
@@ -123,32 +123,32 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
123
123
  [R]
124
124
  );
125
125
  return /* @__PURE__ */ W(X, { children: [
126
- /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: B || E || D.length === 0 || T ? /* @__PURE__ */ s(
127
- q,
126
+ /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: B || E || M.length === 0 || T ? /* @__PURE__ */ s(
127
+ S,
128
128
  {
129
- headers: M,
129
+ headers: L,
130
130
  ariaLabel: o("FORMS_HEADING"),
131
131
  rows: [],
132
132
  loading: B,
133
133
  errorStateMessage: E ? H?.message : void 0,
134
134
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
135
135
  renderCell: U,
136
- className: I.formsTableBody,
136
+ className: O.formsTableBody,
137
137
  dataTestId: "forms-table"
138
138
  }
139
- ) : /* @__PURE__ */ s(ue, { align: "start", children: D.map((e, r) => {
139
+ ) : /* @__PURE__ */ s(ue, { align: "start", children: M.map((e, r) => {
140
140
  const { formName: a, records: i } = e;
141
141
  return /* @__PURE__ */ s(
142
142
  me,
143
143
  {
144
144
  title: a,
145
- className: I.customAccordianItem,
145
+ className: O.customAccordianItem,
146
146
  testId: `accordian-title-${a}`,
147
147
  open: r === 0,
148
148
  children: /* @__PURE__ */ s(
149
- q,
149
+ S,
150
150
  {
151
- headers: M,
151
+ headers: L,
152
152
  ariaLabel: o("FORMS_HEADING"),
153
153
  rows: i,
154
154
  loading: !1,
@@ -156,7 +156,7 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
156
156
  sortable: J,
157
157
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
158
158
  renderCell: U,
159
- className: I.formsTableBody,
159
+ className: O.formsTableBody,
160
160
  dataTestId: `forms-table-${a}`
161
161
  }
162
162
  )
@@ -193,5 +193,5 @@ const be = "_formsTableBody_81hra_1", ge = "_customAccordianItem_81hra_6", I = {
193
193
  ] });
194
194
  };
195
195
  export {
196
- Ae as default
196
+ Ie as default
197
197
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CwmNiHJq.js";
2
- import { A as d, C as f, D as e } from "./index-C8FL8_cr.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DJh81_BF.js";
2
+ import { A as d, C as f, D as e } from "./index-DxSWsxDQ.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-CwmNiHJq.js";
2
- import { A as C, C as v, D as e } from "./index-C8FL8_cr.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-DJh81_BF.js";
2
+ import { A as C, C as v, D as e } from "./index-DxSWsxDQ.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 N, jsx as u } from "react/jsx-runtime";
2
- import { t as C, r as w, u as S, i as K, l as Q, k as P, v as j, E as x, y as G, j as H, o as M, w as z, P as U, m as Y, n as J, B as W, q as X, _ as Z, z as ee } from "./index-C8FL8_cr.js";
2
+ import { t as C, r as w, u as S, i as K, l as Q, k as P, v as j, E as x, y as G, j as H, o as M, w as z, P as U, m as Y, n as J, B as W, q as X, _ as Z, z as ee } from "./index-DxSWsxDQ.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as g } from "react";
5
5
  const D = (t, n, d, l, b, r) => {
@@ -1,4 +1,4 @@
1
- import { F as we, G as z, H as xt, I as B, C as q, D as y, K as Ro, L as ye, S as R, M as _, N as k, O as N, R as A, T as bs, U as ir, W as $e, X as U, Y as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-C8FL8_cr.js";
1
+ import { F as we, G as z, H as xt, I as B, C as q, D as y, K as Ro, L as ye, S as R, M as _, N as k, O as N, R as A, T as bs, U as ir, W as $e, X as U, Y as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-DxSWsxDQ.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":"Profile.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/profile/Profile.tsx"],"names":[],"mappings":"AAQA,OAAO,EAIL,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAA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CAAC;CACvE;AAED,UAAU,YAAY;IACpB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,OAAO;kFAMjB,YAAY;;CAwpBd,CAAC;AAIF,eAAe,OAAO,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { default as React } from 'react';
2
+ import { PatientPhotoConfig } from '../../providers/registrationConfig/models';
2
3
  interface PatientPhotoUploadProps {
3
4
  onPhotoConfirm: (base64Image: string) => void;
4
5
  initialPhoto?: string;
6
+ photoConfig?: PatientPhotoConfig;
5
7
  }
6
8
  export declare const PatientPhotoUpload: React.FC<PatientPhotoUploadProps>;
7
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"PatientPhotoUpload.d.ts","sourceRoot":"","sources":["../../../src/components/patientPhotoUpload/PatientPhotoUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,UAAU,uBAAuB;IAC/B,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAmBD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAoThE,CAAC"}
1
+ {"version":3,"file":"PatientPhotoUpload.d.ts","sourceRoot":"","sources":["../../../src/components/patientPhotoUpload/PatientPhotoUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAWpF,UAAU,uBAAuB;IAC/B,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAmUhE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { PatientPhotoConfig } from '../../providers/registrationConfig/models';
2
+ export type CaptureFn = (width?: number, height?: number, quality?: number) => string | undefined;
3
+ export type ResolvedPhotoConfig = {
4
+ mode: 'fixed';
5
+ widthPx: number;
6
+ heightPx: number;
7
+ maxFileSizeBytes: number;
8
+ } | {
9
+ mode: 'variable';
10
+ minWidthPx: number;
11
+ maxWidthPx: number;
12
+ minHeightPx: number;
13
+ maxHeightPx: number;
14
+ maxFileSizeBytes: number;
15
+ };
16
+ export declare const resolvePhotoConfig: (config?: PatientPhotoConfig) => ResolvedPhotoConfig;
17
+ export declare const dataUrlByteSize: (dataUrl: string) => number;
18
+ export declare const toJpegDataUrl: (img: HTMLImageElement, quality?: number) => string | undefined;
19
+ export declare const base64FromDataUrl: (dataUrl: string) => string;
20
+ export declare const fileToObjectUrl: (file: File) => string;
21
+ export declare const revokeObjectUrl: (url?: string) => void;
22
+ export declare const captureWithSizeConstraint: (capture: CaptureFn, cfg: ResolvedPhotoConfig) => Promise<string | undefined>;
23
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/patientPhotoUpload/utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,MAAM,MAAM,SAAS,GAAG,CACtB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,KACb,MAAM,GAAG,SAAS,CAAC;AAExB,MAAM,MAAM,mBAAmB,GAC3B;IACE,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAQN,eAAO,MAAM,kBAAkB,GAC7B,SAAS,kBAAkB,KAC1B,mBAmBF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,KAAG,MAIjD,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,KAAK,gBAAgB,EACrB,gBAAW,KACV,MAAM,GAAG,SAQX,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACvB,CAAC;AAE9B,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,KAAG,MAClB,CAAC;AAE5B,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,IAE9C,CAAC;AAwDF,eAAO,MAAM,yBAAyB,GACpC,SAAS,SAAS,EAClB,KAAK,mBAAmB,KACvB,OAAO,CAAC,MAAM,GAAG,SAAS,CAGqB,CAAC"}
@@ -4,4 +4,7 @@ export declare const BAHMNI_REGISTRATION_PATIENT = "/registration/patient";
4
4
  export declare const REGISTRATION_CONFIG_BASE_URL = "/bahmni_config/openmrs/apps/registration/v2";
5
5
  export declare const getPatientUrl: (patientUuid: string) => string;
6
6
  export declare const getPatientUrlExternal: (patientUuid: string) => string;
7
+ export declare const DEFAULT_PHOTO_WIDTH_PX = 600;
8
+ export declare const DEFAULT_PHOTO_HEIGHT_PX = 600;
9
+ export declare const DEFAULT_PHOTO_MAX_FILE_SIZE_KB = 500;
7
10
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/constants/app.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,0BAA0B,oCAAoC,CAAC;AAC5E,eAAO,MAAM,2BAA2B,0BAAuC,CAAC;AAChF,eAAO,MAAM,4BAA4B,gDACM,CAAC;AAEhD,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,KAAG,MACH,CAAC;AAElD,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,KAAG,MACA,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/constants/app.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AACrD,eAAO,MAAM,0BAA0B,oCAAoC,CAAC;AAC5E,eAAO,MAAM,2BAA2B,0BAAuC,CAAC;AAChF,eAAO,MAAM,4BAA4B,gDACM,CAAC;AAEhD,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,KAAG,MACH,CAAC;AAElD,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,KAAG,MACA,CAAC;AAE7D,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,8BAA8B,MAAM,CAAC"}