@alfadocs/ui-kit-debug 1.3.11 → 1.3.12
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.
- package/dist/_chunks/{anamnesis-i18n-DFXSM72N.js → anamnesis-i18n-9OrXTNS3.js} +882 -874
- package/dist/_chunks/anamnesis-i18n-9OrXTNS3.js.map +1 -0
- package/dist/_chunks/{bmi-calculator-Bk2GAju7.js → bmi-calculator-CM0-G2mg.js} +2 -2
- package/dist/_chunks/{bmi-calculator-Bk2GAju7.js.map → bmi-calculator-CM0-G2mg.js.map} +1 -1
- package/dist/_chunks/{cycle-calculator-DNvvr0bP.js → cycle-calculator-DrdC2hPj.js} +2 -2
- package/dist/_chunks/{cycle-calculator-DNvvr0bP.js.map → cycle-calculator-DrdC2hPj.js.map} +1 -1
- package/dist/_chunks/{due-date-calculator-BEcdoy_E.js → due-date-calculator-DzNMFyOU.js} +2 -2
- package/dist/_chunks/{due-date-calculator-BEcdoy_E.js.map → due-date-calculator-DzNMFyOU.js.map} +1 -1
- package/dist/_chunks/{fetal-weight-1F9N4IMx.js → fetal-weight-ePlLjJPc.js} +2 -2
- package/dist/_chunks/{fetal-weight-1F9N4IMx.js.map → fetal-weight-ePlLjJPc.js.map} +1 -1
- package/dist/_chunks/{hcg-doubling-fZ6qQN08.js → hcg-doubling-BBqD2wI2.js} +2 -2
- package/dist/_chunks/{hcg-doubling-fZ6qQN08.js.map → hcg-doubling-BBqD2wI2.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-_DlEZHLI.js → link-cell-renderer-C5XLwVXQ.js} +2 -2
- package/dist/_chunks/{link-cell-renderer-_DlEZHLI.js.map → link-cell-renderer-C5XLwVXQ.js.map} +1 -1
- package/dist/_chunks/number-input-DrozbZAU.js +370 -0
- package/dist/_chunks/number-input-DrozbZAU.js.map +1 -0
- package/dist/_chunks/{optical-prescription-BEjYQjiO.js → optical-prescription-BDHJr8Zz.js} +2 -2
- package/dist/_chunks/{optical-prescription-BEjYQjiO.js.map → optical-prescription-BDHJr8Zz.js.map} +1 -1
- package/dist/_chunks/{patient-details-BAUg0FWs.js → patient-details-D7D3f9dy.js} +2 -2
- package/dist/_chunks/{patient-details-BAUg0FWs.js.map → patient-details-D7D3f9dy.js.map} +1 -1
- package/dist/_chunks/{patient-table-C7QHFC63.js → patient-table-BmIDrLIS.js} +2 -2
- package/dist/_chunks/{patient-table-C7QHFC63.js.map → patient-table-BmIDrLIS.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-BdFl-rB1.js → pregnancy-dating-C3WvXHee.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-BdFl-rB1.js.map → pregnancy-dating-C3WvXHee.js.map} +1 -1
- package/dist/_chunks/{pregnancy-weight-gain-B-CkVYnU.js → pregnancy-weight-gain-O6J0sUIi.js} +2 -2
- package/dist/_chunks/{pregnancy-weight-gain-B-CkVYnU.js.map → pregnancy-weight-gain-O6J0sUIi.js.map} +1 -1
- package/dist/_chunks/{unit-converter-CSLWFDQh.js → unit-converter-COgkN7YP.js} +2 -2
- package/dist/_chunks/{unit-converter-CSLWFDQh.js.map → unit-converter-COgkN7YP.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/index.js +14 -14
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts +16 -0
- package/dist/patterns/anamnesis/anamnesis-derive.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts.map +1 -1
- package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +4 -3
- package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts.map +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/anamnesis-i18n-DFXSM72N.js.map +0 -1
- package/dist/_chunks/number-input-DjWzmlEY.js +0 -350
- package/dist/_chunks/number-input-DjWzmlEY.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as d, jsx as t, Fragment as Le } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as we, useState as
|
|
2
|
+
import { useRef as we, useState as $, useEffect as ia, useCallback as na, useId as We, useMemo as M, Fragment as Gt, useContext as Wt, createContext as Qt } from "react";
|
|
3
3
|
import { B as Q } from "./badge-DCOqV9mI.js";
|
|
4
4
|
import { B as X } from "./button-CPGiR_bH.js";
|
|
5
5
|
import { I as re } from "./icon-button-C_kbcd7I.js";
|
|
@@ -8,7 +8,7 @@ import { C as sn, b as Gn, a as on } from "./collapsible-CTjxzGuF.js";
|
|
|
8
8
|
import { E as Be } from "./empty-state-CrLsi0XI.js";
|
|
9
9
|
import { F as q } from "./form-field-M5UpX65Z.js";
|
|
10
10
|
import { M as rn } from "./multi-select-CC52Qws6.js";
|
|
11
|
-
import { N as pa } from "./number-input-
|
|
11
|
+
import { N as pa } from "./number-input-DrozbZAU.js";
|
|
12
12
|
import { R as ke } from "./radio-TWf9Q-mp.js";
|
|
13
13
|
import { R as ua } from "./radio-group-CI-6SmSw.js";
|
|
14
14
|
import { S as Me } from "./select-BW5ecXlX.js";
|
|
@@ -573,6 +573,13 @@ function Fe(e, a) {
|
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
+
function qi(e, a) {
|
|
577
|
+
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
578
|
+
const i = e[n], s = Fe(i, a);
|
|
579
|
+
if (s != null) return { value: s, visit: i };
|
|
580
|
+
}
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
576
583
|
function Dn(e, a, n) {
|
|
577
584
|
return e.some((i) => i.parameterKey === a) ? e.map(
|
|
578
585
|
(i) => i.parameterKey === a ? { ...i, value: n } : i
|
|
@@ -658,7 +665,7 @@ function un(e, a) {
|
|
|
658
665
|
};
|
|
659
666
|
});
|
|
660
667
|
}
|
|
661
|
-
const
|
|
668
|
+
const Vi = [
|
|
662
669
|
"nutritionalProposal",
|
|
663
670
|
"clinicalNotes"
|
|
664
671
|
];
|
|
@@ -666,21 +673,21 @@ function it(e, a) {
|
|
|
666
673
|
const n = 10 ** a;
|
|
667
674
|
return Math.round(e * n) / n;
|
|
668
675
|
}
|
|
669
|
-
function
|
|
676
|
+
function Bi(e, a) {
|
|
670
677
|
return e == null ? null : it(e, a);
|
|
671
678
|
}
|
|
672
679
|
function Sa(e, a = (n, i) => n === i) {
|
|
673
680
|
return e.every((n) => a(n, e[0]));
|
|
674
681
|
}
|
|
675
|
-
function
|
|
682
|
+
function Ui(e, a) {
|
|
676
683
|
return e == null || a == null ? e == null && a == null : e.name === a.name && e.dose === a.dose;
|
|
677
684
|
}
|
|
678
|
-
function
|
|
685
|
+
function Ki(e, a) {
|
|
679
686
|
if (e.length < 2) return null;
|
|
680
687
|
const n = [];
|
|
681
688
|
for (const r of a) {
|
|
682
689
|
const l = r.precision ?? 1, c = e.map(
|
|
683
|
-
(m) =>
|
|
690
|
+
(m) => Bi(Fe(m, r), l)
|
|
684
691
|
);
|
|
685
692
|
Sa(c) || n.push({
|
|
686
693
|
def: r,
|
|
@@ -701,10 +708,10 @@ function Ui(e, a) {
|
|
|
701
708
|
const l = e.map(
|
|
702
709
|
(c) => c.therapy.find((m) => m.id === r)
|
|
703
710
|
);
|
|
704
|
-
Sa(l,
|
|
711
|
+
Sa(l, Ui) || s.push({ id: r, entries: l });
|
|
705
712
|
}
|
|
706
713
|
const o = [];
|
|
707
|
-
for (const r of
|
|
714
|
+
for (const r of Vi) {
|
|
708
715
|
const l = e.map((c) => {
|
|
709
716
|
var m;
|
|
710
717
|
return ((m = c[r]) == null ? void 0 : m.trim()) ?? "";
|
|
@@ -726,12 +733,12 @@ const _e = "—";
|
|
|
726
733
|
function Ve(e, a = 1) {
|
|
727
734
|
return e == null || !Number.isFinite(e) ? _e : e.toFixed(a);
|
|
728
735
|
}
|
|
729
|
-
function
|
|
736
|
+
function Hi(e, a) {
|
|
730
737
|
return ha(e) ? new Intl.DateTimeFormat(a, Ye).format(
|
|
731
738
|
new Date(e)
|
|
732
739
|
) : _e;
|
|
733
740
|
}
|
|
734
|
-
function
|
|
741
|
+
function ji(e, a = 1) {
|
|
735
742
|
if (!Number.isFinite(e)) return _e;
|
|
736
743
|
const n = it(e, a);
|
|
737
744
|
return n === 0 ? "0" : `${n > 0 ? "+" : "−"}${Math.abs(n).toFixed(a)}`;
|
|
@@ -745,14 +752,14 @@ function pn(e) {
|
|
|
745
752
|
return typeof a == "string" ? a : void 0;
|
|
746
753
|
}
|
|
747
754
|
function se(e, a) {
|
|
748
|
-
return
|
|
755
|
+
return Hi(e, pn(a));
|
|
749
756
|
}
|
|
750
|
-
function
|
|
757
|
+
function Gi(e) {
|
|
751
758
|
const [a, n, i] = e.split("-").map(Number);
|
|
752
759
|
if (!(!a || !n || !i))
|
|
753
760
|
return new Date(a, n - 1, i);
|
|
754
761
|
}
|
|
755
|
-
function
|
|
762
|
+
function Wi(e) {
|
|
756
763
|
const a = (n) => String(n).padStart(2, "0");
|
|
757
764
|
return `${e.getFullYear()}-${a(e.getMonth() + 1)}-${a(e.getDate())}`;
|
|
758
765
|
}
|
|
@@ -764,13 +771,13 @@ function st(e, a, n, i = !1) {
|
|
|
764
771
|
});
|
|
765
772
|
return i ? n("anamnesis.window.optionHasNote", { label: s }) : s;
|
|
766
773
|
}
|
|
767
|
-
function
|
|
774
|
+
function Qi(e, a, n) {
|
|
768
775
|
const i = Oi(e, a);
|
|
769
776
|
return i == null ? _e : n("anamnesis.header.years", { age: i });
|
|
770
777
|
}
|
|
771
778
|
function $a(e, a) {
|
|
772
779
|
const n = _a(e);
|
|
773
|
-
return n ?
|
|
780
|
+
return n ? Qi(e.patient.dateOfBirthIso, n.dateIso, a) : _e;
|
|
774
781
|
}
|
|
775
782
|
function ba(e) {
|
|
776
783
|
const a = e == null ? void 0 : e.trim();
|
|
@@ -786,7 +793,7 @@ function Te(e, a) {
|
|
|
786
793
|
function he(e, a) {
|
|
787
794
|
return ba(e.label) ?? a(`anamnesis.field.${e.key}.label`, { defaultValue: e.key });
|
|
788
795
|
}
|
|
789
|
-
function
|
|
796
|
+
function Yi(e, a) {
|
|
790
797
|
const n = he(e, a);
|
|
791
798
|
return e.unit ? `${n} (${e.unit})` : n;
|
|
792
799
|
}
|
|
@@ -855,7 +862,7 @@ function gn(e, a, n) {
|
|
|
855
862
|
return [e.time, e.description].filter(Boolean).join(" · ") || "—";
|
|
856
863
|
}
|
|
857
864
|
}
|
|
858
|
-
const
|
|
865
|
+
const Xi = [
|
|
859
866
|
{ id: "reason", kind: "prose", fieldKeys: ["reasonForVisit"] },
|
|
860
867
|
{
|
|
861
868
|
id: "history",
|
|
@@ -879,12 +886,12 @@ const Yi = [
|
|
|
879
886
|
]
|
|
880
887
|
}
|
|
881
888
|
];
|
|
882
|
-
function
|
|
889
|
+
function Ji(e, a) {
|
|
883
890
|
return e.flatMap(
|
|
884
891
|
(n) => n.fields.filter((i) => ra(i, a))
|
|
885
892
|
);
|
|
886
893
|
}
|
|
887
|
-
function
|
|
894
|
+
function Zi(e, a, n) {
|
|
888
895
|
const i = a(e.key);
|
|
889
896
|
return !i || !ga(i) ? null : {
|
|
890
897
|
key: e.key,
|
|
@@ -892,7 +899,7 @@ function Ji(e, a, n) {
|
|
|
892
899
|
value: gn(i, e, n)
|
|
893
900
|
};
|
|
894
901
|
}
|
|
895
|
-
function
|
|
902
|
+
function es(e, a, n) {
|
|
896
903
|
var s;
|
|
897
904
|
const i = [];
|
|
898
905
|
for (const o of e) {
|
|
@@ -905,12 +912,12 @@ function Zi(e, a, n) {
|
|
|
905
912
|
}
|
|
906
913
|
return i;
|
|
907
914
|
}
|
|
908
|
-
function
|
|
909
|
-
const s =
|
|
910
|
-
for (const c of
|
|
911
|
-
const m = c.kind === "flags" ?
|
|
915
|
+
function as(e, a, n, i) {
|
|
916
|
+
const s = Ji(e, n), o = new Map(s.map((c) => [c.key, c])), r = [];
|
|
917
|
+
for (const c of Xi) {
|
|
918
|
+
const m = c.kind === "flags" ? es(s, a, i) : c.fieldKeys.map((g) => {
|
|
912
919
|
const h = o.get(g);
|
|
913
|
-
return h ?
|
|
920
|
+
return h ? Zi(h, a, i) : null;
|
|
914
921
|
}).filter((g) => g != null);
|
|
915
922
|
m.length > 0 && r.push({ id: c.id, kind: c.kind, items: m });
|
|
916
923
|
}
|
|
@@ -935,25 +942,25 @@ function rt(e, a, n, i) {
|
|
|
935
942
|
}
|
|
936
943
|
return s;
|
|
937
944
|
}
|
|
938
|
-
const
|
|
939
|
-
function
|
|
945
|
+
const ns = 'input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), button:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])';
|
|
946
|
+
function ts(e, a) {
|
|
940
947
|
const n = e == null ? void 0 : e.querySelector(
|
|
941
948
|
`[data-testid="anamnesis-field-${a}"]`
|
|
942
|
-
), i = n == null ? void 0 : n.querySelector(
|
|
949
|
+
), i = n == null ? void 0 : n.querySelector(ns);
|
|
943
950
|
return i ? (i.focus(), !0) : !1;
|
|
944
951
|
}
|
|
945
|
-
const
|
|
952
|
+
const is = 4;
|
|
946
953
|
function lt() {
|
|
947
|
-
const e = we(null), [a, n] =
|
|
954
|
+
const e = we(null), [a, n] = $(null);
|
|
948
955
|
ia(() => {
|
|
949
956
|
if (a == null) return;
|
|
950
957
|
let s = 0, o = 0;
|
|
951
958
|
const r = () => {
|
|
952
|
-
if (
|
|
959
|
+
if (ts(e.current, a)) {
|
|
953
960
|
n(null);
|
|
954
961
|
return;
|
|
955
962
|
}
|
|
956
|
-
if (s += 1, s >=
|
|
963
|
+
if (s += 1, s >= is) {
|
|
957
964
|
n(null);
|
|
958
965
|
return;
|
|
959
966
|
}
|
|
@@ -997,7 +1004,7 @@ function ct({
|
|
|
997
1004
|
}
|
|
998
1005
|
);
|
|
999
1006
|
}
|
|
1000
|
-
function
|
|
1007
|
+
function ss({ group: e, t: a }) {
|
|
1001
1008
|
return /* @__PURE__ */ d(
|
|
1002
1009
|
"div",
|
|
1003
1010
|
{
|
|
@@ -1022,7 +1029,7 @@ function is({ group: e, t: a }) {
|
|
|
1022
1029
|
}
|
|
1023
1030
|
);
|
|
1024
1031
|
}
|
|
1025
|
-
function
|
|
1032
|
+
function os({ digest: e, t: a }) {
|
|
1026
1033
|
return e.groups.length === 0 ? /* @__PURE__ */ t(
|
|
1027
1034
|
Be,
|
|
1028
1035
|
{
|
|
@@ -1036,11 +1043,11 @@ function ss({ digest: e, t: a }) {
|
|
|
1036
1043
|
{
|
|
1037
1044
|
"data-testid": "anamnesis-digest-panel",
|
|
1038
1045
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
1039
|
-
children: e.groups.map((n) => /* @__PURE__ */ t(
|
|
1046
|
+
children: e.groups.map((n) => /* @__PURE__ */ t(ss, { group: n, t: a }, n.id))
|
|
1040
1047
|
}
|
|
1041
1048
|
);
|
|
1042
1049
|
}
|
|
1043
|
-
const
|
|
1050
|
+
const rs = Wn(
|
|
1044
1051
|
"type-meta ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:tabular-nums",
|
|
1045
1052
|
{
|
|
1046
1053
|
variants: {
|
|
@@ -1057,12 +1064,12 @@ const os = Wn(
|
|
|
1057
1064
|
);
|
|
1058
1065
|
function za({ delta: e, def: a, t: n }) {
|
|
1059
1066
|
if (!e) return null;
|
|
1060
|
-
const i = e.direction === "up" ? Qn : e.direction === "down" ? Yn : Zt, s = `${
|
|
1067
|
+
const i = e.direction === "up" ? Qn : e.direction === "down" ? Yn : Zt, s = `${ji(e.abs, a.precision ?? 1)}${a.unit ? ` ${a.unit}` : ""}`, o = e.valence === "good" ? n("anamnesis.delta.improved") : e.valence === "bad" ? n("anamnesis.delta.worsened") : n("anamnesis.delta.unchanged");
|
|
1061
1068
|
return /* @__PURE__ */ d(
|
|
1062
1069
|
"span",
|
|
1063
1070
|
{
|
|
1064
1071
|
role: "img",
|
|
1065
|
-
className:
|
|
1072
|
+
className: rs({ valence: e.valence }),
|
|
1066
1073
|
"aria-label": n("anamnesis.delta.aria", {
|
|
1067
1074
|
valence: o,
|
|
1068
1075
|
change: s
|
|
@@ -1096,7 +1103,7 @@ function fn({
|
|
|
1096
1103
|
}
|
|
1097
1104
|
);
|
|
1098
1105
|
}
|
|
1099
|
-
const
|
|
1106
|
+
const ls = {
|
|
1100
1107
|
good: "var(--success)",
|
|
1101
1108
|
bad: "var(--error)",
|
|
1102
1109
|
neutral: "var(--muted-foreground)"
|
|
@@ -1117,7 +1124,7 @@ function mt({
|
|
|
1117
1124
|
data: e,
|
|
1118
1125
|
variant: "line",
|
|
1119
1126
|
size: "sm",
|
|
1120
|
-
color:
|
|
1127
|
+
color: ls[l],
|
|
1121
1128
|
annotations: i,
|
|
1122
1129
|
onAnnotationSelect: s,
|
|
1123
1130
|
label: n("anamnesis.grid.trendLabel", {
|
|
@@ -1158,7 +1165,7 @@ function pt({
|
|
|
1158
1165
|
o.key
|
|
1159
1166
|
)) });
|
|
1160
1167
|
}
|
|
1161
|
-
function
|
|
1168
|
+
function cs({
|
|
1162
1169
|
intake: e,
|
|
1163
1170
|
sections: a,
|
|
1164
1171
|
sex: n,
|
|
@@ -1184,7 +1191,7 @@ function ls({
|
|
|
1184
1191
|
jumpKey: "anamnesis.summary.jump"
|
|
1185
1192
|
}
|
|
1186
1193
|
) : null,
|
|
1187
|
-
/* @__PURE__ */ t(
|
|
1194
|
+
/* @__PURE__ */ t(os, { digest: i, t: r }),
|
|
1188
1195
|
/* @__PURE__ */ d(sn, { variant: "default", children: [
|
|
1189
1196
|
/* @__PURE__ */ t("h2", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: /* @__PURE__ */ d(
|
|
1190
1197
|
Gn,
|
|
@@ -1230,7 +1237,7 @@ function ls({
|
|
|
1230
1237
|
}
|
|
1231
1238
|
);
|
|
1232
1239
|
}
|
|
1233
|
-
const
|
|
1240
|
+
const ds = [
|
|
1234
1241
|
"visitMeta",
|
|
1235
1242
|
"intakeGaps",
|
|
1236
1243
|
"anthropometrics",
|
|
@@ -1246,13 +1253,13 @@ const cs = [
|
|
|
1246
1253
|
function Ba(e) {
|
|
1247
1254
|
return (e ?? "").trim() !== "";
|
|
1248
1255
|
}
|
|
1249
|
-
function
|
|
1256
|
+
function ms(e) {
|
|
1250
1257
|
const a = e.oncological;
|
|
1251
1258
|
if (!a) return 0;
|
|
1252
1259
|
let n = 0;
|
|
1253
1260
|
return Ba(a.tumourType) && (n += 1), Ba(a.stage) && (n += 1), a.metastases && a.metastases.present !== "unknown" && (n += 1), Ba(a.treatmentStatus) && (n += 1), n;
|
|
1254
1261
|
}
|
|
1255
|
-
function
|
|
1262
|
+
function us(e, a) {
|
|
1256
1263
|
const n = new Map(e.labs.map((s) => [s.parameterKey, s.value])), i = [];
|
|
1257
1264
|
for (const s of a) {
|
|
1258
1265
|
const o = n.get(s.key);
|
|
@@ -1260,34 +1267,34 @@ function ms(e, a) {
|
|
|
1260
1267
|
}
|
|
1261
1268
|
return i;
|
|
1262
1269
|
}
|
|
1263
|
-
function
|
|
1270
|
+
function ps(e) {
|
|
1264
1271
|
const a = e.annualProgramme;
|
|
1265
1272
|
return a && (a.proposed || a.accepted) ? 1 : 0;
|
|
1266
1273
|
}
|
|
1267
1274
|
function Fn(e, a = []) {
|
|
1268
|
-
const n = e ?
|
|
1269
|
-
oncological: e ?
|
|
1275
|
+
const n = e ? us(e, a) : [], i = (e == null ? void 0 : e.visitType) === "first", s = {
|
|
1276
|
+
oncological: e ? ms(e) : 0,
|
|
1270
1277
|
labs: n.length,
|
|
1271
1278
|
fmd: e ? e.fmdCycles.length : 0,
|
|
1272
|
-
annual: e ?
|
|
1279
|
+
annual: e ? ps(e) : 0
|
|
1273
1280
|
}, o = {
|
|
1274
1281
|
oncological: 0,
|
|
1275
1282
|
labs: n.filter(({ def: l, value: c }) => ya(c, l.referenceRange)).length,
|
|
1276
1283
|
fmd: 0,
|
|
1277
1284
|
annual: 0
|
|
1278
1285
|
}, r = {};
|
|
1279
|
-
for (const l of
|
|
1286
|
+
for (const l of ds)
|
|
1280
1287
|
r[l] = { open: !0, fill: null, flagged: 0 };
|
|
1281
1288
|
for (const l of ht)
|
|
1282
1289
|
r[l] = { open: i, fill: s[l], flagged: o[l] };
|
|
1283
1290
|
return r;
|
|
1284
1291
|
}
|
|
1285
|
-
const
|
|
1292
|
+
const hs = [
|
|
1286
1293
|
"clinicalNotes",
|
|
1287
1294
|
"nutritionalProposal"
|
|
1288
1295
|
];
|
|
1289
1296
|
function Oa(e) {
|
|
1290
|
-
return
|
|
1297
|
+
return hs.flatMap((a) => {
|
|
1291
1298
|
var i;
|
|
1292
1299
|
const n = (i = e[a]) == null ? void 0 : i.trim();
|
|
1293
1300
|
return n ? [{ field: a, text: n }] : [];
|
|
@@ -1296,7 +1303,7 @@ function Oa(e) {
|
|
|
1296
1303
|
function gt(e) {
|
|
1297
1304
|
return Oa(e).length > 0;
|
|
1298
1305
|
}
|
|
1299
|
-
function
|
|
1306
|
+
function gs({
|
|
1300
1307
|
visit: e,
|
|
1301
1308
|
t: a
|
|
1302
1309
|
}) {
|
|
@@ -1305,8 +1312,8 @@ function hs({
|
|
|
1305
1312
|
/* @__PURE__ */ t(_.Detail, { children: /* @__PURE__ */ t("span", { className: "ds:block ds:break-words ds:whitespace-pre-line", children: n.text }) })
|
|
1306
1313
|
] }, n.field)) });
|
|
1307
1314
|
}
|
|
1308
|
-
const
|
|
1309
|
-
function
|
|
1315
|
+
const fs = "ds:mt-[var(--spacing-md)] ds:max-h-[min(20rem,var(--radix-popover-content-available-height))] ds:overflow-y-auto ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
|
|
1316
|
+
function ys({
|
|
1310
1317
|
visit: e,
|
|
1311
1318
|
t: a,
|
|
1312
1319
|
defaultOpen: n = !1,
|
|
@@ -1371,8 +1378,8 @@ function fs({
|
|
|
1371
1378
|
tabIndex: 0,
|
|
1372
1379
|
role: "group",
|
|
1373
1380
|
"aria-label": a("anamnesis.visitNote.title"),
|
|
1374
|
-
className:
|
|
1375
|
-
children: /* @__PURE__ */ t(
|
|
1381
|
+
className: fs,
|
|
1382
|
+
children: /* @__PURE__ */ t(gs, { visit: e, t: a })
|
|
1376
1383
|
}
|
|
1377
1384
|
)
|
|
1378
1385
|
]
|
|
@@ -1380,7 +1387,7 @@ function fs({
|
|
|
1380
1387
|
)
|
|
1381
1388
|
] });
|
|
1382
1389
|
}
|
|
1383
|
-
const yn = "ds:min-w-[11rem]", fa = "ds:min-w-[8rem]", vn = "ds:w-[40%] ds:min-w-[14rem]",
|
|
1390
|
+
const yn = "ds:min-w-[11rem]", fa = "ds:min-w-[8rem]", vn = "ds:w-[40%] ds:min-w-[14rem]", vs = "type-label ds:sticky ds:start-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-end)]", ft = "ds:sticky ds:top-0 ds:z-[2] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-down)]", bs = "type-label ds:sticky ds:end-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-start)]", xs = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]", je = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
|
|
1384
1391
|
function yt({
|
|
1385
1392
|
column: e,
|
|
1386
1393
|
t: a,
|
|
@@ -1412,7 +1419,7 @@ function yt({
|
|
|
1412
1419
|
}
|
|
1413
1420
|
) }),
|
|
1414
1421
|
o ? /* @__PURE__ */ t(
|
|
1415
|
-
|
|
1422
|
+
ys,
|
|
1416
1423
|
{
|
|
1417
1424
|
visit: l,
|
|
1418
1425
|
t: a,
|
|
@@ -1468,7 +1475,7 @@ function vt({
|
|
|
1468
1475
|
"th",
|
|
1469
1476
|
{
|
|
1470
1477
|
scope: "col",
|
|
1471
|
-
className: `${yn} ${
|
|
1478
|
+
className: `${yn} ${vs}`,
|
|
1472
1479
|
children: n
|
|
1473
1480
|
}
|
|
1474
1481
|
),
|
|
@@ -1492,14 +1499,14 @@ function vt({
|
|
|
1492
1499
|
{
|
|
1493
1500
|
scope: "col",
|
|
1494
1501
|
"data-testid": l,
|
|
1495
|
-
className: `${fa} ${
|
|
1502
|
+
className: `${fa} ${bs}`,
|
|
1496
1503
|
children: r
|
|
1497
1504
|
}
|
|
1498
1505
|
) : null
|
|
1499
1506
|
] }) }),
|
|
1500
1507
|
/* @__PURE__ */ t("tbody", { children: c.map(
|
|
1501
1508
|
(p) => {
|
|
1502
|
-
var
|
|
1509
|
+
var b, N;
|
|
1503
1510
|
return p.banner != null ? /* @__PURE__ */ t("tr", { className: "ds:bg-[color:var(--muted)]", children: /* @__PURE__ */ t(
|
|
1504
1511
|
"th",
|
|
1505
1512
|
{
|
|
@@ -1509,7 +1516,7 @@ function vt({
|
|
|
1509
1516
|
}
|
|
1510
1517
|
) }, p.key) : /* @__PURE__ */ d("tr", { children: [
|
|
1511
1518
|
p.header,
|
|
1512
|
-
(
|
|
1519
|
+
(b = p.cells) == null ? void 0 : b[0],
|
|
1513
1520
|
p.trend,
|
|
1514
1521
|
(N = p.cells) == null ? void 0 : N.slice(1),
|
|
1515
1522
|
p.trailing
|
|
@@ -1520,7 +1527,7 @@ function vt({
|
|
|
1520
1527
|
}
|
|
1521
1528
|
);
|
|
1522
1529
|
}
|
|
1523
|
-
const Pn = 160,
|
|
1530
|
+
const Pn = 160, ks = {
|
|
1524
1531
|
added: "success",
|
|
1525
1532
|
removed: "error",
|
|
1526
1533
|
changed: "info"
|
|
@@ -1529,16 +1536,16 @@ function Ma(e) {
|
|
|
1529
1536
|
const a = e[0], n = e[e.length - 1];
|
|
1530
1537
|
return !a && n ? "added" : a && !n ? "removed" : "changed";
|
|
1531
1538
|
}
|
|
1532
|
-
function
|
|
1539
|
+
function ws(e) {
|
|
1533
1540
|
const a = e.trim();
|
|
1534
1541
|
return a ? a.length > Pn ? `${a.slice(0, Pn).trimEnd()}…` : a : _e;
|
|
1535
1542
|
}
|
|
1536
|
-
function
|
|
1543
|
+
function Ns(e, a, n) {
|
|
1537
1544
|
var s;
|
|
1538
1545
|
const i = (s = e.dose) == null ? void 0 : s.trim();
|
|
1539
1546
|
return a ? i ? `${e.name} · ${i}` : e.name : i || n;
|
|
1540
1547
|
}
|
|
1541
|
-
function
|
|
1548
|
+
function Cs(e, { t: a, seriesByKey: n }) {
|
|
1542
1549
|
return e.numeric.map((i) => {
|
|
1543
1550
|
const s = i.values.map((r) => r != null), o = Ma(s);
|
|
1544
1551
|
return {
|
|
@@ -1559,7 +1566,7 @@ function Ns(e, { t: a, seriesByKey: n }) {
|
|
|
1559
1566
|
};
|
|
1560
1567
|
});
|
|
1561
1568
|
}
|
|
1562
|
-
function
|
|
1569
|
+
function Ts(e, { t: a, pathologies: n }) {
|
|
1563
1570
|
const i = a("anamnesis.compare.present");
|
|
1564
1571
|
return e.pathologies.map((s) => {
|
|
1565
1572
|
const o = Ma(s.present);
|
|
@@ -1573,7 +1580,7 @@ function Cs(e, { t: a, pathologies: n }) {
|
|
|
1573
1580
|
};
|
|
1574
1581
|
});
|
|
1575
1582
|
}
|
|
1576
|
-
function
|
|
1583
|
+
function Ss(e, { t: a }) {
|
|
1577
1584
|
const n = a("anamnesis.compare.present");
|
|
1578
1585
|
return e.medications.map((i) => {
|
|
1579
1586
|
var l;
|
|
@@ -1589,14 +1596,14 @@ function Ts(e, { t: a }) {
|
|
|
1589
1596
|
change: r,
|
|
1590
1597
|
changeLabel: a(`anamnesis.compare.${r}`),
|
|
1591
1598
|
values: i.entries.map(
|
|
1592
|
-
(c) => c ?
|
|
1599
|
+
(c) => c ? Ns(c, o, n) : _e
|
|
1593
1600
|
)
|
|
1594
1601
|
};
|
|
1595
1602
|
});
|
|
1596
1603
|
}
|
|
1597
|
-
function
|
|
1604
|
+
function As(e, { t: a }) {
|
|
1598
1605
|
return e.texts.flatMap((n) => {
|
|
1599
|
-
const i = n.values.map(
|
|
1606
|
+
const i = n.values.map(ws);
|
|
1600
1607
|
if (i.every((o) => o === i[0])) return [];
|
|
1601
1608
|
const s = Ma(i.map((o) => o !== _e));
|
|
1602
1609
|
return [
|
|
@@ -1613,19 +1620,19 @@ function Ss(e, { t: a }) {
|
|
|
1613
1620
|
];
|
|
1614
1621
|
});
|
|
1615
1622
|
}
|
|
1616
|
-
const
|
|
1617
|
-
{ id: "measurement", rows:
|
|
1618
|
-
{ id: "pathology", rows:
|
|
1619
|
-
{ id: "therapy", rows:
|
|
1620
|
-
{ id: "note", rows:
|
|
1623
|
+
const Es = [
|
|
1624
|
+
{ id: "measurement", rows: Cs },
|
|
1625
|
+
{ id: "pathology", rows: Ts },
|
|
1626
|
+
{ id: "therapy", rows: Ss },
|
|
1627
|
+
{ id: "note", rows: As }
|
|
1621
1628
|
];
|
|
1622
|
-
function
|
|
1623
|
-
return
|
|
1629
|
+
function Ds(e, a) {
|
|
1630
|
+
return Es.flatMap((n) => n.rows(e, a));
|
|
1624
1631
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return e.def && e.delta ? /* @__PURE__ */ t(za, { delta: e.delta, def: e.def, t: a }) : /* @__PURE__ */ t(Q, { variant:
|
|
1632
|
+
function Is({ row: e, t: a }) {
|
|
1633
|
+
return e.def && e.delta ? /* @__PURE__ */ t(za, { delta: e.delta, def: e.def, t: a }) : /* @__PURE__ */ t(Q, { variant: ks[e.change], size: "sm", children: e.changeLabel });
|
|
1627
1634
|
}
|
|
1628
|
-
function
|
|
1635
|
+
function Rs({
|
|
1629
1636
|
visits: e,
|
|
1630
1637
|
columns: a,
|
|
1631
1638
|
selectedIds: n,
|
|
@@ -1638,23 +1645,23 @@ function Is({
|
|
|
1638
1645
|
t: m,
|
|
1639
1646
|
onClose: g
|
|
1640
1647
|
}) {
|
|
1641
|
-
const h = We(), [p,
|
|
1648
|
+
const h = We(), [p, b] = $(""), N = M(
|
|
1642
1649
|
() => e.map((S, D) => ({
|
|
1643
1650
|
value: S.id,
|
|
1644
1651
|
label: st(S, D, m)
|
|
1645
1652
|
})),
|
|
1646
1653
|
[e, m]
|
|
1647
1654
|
), f = M(
|
|
1648
|
-
() => s ?
|
|
1655
|
+
() => s ? Ds(s, { t: m, pathologies: r, seriesByKey: o }) : [],
|
|
1649
1656
|
[s, m, r, o]
|
|
1650
1657
|
), C = M(() => {
|
|
1651
|
-
var
|
|
1652
|
-
const S = (
|
|
1658
|
+
var w, u;
|
|
1659
|
+
const S = (w = a[0]) == null ? void 0 : w.visit.dateIso, D = (u = a[a.length - 1]) == null ? void 0 : u.visit.dateIso, A = m("anamnesis.compare.selected", {
|
|
1653
1660
|
total: a.length,
|
|
1654
1661
|
from: S ? se(S, m) : "",
|
|
1655
1662
|
to: D ? se(D, m) : ""
|
|
1656
1663
|
});
|
|
1657
|
-
return a.length === 2 ? `${
|
|
1664
|
+
return a.length === 2 ? `${A} · ${m("anamnesis.compare.minimum")}` : A;
|
|
1658
1665
|
}, [a, m]), k = M(
|
|
1659
1666
|
() => a.map((S) => /* @__PURE__ */ t(
|
|
1660
1667
|
yt,
|
|
@@ -1667,42 +1674,42 @@ function Is({
|
|
|
1667
1674
|
S.key
|
|
1668
1675
|
)),
|
|
1669
1676
|
[a, m]
|
|
1670
|
-
),
|
|
1677
|
+
), E = M(() => {
|
|
1671
1678
|
const S = [];
|
|
1672
1679
|
let D = null;
|
|
1673
|
-
for (const
|
|
1674
|
-
|
|
1675
|
-
key: `group-${
|
|
1676
|
-
banner: m(`anamnesis.compare.category.${
|
|
1680
|
+
for (const A of f)
|
|
1681
|
+
A.categoryId !== D && (D = A.categoryId, S.push({
|
|
1682
|
+
key: `group-${A.categoryId}`,
|
|
1683
|
+
banner: m(`anamnesis.compare.category.${A.categoryId}`)
|
|
1677
1684
|
})), S.push({
|
|
1678
|
-
key:
|
|
1685
|
+
key: A.id,
|
|
1679
1686
|
header: /* @__PURE__ */ t(
|
|
1680
1687
|
"th",
|
|
1681
1688
|
{
|
|
1682
1689
|
scope: "row",
|
|
1683
1690
|
className: `${yn} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
|
|
1684
1691
|
children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
1685
|
-
/* @__PURE__ */ t("span", { className: "type-label ds:break-words ds:text-[color:var(--foreground)]", children:
|
|
1686
|
-
|
|
1692
|
+
/* @__PURE__ */ t("span", { className: "type-label ds:break-words ds:text-[color:var(--foreground)]", children: A.item }),
|
|
1693
|
+
A.meta ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: A.meta }) : null
|
|
1687
1694
|
] })
|
|
1688
1695
|
}
|
|
1689
1696
|
),
|
|
1690
|
-
cells:
|
|
1697
|
+
cells: A.values.map((w, u) => {
|
|
1691
1698
|
var T;
|
|
1692
1699
|
return /* @__PURE__ */ t(
|
|
1693
1700
|
"td",
|
|
1694
1701
|
{
|
|
1695
1702
|
className: `${fa} ${je} ds:tabular-nums`,
|
|
1696
|
-
children: /* @__PURE__ */ t("span", { className: "type-body-sm ds:block ds:break-words ds:whitespace-normal ds:text-[color:var(--foreground)]", children:
|
|
1703
|
+
children: /* @__PURE__ */ t("span", { className: "type-body-sm ds:block ds:break-words ds:whitespace-normal ds:text-[color:var(--foreground)]", children: w })
|
|
1697
1704
|
},
|
|
1698
1705
|
((T = a[u]) == null ? void 0 : T.key) ?? u
|
|
1699
1706
|
);
|
|
1700
1707
|
}),
|
|
1701
|
-
trend: /* @__PURE__ */ t("td", { className: `${vn} ${je}`, children:
|
|
1708
|
+
trend: /* @__PURE__ */ t("td", { className: `${vn} ${je}`, children: A.series && A.def ? /* @__PURE__ */ t(
|
|
1702
1709
|
mt,
|
|
1703
1710
|
{
|
|
1704
|
-
series:
|
|
1705
|
-
def:
|
|
1711
|
+
series: A.series,
|
|
1712
|
+
def: A.def,
|
|
1706
1713
|
t: m,
|
|
1707
1714
|
annotations: l,
|
|
1708
1715
|
onSelectAnnotation: c
|
|
@@ -1711,9 +1718,9 @@ function Is({
|
|
|
1711
1718
|
trailing: /* @__PURE__ */ t(
|
|
1712
1719
|
"td",
|
|
1713
1720
|
{
|
|
1714
|
-
className: `${fa} ${je} ${
|
|
1715
|
-
"data-change":
|
|
1716
|
-
children: /* @__PURE__ */ t(
|
|
1721
|
+
className: `${fa} ${je} ${xs}`,
|
|
1722
|
+
"data-change": A.change,
|
|
1723
|
+
children: /* @__PURE__ */ t(Is, { row: A, t: m })
|
|
1717
1724
|
}
|
|
1718
1725
|
)
|
|
1719
1726
|
});
|
|
@@ -1752,10 +1759,10 @@ function Is({
|
|
|
1752
1759
|
allowSelectAll: !0,
|
|
1753
1760
|
onChange: (S) => {
|
|
1754
1761
|
if (S.length >= 2) {
|
|
1755
|
-
|
|
1762
|
+
b(""), i(S);
|
|
1756
1763
|
return;
|
|
1757
1764
|
}
|
|
1758
|
-
|
|
1765
|
+
b(m("anamnesis.compare.minimum"));
|
|
1759
1766
|
}
|
|
1760
1767
|
}
|
|
1761
1768
|
)
|
|
@@ -1805,7 +1812,7 @@ function Is({
|
|
|
1805
1812
|
trailingLabel: m("anamnesis.compare.column.change"),
|
|
1806
1813
|
trailingTestId: "anamnesis-compare-change-column",
|
|
1807
1814
|
visitHeaders: k,
|
|
1808
|
-
rows:
|
|
1815
|
+
rows: E,
|
|
1809
1816
|
testId: "anamnesis-compare-table"
|
|
1810
1817
|
}
|
|
1811
1818
|
)
|
|
@@ -1821,7 +1828,7 @@ const bt = {
|
|
|
1821
1828
|
surgery: "triangle",
|
|
1822
1829
|
lifestyle: "square"
|
|
1823
1830
|
}, xt = "neutral";
|
|
1824
|
-
function
|
|
1831
|
+
function Ls(e, a) {
|
|
1825
1832
|
const n = a.length - 1;
|
|
1826
1833
|
if (n < 1 || !ha(e.dateIso)) return null;
|
|
1827
1834
|
const i = a.map((o) => new Date(o.dateIso).getTime()), s = new Date(e.dateIso).getTime();
|
|
@@ -1833,9 +1840,9 @@ function Rs(e, a) {
|
|
|
1833
1840
|
}
|
|
1834
1841
|
return null;
|
|
1835
1842
|
}
|
|
1836
|
-
function
|
|
1843
|
+
function Fs(e, a) {
|
|
1837
1844
|
return (e ?? []).flatMap((n) => {
|
|
1838
|
-
const i =
|
|
1845
|
+
const i = Ls(n, a);
|
|
1839
1846
|
return i == null ? [] : [{ event: n, position: i }];
|
|
1840
1847
|
}).sort((n, i) => n.position - i.position);
|
|
1841
1848
|
}
|
|
@@ -1852,7 +1859,7 @@ function kt(e, a) {
|
|
|
1852
1859
|
source: a(`anamnesis.event.source.${e.sourceKey}`)
|
|
1853
1860
|
}) : n;
|
|
1854
1861
|
}
|
|
1855
|
-
function
|
|
1862
|
+
function Ps(e, a, n) {
|
|
1856
1863
|
return e.filter((i) => a.has(i.event.id)).map(({ event: i, position: s }) => ({
|
|
1857
1864
|
id: i.id,
|
|
1858
1865
|
position: s,
|
|
@@ -1861,7 +1868,7 @@ function Fs(e, a, n) {
|
|
|
1861
1868
|
tone: xt
|
|
1862
1869
|
}));
|
|
1863
1870
|
}
|
|
1864
|
-
function
|
|
1871
|
+
function _s({
|
|
1865
1872
|
marks: e,
|
|
1866
1873
|
activeIds: a,
|
|
1867
1874
|
onToggle: n,
|
|
@@ -1946,22 +1953,22 @@ function wt(e) {
|
|
|
1946
1953
|
e.map((a) => a.id)
|
|
1947
1954
|
).columns;
|
|
1948
1955
|
}
|
|
1949
|
-
function
|
|
1956
|
+
function $s(e) {
|
|
1950
1957
|
return e.length >= 2;
|
|
1951
1958
|
}
|
|
1952
|
-
const
|
|
1959
|
+
const zs = {
|
|
1953
1960
|
value: null,
|
|
1954
1961
|
outOfRange: null,
|
|
1955
1962
|
delta: null
|
|
1956
1963
|
};
|
|
1957
|
-
function
|
|
1964
|
+
function Os(e, a) {
|
|
1958
1965
|
const n = e[a], i = e[a - 1];
|
|
1959
1966
|
return i ? i.index === n.index - 1 : n.index === 0;
|
|
1960
1967
|
}
|
|
1961
|
-
function
|
|
1968
|
+
function Ms(e, a) {
|
|
1962
1969
|
return e ? e.min != null && e.max != null ? `${e.min}–${e.max}` : e.max != null ? a("anamnesis.range.atMost", { value: e.max }) : e.min != null ? a("anamnesis.range.atLeast", { value: e.min }) : null : null;
|
|
1963
1970
|
}
|
|
1964
|
-
function
|
|
1971
|
+
function qs({
|
|
1965
1972
|
record: e,
|
|
1966
1973
|
defs: a,
|
|
1967
1974
|
t: n,
|
|
@@ -1976,16 +1983,16 @@ function Ms({
|
|
|
1976
1983
|
annotations: h,
|
|
1977
1984
|
onSelectAnnotation: p
|
|
1978
1985
|
}) {
|
|
1979
|
-
const
|
|
1986
|
+
const b = We(), N = un(e, a), f = e.visits, C = f.length - 1, k = m ?? wt(f), E = [];
|
|
1980
1987
|
let S = null;
|
|
1981
|
-
const D = (
|
|
1982
|
-
if (N.forEach((
|
|
1983
|
-
|
|
1984
|
-
key: `group-${
|
|
1985
|
-
banner: n(`anamnesis.group.${
|
|
1988
|
+
const D = (w) => (o == null ? void 0 : o.visitIds.has(w)) ?? !1;
|
|
1989
|
+
if (N.forEach((w) => {
|
|
1990
|
+
w.def.group !== S && (S = w.def.group, E.push({
|
|
1991
|
+
key: `group-${w.def.group}`,
|
|
1992
|
+
banner: n(`anamnesis.group.${w.def.group}`)
|
|
1986
1993
|
}));
|
|
1987
|
-
const u =
|
|
1988
|
-
const { visit:
|
|
1994
|
+
const u = Ms(w.def.referenceRange, n), T = k.map((y, F) => {
|
|
1995
|
+
const { visit: z, index: U } = y, I = w.cells[U] ?? zs, P = U === C, V = g == null || g.has(w.def.key), G = i && P && V && !w.def.computed, ne = !Os(k, F), ue = o != null && o.changedCells.has(`${z.id}:${w.def.key}`), pe = D(z.id);
|
|
1989
1996
|
return /* @__PURE__ */ t(
|
|
1990
1997
|
"td",
|
|
1991
1998
|
{
|
|
@@ -2004,26 +2011,26 @@ function Ms({
|
|
|
2004
2011
|
pa,
|
|
2005
2012
|
{
|
|
2006
2013
|
size: "sm",
|
|
2007
|
-
value:
|
|
2008
|
-
mode: (
|
|
2014
|
+
value: I.value,
|
|
2015
|
+
mode: (w.def.precision ?? 0) > 0 ? "decimal" : "integer",
|
|
2009
2016
|
"aria-label": n("anamnesis.grid.editCell", {
|
|
2010
|
-
parameter: Pe(
|
|
2017
|
+
parameter: Pe(w.def, n)
|
|
2011
2018
|
}),
|
|
2012
|
-
onChange: (ce) => s == null ? void 0 : s(
|
|
2019
|
+
onChange: (ce) => s == null ? void 0 : s(z, w.def, ce)
|
|
2013
2020
|
}
|
|
2014
|
-
) : /* @__PURE__ */ t("span", { className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]", children: Ve(
|
|
2021
|
+
) : /* @__PURE__ */ t("span", { className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]", children: Ve(I.value, w.def.precision) }),
|
|
2015
2022
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
2016
|
-
|
|
2017
|
-
ne ? null : /* @__PURE__ */ t(za, { delta:
|
|
2023
|
+
I.outOfRange ? /* @__PURE__ */ t(fn, { flag: I.outOfRange, t: n, compact: !0 }) : null,
|
|
2024
|
+
ne ? null : /* @__PURE__ */ t(za, { delta: I.delta, def: w.def, t: n }),
|
|
2018
2025
|
ue ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: n("anamnesis.compare.changedCell") }) : null
|
|
2019
2026
|
] })
|
|
2020
2027
|
] })
|
|
2021
2028
|
},
|
|
2022
|
-
|
|
2029
|
+
y.key
|
|
2023
2030
|
);
|
|
2024
2031
|
});
|
|
2025
|
-
|
|
2026
|
-
key:
|
|
2032
|
+
E.push({
|
|
2033
|
+
key: w.def.key,
|
|
2027
2034
|
// Sticky parameter column (inline-start). The shell splices the trend
|
|
2028
2035
|
// in after the first value cell — the order is not decided here.
|
|
2029
2036
|
header: /* @__PURE__ */ t(
|
|
@@ -2032,17 +2039,17 @@ function Ms({
|
|
|
2032
2039
|
scope: "row",
|
|
2033
2040
|
className: `${yn} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
|
|
2034
2041
|
children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
2035
|
-
/* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: Pe(
|
|
2042
|
+
/* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: Pe(w.def, n) }),
|
|
2036
2043
|
/* @__PURE__ */ d("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: [
|
|
2037
|
-
|
|
2044
|
+
w.def.unit,
|
|
2038
2045
|
u ? /* @__PURE__ */ d(Le, { children: [
|
|
2039
2046
|
" · ",
|
|
2040
2047
|
u
|
|
2041
2048
|
] }) : null
|
|
2042
2049
|
] }),
|
|
2043
|
-
|
|
2044
|
-
value: Ve(
|
|
2045
|
-
unit:
|
|
2050
|
+
w.target != null ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.grid.target", {
|
|
2051
|
+
value: Ve(w.target, w.def.precision),
|
|
2052
|
+
unit: w.def.unit ?? ""
|
|
2046
2053
|
}) }) : null
|
|
2047
2054
|
] })
|
|
2048
2055
|
}
|
|
@@ -2051,8 +2058,8 @@ function Ms({
|
|
|
2051
2058
|
trend: /* @__PURE__ */ t("td", { className: `${vn} ${je}`, children: /* @__PURE__ */ t(
|
|
2052
2059
|
mt,
|
|
2053
2060
|
{
|
|
2054
|
-
series:
|
|
2055
|
-
def:
|
|
2061
|
+
series: w.series,
|
|
2062
|
+
def: w.def,
|
|
2056
2063
|
t: n,
|
|
2057
2064
|
annotations: h,
|
|
2058
2065
|
onSelectAnnotation: p
|
|
@@ -2076,28 +2083,28 @@ function Ms({
|
|
|
2076
2083
|
)
|
|
2077
2084
|
}
|
|
2078
2085
|
);
|
|
2079
|
-
const
|
|
2086
|
+
const A = k.map((w) => /* @__PURE__ */ t(
|
|
2080
2087
|
yt,
|
|
2081
2088
|
{
|
|
2082
|
-
column:
|
|
2089
|
+
column: w,
|
|
2083
2090
|
t: n,
|
|
2084
|
-
emphasised: D(
|
|
2085
|
-
editable: i &&
|
|
2091
|
+
emphasised: D(w.visit.id),
|
|
2092
|
+
editable: i && w.index === C,
|
|
2086
2093
|
defaultOpenNoteVisitId: l,
|
|
2087
2094
|
onOpenNote: c
|
|
2088
2095
|
},
|
|
2089
|
-
|
|
2096
|
+
w.key
|
|
2090
2097
|
));
|
|
2091
2098
|
return /* @__PURE__ */ t(
|
|
2092
2099
|
vt,
|
|
2093
2100
|
{
|
|
2094
|
-
captionId:
|
|
2101
|
+
captionId: b,
|
|
2095
2102
|
caption: n("anamnesis.grid.caption"),
|
|
2096
2103
|
identityLabel: n("anamnesis.grid.parameter"),
|
|
2097
2104
|
trendLabel: n("anamnesis.grid.trend"),
|
|
2098
2105
|
trendTestId: "anamnesis-grid-trend",
|
|
2099
|
-
visitHeaders:
|
|
2100
|
-
rows:
|
|
2106
|
+
visitHeaders: A,
|
|
2107
|
+
rows: E,
|
|
2101
2108
|
framed: r
|
|
2102
2109
|
}
|
|
2103
2110
|
);
|
|
@@ -2116,28 +2123,28 @@ function bn({
|
|
|
2116
2123
|
onVisitSelectionChange: g,
|
|
2117
2124
|
onOpenNote: h
|
|
2118
2125
|
}) {
|
|
2119
|
-
const { visits: p } = e,
|
|
2126
|
+
const { visits: p } = e, b = p.length >= 2, N = We(), f = We(), C = M(() => Re(o), [o]), k = M(
|
|
2120
2127
|
() => new Set(Ne(o).map((O) => O.key)),
|
|
2121
2128
|
[o]
|
|
2122
|
-
),
|
|
2129
|
+
), E = M(() => Pa(o), [o]), [S, D] = $(r), [A, w] = $(""), u = we(null), T = we(null), y = we(!1);
|
|
2123
2130
|
ia(() => {
|
|
2124
2131
|
var O;
|
|
2125
|
-
|
|
2132
|
+
y.current && S && ((O = u.current) == null || O.scrollIntoView({ block: "start" })), y.current = !0;
|
|
2126
2133
|
}, [S]);
|
|
2127
|
-
const
|
|
2134
|
+
const F = () => {
|
|
2128
2135
|
var O;
|
|
2129
2136
|
D(!1), (O = T.current) == null || O.focus();
|
|
2130
|
-
}, [
|
|
2137
|
+
}, [z, U] = $(
|
|
2131
2138
|
() => c ? [...c] : ma(p)
|
|
2132
|
-
),
|
|
2133
|
-
const O =
|
|
2139
|
+
), I = M(() => {
|
|
2140
|
+
const O = z.filter(
|
|
2134
2141
|
(H) => p.some((j) => j.id === H)
|
|
2135
2142
|
);
|
|
2136
2143
|
return O.length >= 2 ? O : ma(p);
|
|
2137
|
-
}, [
|
|
2138
|
-
() => Da(p,
|
|
2139
|
-
[p,
|
|
2140
|
-
),
|
|
2144
|
+
}, [z, p]), P = M(
|
|
2145
|
+
() => Da(p, I).columns,
|
|
2146
|
+
[p, I]
|
|
2147
|
+
), V = M(() => S ? Ki(
|
|
2141
2148
|
P.map((O) => O.visit),
|
|
2142
2149
|
C
|
|
2143
2150
|
) : null, [S, P, C]), G = M(() => {
|
|
@@ -2145,9 +2152,9 @@ function bn({
|
|
|
2145
2152
|
for (const H of un(e, C))
|
|
2146
2153
|
O.set(H.def.key, H.series);
|
|
2147
2154
|
return O;
|
|
2148
|
-
}, [e, C]), [ne, ue] =
|
|
2155
|
+
}, [e, C]), [ne, ue] = $(
|
|
2149
2156
|
() => l ? [...l] : ma(p)
|
|
2150
|
-
), pe =
|
|
2157
|
+
), pe = $s(p), ce = M(() => {
|
|
2151
2158
|
const O = ne.filter((H) => p.some((j) => j.id === H));
|
|
2152
2159
|
return O.length > 0 ? O : ma(p);
|
|
2153
2160
|
}, [ne, p]), J = M(
|
|
@@ -2155,9 +2162,9 @@ function bn({
|
|
|
2155
2162
|
// A compared visit is always a column, so compare always marks its
|
|
2156
2163
|
// columns in the grid — comparing a visit the picker left out brings
|
|
2157
2164
|
// it back on screen rather than marking nothing.
|
|
2158
|
-
alsoShowIds: S ?
|
|
2165
|
+
alsoShowIds: S ? I : []
|
|
2159
2166
|
}),
|
|
2160
|
-
[p, ce, S,
|
|
2167
|
+
[p, ce, S, I]
|
|
2161
2168
|
), Ae = M(
|
|
2162
2169
|
() => J.columns.map((O) => O.visit.id),
|
|
2163
2170
|
[J]
|
|
@@ -2165,13 +2172,13 @@ function bn({
|
|
|
2165
2172
|
ia(() => {
|
|
2166
2173
|
g == null || g(Ae);
|
|
2167
2174
|
}, [Ae, g]);
|
|
2168
|
-
const
|
|
2175
|
+
const R = M(
|
|
2169
2176
|
() => p.map((O, H) => ({
|
|
2170
2177
|
value: O.id,
|
|
2171
2178
|
label: st(O, H, a, gt(O))
|
|
2172
2179
|
})),
|
|
2173
2180
|
[p, a]
|
|
2174
|
-
),
|
|
2181
|
+
), B = M(() => {
|
|
2175
2182
|
const O = J.firstIso ? se(J.firstIso, a) : "", H = J.lastIso ? se(J.lastIso, a) : "", be = [J.hiddenCount > 0 ? a("anamnesis.window.showing", {
|
|
2176
2183
|
shown: J.shownCount,
|
|
2177
2184
|
total: J.totalCount,
|
|
@@ -2184,15 +2191,15 @@ function bn({
|
|
|
2184
2191
|
})], Xe = J.shownCount - ce.length;
|
|
2185
2192
|
return Xe > 0 && be.push(a("anamnesis.window.addedByCompare", { added: Xe })), ce.length === 1 && be.push(a("anamnesis.window.minimum")), be.join(" · ");
|
|
2186
2193
|
}, [J, ce, a]), Z = M(
|
|
2187
|
-
() =>
|
|
2194
|
+
() => Fs(e.events, p),
|
|
2188
2195
|
[e.events, p]
|
|
2189
|
-
), [de, le] =
|
|
2196
|
+
), [de, le] = $(
|
|
2190
2197
|
() => m ? [...m] : []
|
|
2191
2198
|
), Ee = M(() => {
|
|
2192
2199
|
const O = new Set(Z.map((H) => H.event.id));
|
|
2193
2200
|
return new Set(de.filter((H) => O.has(H)));
|
|
2194
2201
|
}, [de, Z]), De = M(
|
|
2195
|
-
() =>
|
|
2202
|
+
() => Ps(Z, Ee, a),
|
|
2196
2203
|
[Z, Ee, a]
|
|
2197
2204
|
), Ie = (O) => le(
|
|
2198
2205
|
(H) => H.includes(O) ? H.filter((j) => j !== O) : [...H, O]
|
|
@@ -2200,18 +2207,18 @@ function bn({
|
|
|
2200
2207
|
() => h ? (O) => h({ kind: "event", eventId: O }) : void 0,
|
|
2201
2208
|
[h]
|
|
2202
2209
|
), la = M(() => {
|
|
2203
|
-
if (!
|
|
2210
|
+
if (!V) return null;
|
|
2204
2211
|
const O = /* @__PURE__ */ new Set();
|
|
2205
|
-
for (const H of
|
|
2212
|
+
for (const H of V.numeric)
|
|
2206
2213
|
H.values.forEach((j, be) => {
|
|
2207
2214
|
const Xe = be === 0 ? H.values[1] : H.values[be - 1];
|
|
2208
|
-
j !== Xe && O.add(`${
|
|
2215
|
+
j !== Xe && O.add(`${V.visits[be].id}:${H.def.key}`);
|
|
2209
2216
|
});
|
|
2210
2217
|
return {
|
|
2211
|
-
visitIds: new Set(
|
|
2218
|
+
visitIds: new Set(V.visits.map((H) => H.id)),
|
|
2212
2219
|
changedCells: O
|
|
2213
2220
|
};
|
|
2214
|
-
}, [
|
|
2221
|
+
}, [V]);
|
|
2215
2222
|
return p.length === 0 ? /* @__PURE__ */ t("div", { className: "ds:w-full", "data-testid": "anamnesis-evolution-empty", children: /* @__PURE__ */ t(
|
|
2216
2223
|
Be,
|
|
2217
2224
|
{
|
|
@@ -2221,7 +2228,7 @@ function bn({
|
|
|
2221
2228
|
description: a("anamnesis.empty.noVisits.description")
|
|
2222
2229
|
}
|
|
2223
2230
|
) }) : /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
2224
|
-
pe ||
|
|
2231
|
+
pe || b ? /* @__PURE__ */ d(
|
|
2225
2232
|
"div",
|
|
2226
2233
|
{
|
|
2227
2234
|
"data-testid": "anamnesis-evolution-toolbar",
|
|
@@ -2237,19 +2244,19 @@ function bn({
|
|
|
2237
2244
|
q,
|
|
2238
2245
|
{
|
|
2239
2246
|
label: a("anamnesis.window.label"),
|
|
2240
|
-
description:
|
|
2247
|
+
description: B,
|
|
2241
2248
|
children: /* @__PURE__ */ t(
|
|
2242
2249
|
rn,
|
|
2243
2250
|
{
|
|
2244
|
-
options:
|
|
2251
|
+
options: R,
|
|
2245
2252
|
value: ce,
|
|
2246
2253
|
allowSelectAll: !0,
|
|
2247
2254
|
onChange: (O) => {
|
|
2248
2255
|
if (O.length > 0) {
|
|
2249
|
-
|
|
2256
|
+
w(""), ue(O);
|
|
2250
2257
|
return;
|
|
2251
2258
|
}
|
|
2252
|
-
|
|
2259
|
+
w(a("anamnesis.window.minimum"));
|
|
2253
2260
|
}
|
|
2254
2261
|
}
|
|
2255
2262
|
)
|
|
@@ -2261,13 +2268,13 @@ function bn({
|
|
|
2261
2268
|
role: "status",
|
|
2262
2269
|
"data-testid": "anamnesis-window-floor",
|
|
2263
2270
|
className: "ds:sr-only",
|
|
2264
|
-
children:
|
|
2271
|
+
children: A
|
|
2265
2272
|
}
|
|
2266
2273
|
)
|
|
2267
2274
|
]
|
|
2268
2275
|
}
|
|
2269
2276
|
) : null,
|
|
2270
|
-
|
|
2277
|
+
b ? (
|
|
2271
2278
|
// The picker beside it is a FormField — label, control, then
|
|
2272
2279
|
// description. A bare button in an `items-start` row top-aligns
|
|
2273
2280
|
// with that LABEL and reads as floating above the control it acts
|
|
@@ -2296,7 +2303,7 @@ function bn({
|
|
|
2296
2303
|
}
|
|
2297
2304
|
) : null,
|
|
2298
2305
|
/* @__PURE__ */ t(
|
|
2299
|
-
|
|
2306
|
+
_s,
|
|
2300
2307
|
{
|
|
2301
2308
|
marks: Z,
|
|
2302
2309
|
activeIds: Ee,
|
|
@@ -2305,7 +2312,7 @@ function bn({
|
|
|
2305
2312
|
}
|
|
2306
2313
|
),
|
|
2307
2314
|
/* @__PURE__ */ t(
|
|
2308
|
-
|
|
2315
|
+
qs,
|
|
2309
2316
|
{
|
|
2310
2317
|
record: e,
|
|
2311
2318
|
defs: C,
|
|
@@ -2321,7 +2328,7 @@ function bn({
|
|
|
2321
2328
|
onOpenNote: h
|
|
2322
2329
|
}
|
|
2323
2330
|
),
|
|
2324
|
-
|
|
2331
|
+
b ? /* @__PURE__ */ t(sn, { open: S, onOpenChange: D, children: /* @__PURE__ */ t(
|
|
2325
2332
|
on,
|
|
2326
2333
|
{
|
|
2327
2334
|
ref: u,
|
|
@@ -2330,19 +2337,19 @@ function bn({
|
|
|
2330
2337
|
"data-testid": "anamnesis-compare-panel",
|
|
2331
2338
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
2332
2339
|
children: /* @__PURE__ */ t(
|
|
2333
|
-
|
|
2340
|
+
Rs,
|
|
2334
2341
|
{
|
|
2335
2342
|
visits: p,
|
|
2336
2343
|
columns: P,
|
|
2337
|
-
selectedIds:
|
|
2338
|
-
onSelectionChange:
|
|
2339
|
-
diff:
|
|
2344
|
+
selectedIds: I,
|
|
2345
|
+
onSelectionChange: U,
|
|
2346
|
+
diff: V,
|
|
2340
2347
|
seriesByKey: G,
|
|
2341
|
-
pathologies:
|
|
2348
|
+
pathologies: E,
|
|
2342
2349
|
annotations: De,
|
|
2343
2350
|
onSelectAnnotation: xa,
|
|
2344
2351
|
t: a,
|
|
2345
|
-
onClose:
|
|
2352
|
+
onClose: F
|
|
2346
2353
|
}
|
|
2347
2354
|
)
|
|
2348
2355
|
}
|
|
@@ -2352,7 +2359,7 @@ function bn({
|
|
|
2352
2359
|
const Ce = ["clinician"], me = [
|
|
2353
2360
|
"clinician",
|
|
2354
2361
|
"patient"
|
|
2355
|
-
],
|
|
2362
|
+
], Vs = [
|
|
2356
2363
|
{
|
|
2357
2364
|
id: "patient.identity",
|
|
2358
2365
|
surface: "intake",
|
|
@@ -2528,16 +2535,16 @@ const Ce = ["clinician"], me = [
|
|
|
2528
2535
|
rationale: "The per-tab export ENVELOPE — a title, a meta block and a list of tables. It carries no clinical content of its own: every table inside is gated on the concept it renders, so this row decides only whether a file may be produced at all. The whole-record workbook stays reserved by export.workbook.",
|
|
2529
2536
|
status: "provisional"
|
|
2530
2537
|
}
|
|
2531
|
-
],
|
|
2532
|
-
|
|
2538
|
+
], Bs = new Map(
|
|
2539
|
+
Vs.map((e) => [e.id, e])
|
|
2533
2540
|
);
|
|
2534
|
-
function
|
|
2535
|
-
const n =
|
|
2541
|
+
function Us(e, a) {
|
|
2542
|
+
const n = Bs.get(e);
|
|
2536
2543
|
return n ? n.audiences.includes(a) : !1;
|
|
2537
2544
|
}
|
|
2538
2545
|
const qa = "export.tabDocument";
|
|
2539
2546
|
function ee(e, a) {
|
|
2540
|
-
return
|
|
2547
|
+
return Us(a, e.audience) ? !0 : (e.withheld.add(a), !1);
|
|
2541
2548
|
}
|
|
2542
2549
|
function Nt(e) {
|
|
2543
2550
|
if (e.key === "bmi") return "derived.bmi";
|
|
@@ -2564,7 +2571,7 @@ function Tt(e, a) {
|
|
|
2564
2571
|
function St(e, a) {
|
|
2565
2572
|
return e === "high" ? a("anamnesis.range.aboveRange") : e === "low" ? a("anamnesis.range.belowRange") : null;
|
|
2566
2573
|
}
|
|
2567
|
-
function
|
|
2574
|
+
function Ks(e) {
|
|
2568
2575
|
return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
2569
2576
|
}
|
|
2570
2577
|
function qe(e) {
|
|
@@ -2573,7 +2580,7 @@ function qe(e) {
|
|
|
2573
2580
|
return ha(a) ? a : null;
|
|
2574
2581
|
}
|
|
2575
2582
|
function Ia(e, a, n, i, s) {
|
|
2576
|
-
const o = i ?
|
|
2583
|
+
const o = i ? Ks(`${a.patient.lastName} ${a.patient.firstName}`) : "";
|
|
2577
2584
|
return [
|
|
2578
2585
|
"anamnesis",
|
|
2579
2586
|
e,
|
|
@@ -2585,12 +2592,12 @@ function Ia(e, a, n, i, s) {
|
|
|
2585
2592
|
function xn(e, a) {
|
|
2586
2593
|
return a(`anamnesis.export.audience.${e}`);
|
|
2587
2594
|
}
|
|
2588
|
-
function
|
|
2595
|
+
function Hs(e, a) {
|
|
2589
2596
|
return a(`anamnesis.export.tab.${e}`);
|
|
2590
2597
|
}
|
|
2591
2598
|
function At(e, a) {
|
|
2592
2599
|
return a(`anamnesis.export.docTab.${e}`, {
|
|
2593
|
-
defaultValue:
|
|
2600
|
+
defaultValue: Hs(e, a)
|
|
2594
2601
|
});
|
|
2595
2602
|
}
|
|
2596
2603
|
function kn(e, a, n, i) {
|
|
@@ -2638,8 +2645,8 @@ function La(e, a, n, i = []) {
|
|
|
2638
2645
|
locale: pn(n)
|
|
2639
2646
|
};
|
|
2640
2647
|
}
|
|
2641
|
-
function
|
|
2642
|
-
var
|
|
2648
|
+
function js(e) {
|
|
2649
|
+
var b;
|
|
2643
2650
|
const { record: a, audience: n, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = { audience: n, withheld: /* @__PURE__ */ new Set() };
|
|
2644
2651
|
if (!ee(r, qa))
|
|
2645
2652
|
return wn("summary", n, i);
|
|
@@ -2651,12 +2658,12 @@ function Hs(e) {
|
|
|
2651
2658
|
if (C.length !== 0) {
|
|
2652
2659
|
N.push(Ct(ye(f, i)));
|
|
2653
2660
|
for (const k of C) {
|
|
2654
|
-
const
|
|
2655
|
-
|
|
2661
|
+
const E = h.answers[k.key];
|
|
2662
|
+
E && N.push({
|
|
2656
2663
|
cells: [
|
|
2657
2664
|
he(k, i),
|
|
2658
|
-
ie(gn(
|
|
2659
|
-
i(`anamnesis.export.source.${
|
|
2665
|
+
ie(gn(E.value, k, i)),
|
|
2666
|
+
i(`anamnesis.export.source.${E.origin}`)
|
|
2660
2667
|
]
|
|
2661
2668
|
});
|
|
2662
2669
|
}
|
|
@@ -2674,7 +2681,7 @@ function Hs(e) {
|
|
|
2674
2681
|
emptyText: i("anamnesis.summary.noAnswers")
|
|
2675
2682
|
});
|
|
2676
2683
|
} else h || g.push(i("anamnesis.compile.noIntake"));
|
|
2677
|
-
const p = qe(h == null ? void 0 : h.submittedAtIso) ?? qe((
|
|
2684
|
+
const p = qe(h == null ? void 0 : h.submittedAtIso) ?? qe((b = _a(a)) == null ? void 0 : b.dateIso) ?? qe(o);
|
|
2678
2685
|
return La(
|
|
2679
2686
|
{
|
|
2680
2687
|
tab: "summary",
|
|
@@ -2732,7 +2739,7 @@ function Ka(e, a, n, i) {
|
|
|
2732
2739
|
emptyText: i("anamnesis.export.none")
|
|
2733
2740
|
};
|
|
2734
2741
|
}
|
|
2735
|
-
function
|
|
2742
|
+
function Gs(e) {
|
|
2736
2743
|
const { record: a, audience: n, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = { audience: n, withheld: /* @__PURE__ */ new Set() };
|
|
2737
2744
|
if (!ee(r, qa))
|
|
2738
2745
|
return wn("compile", n, i);
|
|
@@ -2781,7 +2788,7 @@ function js(e) {
|
|
|
2781
2788
|
}), p.length > 0 && g.push(
|
|
2782
2789
|
Ka("visit", i("anamnesis.section.visitMeta"), p, i)
|
|
2783
2790
|
);
|
|
2784
|
-
const
|
|
2791
|
+
const b = Ua(
|
|
2785
2792
|
"anthropometrics",
|
|
2786
2793
|
i("anamnesis.section.anthropometrics"),
|
|
2787
2794
|
Ne(s, "anthropometric"),
|
|
@@ -2790,7 +2797,7 @@ function js(e) {
|
|
|
2790
2797
|
i,
|
|
2791
2798
|
!1
|
|
2792
2799
|
);
|
|
2793
|
-
|
|
2800
|
+
b && g.push(b);
|
|
2794
2801
|
const N = Ua(
|
|
2795
2802
|
"dietary",
|
|
2796
2803
|
i("anamnesis.section.dietary"),
|
|
@@ -2812,32 +2819,32 @@ function js(e) {
|
|
|
2812
2819
|
header: i("anamnesis.export.column.description")
|
|
2813
2820
|
}
|
|
2814
2821
|
],
|
|
2815
|
-
rows: m.pathologyCodes.map((
|
|
2816
|
-
cells: [
|
|
2822
|
+
rows: m.pathologyCodes.map((E) => ({
|
|
2823
|
+
cells: [E, hn(E, i, k[E])]
|
|
2817
2824
|
})),
|
|
2818
2825
|
emptyText: i("anamnesis.export.none")
|
|
2819
2826
|
});
|
|
2820
2827
|
}
|
|
2821
2828
|
if (ee(r, "oncological.history")) {
|
|
2822
|
-
const k = m.oncological,
|
|
2829
|
+
const k = m.oncological, E = [];
|
|
2823
2830
|
if (k) {
|
|
2824
|
-
if (ie(k.tumourType) &&
|
|
2831
|
+
if (ie(k.tumourType) && E.push({
|
|
2825
2832
|
cells: [
|
|
2826
2833
|
i("anamnesis.field.tumourType.label"),
|
|
2827
2834
|
ie(k.tumourType)
|
|
2828
2835
|
]
|
|
2829
|
-
}), ie(k.stage) &&
|
|
2836
|
+
}), ie(k.stage) && E.push({
|
|
2830
2837
|
cells: [i("anamnesis.field.stage.label"), ie(k.stage)]
|
|
2831
2838
|
}), k.metastases) {
|
|
2832
2839
|
const S = i(`anamnesis.common.${k.metastases.present}`), D = ie(k.metastases.site);
|
|
2833
|
-
|
|
2840
|
+
E.push({
|
|
2834
2841
|
cells: [
|
|
2835
2842
|
i("anamnesis.field.metastases.label"),
|
|
2836
2843
|
D ? `${S} — ${D}` : S
|
|
2837
2844
|
]
|
|
2838
2845
|
});
|
|
2839
2846
|
}
|
|
2840
|
-
ie(k.treatmentStatus) &&
|
|
2847
|
+
ie(k.treatmentStatus) && E.push({
|
|
2841
2848
|
cells: [
|
|
2842
2849
|
i("anamnesis.field.treatmentStatus.label"),
|
|
2843
2850
|
ie(k.treatmentStatus)
|
|
@@ -2848,7 +2855,7 @@ function js(e) {
|
|
|
2848
2855
|
Ka(
|
|
2849
2856
|
"oncological",
|
|
2850
2857
|
i("anamnesis.section.oncological"),
|
|
2851
|
-
|
|
2858
|
+
E,
|
|
2852
2859
|
i
|
|
2853
2860
|
)
|
|
2854
2861
|
);
|
|
@@ -2898,20 +2905,20 @@ function js(e) {
|
|
|
2898
2905
|
})),
|
|
2899
2906
|
emptyText: i("anamnesis.compile.noFmd")
|
|
2900
2907
|
}), ee(r, "annual.programme")) {
|
|
2901
|
-
const k = m.annualProgramme,
|
|
2908
|
+
const k = m.annualProgramme, E = [];
|
|
2902
2909
|
if (k) {
|
|
2903
2910
|
const S = (D) => i(D ? "anamnesis.common.yes" : "anamnesis.common.no");
|
|
2904
|
-
|
|
2911
|
+
E.push({
|
|
2905
2912
|
cells: [
|
|
2906
2913
|
i("anamnesis.field.annualProposed.label"),
|
|
2907
2914
|
S(k.proposed)
|
|
2908
2915
|
]
|
|
2909
|
-
}),
|
|
2916
|
+
}), E.push({
|
|
2910
2917
|
cells: [
|
|
2911
2918
|
i("anamnesis.field.annualAccepted.label"),
|
|
2912
2919
|
S(k.accepted)
|
|
2913
2920
|
]
|
|
2914
|
-
}), ie(k.declineReason) &&
|
|
2921
|
+
}), ie(k.declineReason) && E.push({
|
|
2915
2922
|
cells: [
|
|
2916
2923
|
i("anamnesis.field.annualDeclineReason.label"),
|
|
2917
2924
|
ie(k.declineReason)
|
|
@@ -2919,7 +2926,7 @@ function js(e) {
|
|
|
2919
2926
|
});
|
|
2920
2927
|
}
|
|
2921
2928
|
g.push(
|
|
2922
|
-
Ka("annual", i("anamnesis.section.annual"),
|
|
2929
|
+
Ka("annual", i("anamnesis.section.annual"), E, i)
|
|
2923
2930
|
);
|
|
2924
2931
|
}
|
|
2925
2932
|
const C = [];
|
|
@@ -2963,7 +2970,7 @@ function js(e) {
|
|
|
2963
2970
|
h
|
|
2964
2971
|
);
|
|
2965
2972
|
}
|
|
2966
|
-
function
|
|
2973
|
+
function Ws(e, a, n) {
|
|
2967
2974
|
const i = a.map((s) => {
|
|
2968
2975
|
var r;
|
|
2969
2976
|
const o = ((r = e.cells[s.index]) == null ? void 0 : r.outOfRange) ?? null;
|
|
@@ -2974,18 +2981,18 @@ function Gs(e, a, n) {
|
|
|
2974
2981
|
}).filter((s) => s != null);
|
|
2975
2982
|
return i.length === 0 ? null : i.join(n("anamnesis.export.listSeparator"));
|
|
2976
2983
|
}
|
|
2977
|
-
function
|
|
2984
|
+
function Qs(e, a) {
|
|
2978
2985
|
var s, o;
|
|
2979
2986
|
if (a.length < 2) return null;
|
|
2980
2987
|
const n = ((s = e.cells[a[0].index]) == null ? void 0 : s.value) ?? null, i = ((o = e.cells[a[a.length - 1].index]) == null ? void 0 : o.value) ?? null;
|
|
2981
2988
|
return n == null || i == null ? null : i - n;
|
|
2982
2989
|
}
|
|
2983
|
-
function
|
|
2990
|
+
function Ys(e) {
|
|
2984
2991
|
var C;
|
|
2985
2992
|
const { record: a, audience: n, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = e.scope ?? "selected", l = { audience: n, withheld: /* @__PURE__ */ new Set() };
|
|
2986
2993
|
if (!ee(l, qa))
|
|
2987
2994
|
return wn("evolution", n, i);
|
|
2988
|
-
const { meta: c, patientName: m } = kn(a, l, i, o), g = [], h = [], p = e.selectedVisitIds ? [...e.selectedVisitIds] : null,
|
|
2995
|
+
const { meta: c, patientName: m } = kn(a, l, i, o), g = [], h = [], p = e.selectedVisitIds ? [...e.selectedVisitIds] : null, b = p && p.length > 0 ? p : ma(a.visits), N = r === "all" ? wt(a.visits) : Da(a.visits, b).columns;
|
|
2989
2996
|
if (c.push({
|
|
2990
2997
|
label: i("anamnesis.export.visitsLabel"),
|
|
2991
2998
|
value: r === "all" ? i("anamnesis.export.visitsAll", { total: a.visits.length }) : i("anamnesis.export.visitsSelected", {
|
|
@@ -2993,7 +3000,7 @@ function Qs(e) {
|
|
|
2993
3000
|
total: a.visits.length
|
|
2994
3001
|
})
|
|
2995
3002
|
}), ee(l, "visit.date") && N.length > 0) {
|
|
2996
|
-
const k = Re(s),
|
|
3003
|
+
const k = Re(s), E = un(a, k), S = se(N[0].visit.dateIso, i), D = se(N[N.length - 1].visit.dateIso, i), A = [
|
|
2997
3004
|
{ key: "parameter", header: i("anamnesis.grid.parameter") },
|
|
2998
3005
|
{ key: "unit", header: i("anamnesis.export.column.unit") },
|
|
2999
3006
|
{
|
|
@@ -3019,29 +3026,29 @@ function Qs(e) {
|
|
|
3019
3026
|
numeric: !0
|
|
3020
3027
|
},
|
|
3021
3028
|
{ key: "outOfRange", header: i("anamnesis.export.column.outOfRange") }
|
|
3022
|
-
],
|
|
3029
|
+
], w = [];
|
|
3023
3030
|
let u = null;
|
|
3024
|
-
for (const T of
|
|
3025
|
-
ee(l, Nt(T.def)) && (T.def.group !== u && (u = T.def.group,
|
|
3031
|
+
for (const T of E)
|
|
3032
|
+
ee(l, Nt(T.def)) && (T.def.group !== u && (u = T.def.group, w.push(Ct(i(`anamnesis.group.${T.def.group}`)))), w.push({
|
|
3026
3033
|
precision: T.def.precision,
|
|
3027
3034
|
cells: [
|
|
3028
3035
|
Pe(T.def, i),
|
|
3029
3036
|
T.def.unit ?? null,
|
|
3030
3037
|
Tt(T.def, i),
|
|
3031
|
-
...N.map((
|
|
3032
|
-
var
|
|
3033
|
-
return ((
|
|
3038
|
+
...N.map((y) => {
|
|
3039
|
+
var F;
|
|
3040
|
+
return ((F = T.cells[y.index]) == null ? void 0 : F.value) ?? null;
|
|
3034
3041
|
}),
|
|
3035
3042
|
T.target,
|
|
3036
|
-
|
|
3037
|
-
|
|
3043
|
+
Qs(T, N),
|
|
3044
|
+
Ws(T, N, i)
|
|
3038
3045
|
]
|
|
3039
3046
|
}));
|
|
3040
3047
|
g.push({
|
|
3041
3048
|
id: "matrix",
|
|
3042
3049
|
title: i("anamnesis.section.evolution"),
|
|
3043
|
-
columns:
|
|
3044
|
-
rows:
|
|
3050
|
+
columns: A,
|
|
3051
|
+
rows: w,
|
|
3045
3052
|
emptyText: i("anamnesis.export.none")
|
|
3046
3053
|
});
|
|
3047
3054
|
} else N.length === 0 && h.push(i("anamnesis.export.none"));
|
|
@@ -3067,17 +3074,17 @@ function Qs(e) {
|
|
|
3067
3074
|
h
|
|
3068
3075
|
);
|
|
3069
3076
|
}
|
|
3070
|
-
function
|
|
3077
|
+
function Xs(e, a) {
|
|
3071
3078
|
switch (e) {
|
|
3072
3079
|
case "summary":
|
|
3073
|
-
return Hs(a);
|
|
3074
|
-
case "compile":
|
|
3075
3080
|
return js(a);
|
|
3081
|
+
case "compile":
|
|
3082
|
+
return Gs(a);
|
|
3076
3083
|
case "evolution":
|
|
3077
|
-
return
|
|
3084
|
+
return Ys(a);
|
|
3078
3085
|
}
|
|
3079
3086
|
}
|
|
3080
|
-
function
|
|
3087
|
+
function Js(e, a) {
|
|
3081
3088
|
return a(`anamnesis.export.concept.${e.replace(/\./g, "_")}`, {
|
|
3082
3089
|
defaultValue: e
|
|
3083
3090
|
});
|
|
@@ -3085,12 +3092,12 @@ function Xs(e, a) {
|
|
|
3085
3092
|
function _n(e, a) {
|
|
3086
3093
|
return {
|
|
3087
3094
|
included: e.tables.map((n) => n.title),
|
|
3088
|
-
excluded: e.withheld.map((n) =>
|
|
3095
|
+
excluded: e.withheld.map((n) => Js(n, a)).sort((n, i) => n.localeCompare(i, e.locale))
|
|
3089
3096
|
};
|
|
3090
3097
|
}
|
|
3091
|
-
const
|
|
3092
|
-
`,
|
|
3093
|
-
function
|
|
3098
|
+
const Zs = "text/csv;charset=utf-8", eo = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $n = `\r
|
|
3099
|
+
`, ao = /^[=+\-@\t\r]/;
|
|
3100
|
+
function no(e) {
|
|
3094
3101
|
var a;
|
|
3095
3102
|
if (!e) return ".";
|
|
3096
3103
|
try {
|
|
@@ -3102,25 +3109,25 @@ function ao(e) {
|
|
|
3102
3109
|
}
|
|
3103
3110
|
}
|
|
3104
3111
|
function Nn(e) {
|
|
3105
|
-
return
|
|
3112
|
+
return no(e) === "," ? { delimiter: ";", decimal: ",", eol: $n, bom: !0 } : { delimiter: ",", decimal: ".", eol: $n, bom: !0 };
|
|
3106
3113
|
}
|
|
3107
|
-
function
|
|
3114
|
+
function to(e, a, n) {
|
|
3108
3115
|
if (!Number.isFinite(e)) return "";
|
|
3109
3116
|
const i = a == null ? String(e) : e.toFixed(a);
|
|
3110
3117
|
return n.decimal === "," ? i.replace(".", ",") : i;
|
|
3111
3118
|
}
|
|
3112
3119
|
function ze(e, a) {
|
|
3113
|
-
const n =
|
|
3120
|
+
const n = ao.test(e) ? `'${e}` : e;
|
|
3114
3121
|
return n.includes(a.delimiter) || n.includes('"') || n.includes(`
|
|
3115
3122
|
`) || n.includes("\r") || n !== n.trim() ? `"${n.replace(/"/g, '""')}"` : n;
|
|
3116
3123
|
}
|
|
3117
3124
|
function zn(e, a, n) {
|
|
3118
|
-
return e == null ? "" : typeof e == "number" ?
|
|
3125
|
+
return e == null ? "" : typeof e == "number" ? to(e, n, a) : ze(e, a);
|
|
3119
3126
|
}
|
|
3120
3127
|
function Et(e, a) {
|
|
3121
3128
|
return e.precision ?? (a == null ? void 0 : a.precision);
|
|
3122
3129
|
}
|
|
3123
|
-
function
|
|
3130
|
+
function io(e, a = Nn(e.locale)) {
|
|
3124
3131
|
const n = [], i = (s) => n.push(s.join(a.delimiter));
|
|
3125
3132
|
i([ze(e.title, a)]);
|
|
3126
3133
|
for (const s of e.meta)
|
|
@@ -3155,11 +3162,11 @@ function to(e, a = Nn(e.locale)) {
|
|
|
3155
3162
|
}
|
|
3156
3163
|
return n.join(a.eol) + a.eol;
|
|
3157
3164
|
}
|
|
3158
|
-
function
|
|
3159
|
-
const n =
|
|
3160
|
-
return new Blob([a.bom ? `\uFEFF${n}` : n], { type:
|
|
3165
|
+
function so(e, a = Nn(e.locale)) {
|
|
3166
|
+
const n = io(e, a);
|
|
3167
|
+
return new Blob([a.bom ? `\uFEFF${n}` : n], { type: Zs });
|
|
3161
3168
|
}
|
|
3162
|
-
async function
|
|
3169
|
+
async function oo() {
|
|
3163
3170
|
const e = await import("./exceljs.min-D2MHbJsF.js").then((n) => n.e), a = e;
|
|
3164
3171
|
return typeof a.Workbook == "function" ? e : a.default ?? e;
|
|
3165
3172
|
}
|
|
@@ -3172,20 +3179,20 @@ function On(e, a) {
|
|
|
3172
3179
|
}
|
|
3173
3180
|
return a.add(i.toLowerCase()), i;
|
|
3174
3181
|
}
|
|
3175
|
-
function
|
|
3182
|
+
function ro(e) {
|
|
3176
3183
|
if (e != null)
|
|
3177
3184
|
return e > 0 ? `0.${"0".repeat(e)}` : "0";
|
|
3178
3185
|
}
|
|
3179
|
-
const
|
|
3180
|
-
function
|
|
3186
|
+
const lo = 12, co = 60;
|
|
3187
|
+
function mo(e, a) {
|
|
3181
3188
|
const n = a.reduce(
|
|
3182
3189
|
(i, s) => Math.max(i, s == null ? 0 : String(s).length),
|
|
3183
3190
|
e.length
|
|
3184
3191
|
);
|
|
3185
|
-
return Math.min(
|
|
3192
|
+
return Math.min(co, Math.max(lo, n + 2));
|
|
3186
3193
|
}
|
|
3187
|
-
async function
|
|
3188
|
-
const a = await
|
|
3194
|
+
async function uo(e) {
|
|
3195
|
+
const a = await oo(), n = new a.Workbook();
|
|
3189
3196
|
n.created = /* @__PURE__ */ new Date();
|
|
3190
3197
|
const i = /* @__PURE__ */ new Set(), s = n.addWorksheet(On(e.title, i)), o = s.addRow([e.title]);
|
|
3191
3198
|
o.font = { bold: !0 };
|
|
@@ -3202,27 +3209,27 @@ async function mo(e) {
|
|
|
3202
3209
|
m.font = { bold: !0 }, c.views = [{ state: "frozen", ySplit: 1 }], l.rows.length === 0 && l.emptyText && c.addRow([l.emptyText]);
|
|
3203
3210
|
for (const g of l.rows) {
|
|
3204
3211
|
if (g.kind === "section") {
|
|
3205
|
-
const
|
|
3206
|
-
|
|
3212
|
+
const b = c.addRow([g.cells[0] ?? null]);
|
|
3213
|
+
b.font = { bold: !0 };
|
|
3207
3214
|
continue;
|
|
3208
3215
|
}
|
|
3209
|
-
const h = l.columns.map((
|
|
3210
|
-
l.columns.forEach((
|
|
3216
|
+
const h = l.columns.map((b, N) => g.cells[N] ?? null), p = c.addRow(h);
|
|
3217
|
+
l.columns.forEach((b, N) => {
|
|
3211
3218
|
const f = p.getCell(N + 1);
|
|
3212
3219
|
if (typeof h[N] != "number") return;
|
|
3213
|
-
const C =
|
|
3220
|
+
const C = ro(Et(g, b));
|
|
3214
3221
|
C && (f.numFmt = C), f.alignment = { horizontal: "right" };
|
|
3215
3222
|
});
|
|
3216
3223
|
}
|
|
3217
3224
|
l.columns.forEach((g, h) => {
|
|
3218
|
-
c.getColumn(h + 1).width =
|
|
3225
|
+
c.getColumn(h + 1).width = mo(
|
|
3219
3226
|
g.header,
|
|
3220
3227
|
l.rows.map((p) => p.cells[h] ?? null)
|
|
3221
3228
|
);
|
|
3222
3229
|
});
|
|
3223
3230
|
}
|
|
3224
3231
|
const r = await n.xlsx.writeBuffer();
|
|
3225
|
-
return new Blob([r], { type:
|
|
3232
|
+
return new Blob([r], { type: eo });
|
|
3226
3233
|
}
|
|
3227
3234
|
function Cn(e, a) {
|
|
3228
3235
|
return `${e.fileStem}.${a}`;
|
|
@@ -3233,11 +3240,11 @@ function Tn(e, a) {
|
|
|
3233
3240
|
const n = URL.createObjectURL(e), i = document.createElement("a");
|
|
3234
3241
|
return i.href = n, i.download = a, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(n), 0), !0;
|
|
3235
3242
|
}
|
|
3236
|
-
function
|
|
3237
|
-
return Tn(
|
|
3243
|
+
function po(e, a = Nn(e.locale)) {
|
|
3244
|
+
return Tn(so(e, a), Cn(e, "csv"));
|
|
3238
3245
|
}
|
|
3239
|
-
async function
|
|
3240
|
-
return Tn(await
|
|
3246
|
+
async function ho(e) {
|
|
3247
|
+
return Tn(await uo(e), Cn(e, "xlsx"));
|
|
3241
3248
|
}
|
|
3242
3249
|
const Ue = {
|
|
3243
3250
|
headerFill: [237, 237, 240],
|
|
@@ -3262,7 +3269,7 @@ function ea(e, a, n) {
|
|
|
3262
3269
|
const l = r.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
|
|
3263
3270
|
return l ? [Number(l[1]), Number(l[2]), Number(l[3])] : a;
|
|
3264
3271
|
}
|
|
3265
|
-
function
|
|
3272
|
+
function go(e) {
|
|
3266
3273
|
return {
|
|
3267
3274
|
headerFill: ea("--muted", Ue.headerFill, e),
|
|
3268
3275
|
headerText: ea("--foreground", Ue.headerText, e),
|
|
@@ -3280,7 +3287,7 @@ function ho(e) {
|
|
|
3280
3287
|
sectionFill: ea("--muted", Ue.sectionFill, e)
|
|
3281
3288
|
};
|
|
3282
3289
|
}
|
|
3283
|
-
const
|
|
3290
|
+
const fo = [
|
|
3284
3291
|
["→", "->"],
|
|
3285
3292
|
// → the Evolution change header
|
|
3286
3293
|
["←", "<-"],
|
|
@@ -3349,17 +3356,17 @@ new Set(
|
|
|
3349
3356
|
);
|
|
3350
3357
|
function Oe(e) {
|
|
3351
3358
|
let a = e;
|
|
3352
|
-
for (const [n, i] of
|
|
3359
|
+
for (const [n, i] of fo)
|
|
3353
3360
|
a.includes(n) && (a = a.split(n).join(i));
|
|
3354
3361
|
return a;
|
|
3355
3362
|
}
|
|
3356
|
-
const te = 14,
|
|
3357
|
-
function
|
|
3363
|
+
const te = 14, yo = 6, vo = 15, bo = 9, xo = 11, Mn = 8.5, qn = 8, $e = 5;
|
|
3364
|
+
function ko(e) {
|
|
3358
3365
|
return e.tables.some(
|
|
3359
|
-
(a) => a.columns.length >
|
|
3366
|
+
(a) => a.columns.length > yo
|
|
3360
3367
|
);
|
|
3361
3368
|
}
|
|
3362
|
-
function
|
|
3369
|
+
function wo(e, a, n) {
|
|
3363
3370
|
if (!Number.isFinite(e)) return "";
|
|
3364
3371
|
try {
|
|
3365
3372
|
return new Intl.NumberFormat(n, {
|
|
@@ -3372,10 +3379,10 @@ function ko(e, a, n) {
|
|
|
3372
3379
|
}
|
|
3373
3380
|
function Dt(e, a, n) {
|
|
3374
3381
|
return e == null ? "" : Oe(
|
|
3375
|
-
typeof e == "number" ?
|
|
3382
|
+
typeof e == "number" ? wo(e, a, n) : e
|
|
3376
3383
|
);
|
|
3377
3384
|
}
|
|
3378
|
-
function
|
|
3385
|
+
function No(e, a, n) {
|
|
3379
3386
|
return a.columns.map(
|
|
3380
3387
|
(i, s) => Dt(
|
|
3381
3388
|
e.cells[s] ?? null,
|
|
@@ -3390,31 +3397,31 @@ async function It(e, a = {}) {
|
|
|
3390
3397
|
import("./jspdf.es.min-DaapWjR1.js").then((f) => f.j),
|
|
3391
3398
|
import("./jspdf.plugin.autotable-CSiDNyPn.js")
|
|
3392
3399
|
]), s = a.palette ?? Ue, o = e.locale, r = new n({
|
|
3393
|
-
orientation:
|
|
3400
|
+
orientation: ko(e) ? "landscape" : "portrait",
|
|
3394
3401
|
unit: "mm",
|
|
3395
3402
|
format: "a4"
|
|
3396
3403
|
}), l = r.internal.pageSize.getWidth(), c = r.internal.pageSize.getHeight(), m = l - te * 2, g = (f, C, k) => {
|
|
3397
3404
|
r.setFont("helvetica", f), r.setFontSize(C), r.setTextColor(k[0], k[1], k[2]);
|
|
3398
3405
|
};
|
|
3399
3406
|
let h = te;
|
|
3400
|
-
g("bold",
|
|
3407
|
+
g("bold", vo, s.headerText);
|
|
3401
3408
|
for (const f of r.splitTextToSize(
|
|
3402
3409
|
Oe(e.title),
|
|
3403
3410
|
m
|
|
3404
3411
|
))
|
|
3405
3412
|
r.text(f, te, h), h += $e + 1;
|
|
3406
|
-
h += 1, g("normal",
|
|
3413
|
+
h += 1, g("normal", bo, s.mutedText);
|
|
3407
3414
|
for (const f of e.meta)
|
|
3408
3415
|
r.text(Oe(`${f.label}: ${f.value}`), te, h), h += $e - 0.6;
|
|
3409
3416
|
for (const f of e.tables) {
|
|
3410
|
-
if (h += $e, h > c - te * 2 && (r.addPage(), h = te), g("bold",
|
|
3417
|
+
if (h += $e, h > c - te * 2 && (r.addPage(), h = te), g("bold", xo, s.headerText), r.text(Oe(f.title), te, h), h += 2, f.rows.length === 0 && f.emptyText) {
|
|
3411
3418
|
h += $e, g("normal", Mn, s.mutedText), r.text(Oe(f.emptyText), te, h), h += 1;
|
|
3412
3419
|
continue;
|
|
3413
3420
|
}
|
|
3414
|
-
const C = /* @__PURE__ */ new Set(), k = f.rows.map((D,
|
|
3421
|
+
const C = /* @__PURE__ */ new Set(), k = f.rows.map((D, A) => D.kind === "section" ? (C.add(A), [
|
|
3415
3422
|
Dt(D.cells[0] ?? null, void 0, o),
|
|
3416
3423
|
...f.columns.slice(1).map(() => "")
|
|
3417
|
-
]) :
|
|
3424
|
+
]) : No(D, f, o)), E = {}, S = {
|
|
3418
3425
|
head: [f.columns.map((D) => Oe(D.header))],
|
|
3419
3426
|
body: k,
|
|
3420
3427
|
startY: h + 2,
|
|
@@ -3436,8 +3443,8 @@ async function It(e, a = {}) {
|
|
|
3436
3443
|
},
|
|
3437
3444
|
alternateRowStyles: { fillColor: s.zebraFill },
|
|
3438
3445
|
columnStyles: Object.fromEntries(
|
|
3439
|
-
f.columns.map((D,
|
|
3440
|
-
|
|
3446
|
+
f.columns.map((D, A) => [
|
|
3447
|
+
A,
|
|
3441
3448
|
D.numeric ? { halign: "right" } : {}
|
|
3442
3449
|
])
|
|
3443
3450
|
),
|
|
@@ -3445,10 +3452,10 @@ async function It(e, a = {}) {
|
|
|
3445
3452
|
D.section === "body" && C.has(D.row.index) && (D.cell.styles.fillColor = s.sectionFill, D.cell.styles.textColor = s.headerText, D.cell.styles.fontStyle = "bold");
|
|
3446
3453
|
},
|
|
3447
3454
|
didDrawPage: (D) => {
|
|
3448
|
-
|
|
3455
|
+
E.table = D.table;
|
|
3449
3456
|
}
|
|
3450
3457
|
};
|
|
3451
|
-
i(r, S), h = ((N =
|
|
3458
|
+
i(r, S), h = ((N = E.table) == null ? void 0 : N.finalY) ?? h + $e;
|
|
3452
3459
|
}
|
|
3453
3460
|
if (e.footnotes.length > 0) {
|
|
3454
3461
|
h += $e + 1, h > c - te * 2 && (r.addPage(), h = te), g("normal", qn, s.mutedText);
|
|
@@ -3458,30 +3465,30 @@ async function It(e, a = {}) {
|
|
|
3458
3465
|
}
|
|
3459
3466
|
const p = Oe(
|
|
3460
3467
|
[e.patientName, e.audienceLabel].filter(Boolean).join(" · ")
|
|
3461
|
-
),
|
|
3462
|
-
for (let f = 1; f <=
|
|
3468
|
+
), b = r.getNumberOfPages();
|
|
3469
|
+
for (let f = 1; f <= b; f += 1)
|
|
3463
3470
|
r.setPage(f), g("normal", qn, s.mutedText), p && r.text(p, te, c - te + 4), r.text(
|
|
3464
|
-
`${f} / ${
|
|
3471
|
+
`${f} / ${b}`,
|
|
3465
3472
|
l - te,
|
|
3466
3473
|
c - te + 4,
|
|
3467
3474
|
{ align: "right" }
|
|
3468
3475
|
);
|
|
3469
3476
|
return a.autoPrint && r.autoPrint(), r.output("blob");
|
|
3470
3477
|
}
|
|
3471
|
-
async function
|
|
3478
|
+
async function Co(e, a = {}) {
|
|
3472
3479
|
return Tn(
|
|
3473
3480
|
await It(e, a),
|
|
3474
3481
|
Cn(e, "pdf")
|
|
3475
3482
|
);
|
|
3476
3483
|
}
|
|
3477
|
-
async function
|
|
3484
|
+
async function To(e, a, n = {}) {
|
|
3478
3485
|
if (!a || typeof URL > "u" || typeof URL.createObjectURL != "function")
|
|
3479
3486
|
return null;
|
|
3480
3487
|
const i = await It(e, { ...n, autoPrint: !0 }), s = URL.createObjectURL(i);
|
|
3481
3488
|
return a.setAttribute("src", s), s;
|
|
3482
3489
|
}
|
|
3483
3490
|
const nn = ["clinician", "patient"];
|
|
3484
|
-
function
|
|
3491
|
+
function So({
|
|
3485
3492
|
tab: e,
|
|
3486
3493
|
record: a,
|
|
3487
3494
|
t: n,
|
|
@@ -3491,63 +3498,63 @@ function To({
|
|
|
3491
3498
|
defaultShareOpen: r = !1,
|
|
3492
3499
|
defaultAudience: l = "clinician"
|
|
3493
3500
|
}) {
|
|
3494
|
-
const [c, m] =
|
|
3501
|
+
const [c, m] = $(l), [g, h] = $(!1), [p, b] = $(o), [N, f] = $(r), [C, k] = $(l), [E, S] = $({ text: "", seq: 0 }), D = we(null), A = we(null), w = we(null), u = we(!1), T = We();
|
|
3495
3502
|
ia(
|
|
3496
3503
|
() => () => {
|
|
3497
|
-
|
|
3504
|
+
w.current && URL.revokeObjectURL(w.current);
|
|
3498
3505
|
},
|
|
3499
3506
|
[]
|
|
3500
3507
|
);
|
|
3501
|
-
const
|
|
3502
|
-
(
|
|
3508
|
+
const y = na(
|
|
3509
|
+
(B) => Xs(e, {
|
|
3503
3510
|
record: a,
|
|
3504
|
-
audience:
|
|
3511
|
+
audience: B,
|
|
3505
3512
|
t: n,
|
|
3506
3513
|
config: i,
|
|
3507
3514
|
selectedVisitIds: s,
|
|
3508
3515
|
scope: g ? "all" : "selected"
|
|
3509
3516
|
}),
|
|
3510
3517
|
[e, a, n, i, s, g]
|
|
3511
|
-
),
|
|
3512
|
-
() => p ? _n(
|
|
3513
|
-
[p,
|
|
3514
|
-
),
|
|
3515
|
-
clinician:
|
|
3516
|
-
list:
|
|
3518
|
+
), F = n(`anamnesis.export.tab.${e}`), z = n("anamnesis.export.control.audienceBadge"), U = M(
|
|
3519
|
+
() => p ? _n(y("patient"), n).excluded : [],
|
|
3520
|
+
[p, y, n]
|
|
3521
|
+
), I = {
|
|
3522
|
+
clinician: U.length > 0 ? n("anamnesis.export.control.holds", {
|
|
3523
|
+
list: U.join(n("anamnesis.export.listSeparator"))
|
|
3517
3524
|
}) : n("anamnesis.export.control.holdsNone"),
|
|
3518
|
-
patient:
|
|
3519
|
-
list:
|
|
3525
|
+
patient: U.length > 0 ? n("anamnesis.export.control.excludes", {
|
|
3526
|
+
list: U.join(n("anamnesis.export.listSeparator"))
|
|
3520
3527
|
}) : n("anamnesis.export.control.excludesNone")
|
|
3521
3528
|
}, P = M(
|
|
3522
|
-
() => N ? _n(
|
|
3523
|
-
[N,
|
|
3524
|
-
),
|
|
3529
|
+
() => N ? _n(y(C), n) : { included: [], excluded: [] },
|
|
3530
|
+
[N, y, C, n]
|
|
3531
|
+
), V = (B) => S((Z) => ({ text: B, seq: Z.seq + 1 })), G = (B, Z) => {
|
|
3525
3532
|
if (u.current) return;
|
|
3526
3533
|
u.current = !0;
|
|
3527
|
-
const de =
|
|
3534
|
+
const de = y(c);
|
|
3528
3535
|
Promise.resolve(Z(de)).then(
|
|
3529
|
-
(le) =>
|
|
3536
|
+
(le) => V(
|
|
3530
3537
|
le ? n("anamnesis.export.control.ready", {
|
|
3531
|
-
file: `${de.fileStem}.${
|
|
3538
|
+
file: `${de.fileStem}.${B}`
|
|
3532
3539
|
}) : n("anamnesis.export.control.failed")
|
|
3533
3540
|
)
|
|
3534
|
-
).catch(() =>
|
|
3541
|
+
).catch(() => V(n("anamnesis.export.control.failed"))).finally(() => {
|
|
3535
3542
|
u.current = !1;
|
|
3536
3543
|
});
|
|
3537
|
-
}, ne = () =>
|
|
3538
|
-
u.current || (u.current = !0,
|
|
3539
|
-
if (!
|
|
3540
|
-
|
|
3544
|
+
}, ne = () => go(D.current), ue = () => G("pdf", (B) => Co(B, { palette: ne() })), pe = () => G("xlsx", ho), ce = () => G("csv", po), J = () => {
|
|
3545
|
+
u.current || (u.current = !0, To(y(c), A.current, { palette: ne() }).then((B) => {
|
|
3546
|
+
if (!B) {
|
|
3547
|
+
V(n("anamnesis.export.control.failed"));
|
|
3541
3548
|
return;
|
|
3542
3549
|
}
|
|
3543
|
-
|
|
3544
|
-
}).catch(() =>
|
|
3550
|
+
w.current && URL.revokeObjectURL(w.current), w.current = B, V(n("anamnesis.export.control.printing"));
|
|
3551
|
+
}).catch(() => V(n("anamnesis.export.control.failed"))).finally(() => {
|
|
3545
3552
|
u.current = !1;
|
|
3546
3553
|
}));
|
|
3547
3554
|
}, Ae = () => {
|
|
3548
3555
|
k(c), f(!0);
|
|
3549
|
-
},
|
|
3550
|
-
m(C), f(!1),
|
|
3556
|
+
}, R = () => {
|
|
3557
|
+
m(C), f(!1), V(
|
|
3551
3558
|
n("anamnesis.export.share.confirmed", {
|
|
3552
3559
|
audience: n(`anamnesis.export.audience.${C}`)
|
|
3553
3560
|
})
|
|
@@ -3568,14 +3575,14 @@ function To({
|
|
|
3568
3575
|
variant: "warning",
|
|
3569
3576
|
size: "sm",
|
|
3570
3577
|
"data-testid": "anamnesis-export-audience",
|
|
3571
|
-
children:
|
|
3578
|
+
children: z
|
|
3572
3579
|
}
|
|
3573
3580
|
) : null,
|
|
3574
3581
|
/* @__PURE__ */ d(
|
|
3575
3582
|
oe.Root,
|
|
3576
3583
|
{
|
|
3577
3584
|
open: p,
|
|
3578
|
-
onOpenChange:
|
|
3585
|
+
onOpenChange: b,
|
|
3579
3586
|
modal: !o,
|
|
3580
3587
|
children: [
|
|
3581
3588
|
/* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
@@ -3585,44 +3592,44 @@ function To({
|
|
|
3585
3592
|
intent: "outline",
|
|
3586
3593
|
size: "sm",
|
|
3587
3594
|
endIcon: /* @__PURE__ */ t(ln, { "aria-hidden": "true" }),
|
|
3588
|
-
"aria-label": c === "clinician" ? n("anamnesis.export.control.triggerLabel", { tab:
|
|
3589
|
-
tab:
|
|
3590
|
-
audience:
|
|
3595
|
+
"aria-label": c === "clinician" ? n("anamnesis.export.control.triggerLabel", { tab: F }) : n("anamnesis.export.control.triggerLabelAudience", {
|
|
3596
|
+
tab: F,
|
|
3597
|
+
audience: z
|
|
3591
3598
|
}),
|
|
3592
3599
|
"data-testid": "anamnesis-export-trigger",
|
|
3593
3600
|
children: n("anamnesis.export.control.trigger")
|
|
3594
3601
|
}
|
|
3595
3602
|
) }),
|
|
3596
3603
|
/* @__PURE__ */ d(oe.Content, { align: "end", children: [
|
|
3597
|
-
/* @__PURE__ */ t(oe.Label, { children: n("anamnesis.export.control.menuLabel", { tab:
|
|
3604
|
+
/* @__PURE__ */ t(oe.Label, { children: n("anamnesis.export.control.menuLabel", { tab: F }) }),
|
|
3598
3605
|
/* @__PURE__ */ t(oe.Separator, {}),
|
|
3599
3606
|
/* @__PURE__ */ t(oe.Label, { children: n("anamnesis.export.audienceLabel") }),
|
|
3600
3607
|
/* @__PURE__ */ t(
|
|
3601
3608
|
oe.RadioGroup,
|
|
3602
3609
|
{
|
|
3603
3610
|
value: c,
|
|
3604
|
-
onValueChange: (
|
|
3605
|
-
children: nn.map((
|
|
3611
|
+
onValueChange: (B) => m(B),
|
|
3612
|
+
children: nn.map((B) => /* @__PURE__ */ t(
|
|
3606
3613
|
oe.RadioItem,
|
|
3607
3614
|
{
|
|
3608
|
-
value:
|
|
3609
|
-
"aria-describedby": `${T}-${
|
|
3615
|
+
value: B,
|
|
3616
|
+
"aria-describedby": `${T}-${B}`,
|
|
3610
3617
|
onSelect: (Z) => Z.preventDefault(),
|
|
3611
|
-
children: n(`anamnesis.export.audience.${
|
|
3618
|
+
children: n(`anamnesis.export.audience.${B}`)
|
|
3612
3619
|
},
|
|
3613
|
-
|
|
3620
|
+
B
|
|
3614
3621
|
))
|
|
3615
3622
|
}
|
|
3616
3623
|
),
|
|
3617
|
-
/* @__PURE__ */ t(oe.Label, { "data-testid": "anamnesis-export-disclosure", children:
|
|
3618
|
-
nn.map((
|
|
3624
|
+
/* @__PURE__ */ t(oe.Label, { "data-testid": "anamnesis-export-disclosure", children: I[c === "patient" ? "patient" : "clinician"] }),
|
|
3625
|
+
nn.map((B) => /* @__PURE__ */ t(
|
|
3619
3626
|
"span",
|
|
3620
3627
|
{
|
|
3621
|
-
id: `${T}-${
|
|
3628
|
+
id: `${T}-${B}`,
|
|
3622
3629
|
className: "ds:sr-only",
|
|
3623
|
-
children:
|
|
3630
|
+
children: I[B]
|
|
3624
3631
|
},
|
|
3625
|
-
|
|
3632
|
+
B
|
|
3626
3633
|
)),
|
|
3627
3634
|
e === "evolution" ? (
|
|
3628
3635
|
/* SwitchItem, not CheckboxItem: a setting the menu keeps open,
|
|
@@ -3684,22 +3691,22 @@ function To({
|
|
|
3684
3691
|
}
|
|
3685
3692
|
),
|
|
3686
3693
|
/* @__PURE__ */ t(
|
|
3687
|
-
|
|
3694
|
+
Ao,
|
|
3688
3695
|
{
|
|
3689
3696
|
open: N,
|
|
3690
3697
|
onOpenChange: f,
|
|
3691
3698
|
audience: C,
|
|
3692
3699
|
onAudienceChange: k,
|
|
3693
3700
|
preview: P,
|
|
3694
|
-
onConfirm:
|
|
3695
|
-
tabName:
|
|
3701
|
+
onConfirm: R,
|
|
3702
|
+
tabName: F,
|
|
3696
3703
|
t: n
|
|
3697
3704
|
}
|
|
3698
3705
|
),
|
|
3699
3706
|
/* @__PURE__ */ t(
|
|
3700
3707
|
"iframe",
|
|
3701
3708
|
{
|
|
3702
|
-
ref:
|
|
3709
|
+
ref: A,
|
|
3703
3710
|
title: n("anamnesis.export.control.printFrame"),
|
|
3704
3711
|
"aria-hidden": "true",
|
|
3705
3712
|
tabIndex: -1,
|
|
@@ -3713,14 +3720,14 @@ function To({
|
|
|
3713
3720
|
"aria-live": "polite",
|
|
3714
3721
|
"data-testid": "anamnesis-export-status",
|
|
3715
3722
|
className: "type-body-sm ds:text-[color:var(--muted-foreground)]",
|
|
3716
|
-
children:
|
|
3723
|
+
children: E.text ? `${E.text}${E.seq % 2 ? "" : ""}` : ""
|
|
3717
3724
|
}
|
|
3718
3725
|
)
|
|
3719
3726
|
]
|
|
3720
3727
|
}
|
|
3721
3728
|
);
|
|
3722
3729
|
}
|
|
3723
|
-
function
|
|
3730
|
+
function Ao({
|
|
3724
3731
|
open: e,
|
|
3725
3732
|
onOpenChange: a,
|
|
3726
3733
|
audience: n,
|
|
@@ -3812,17 +3819,17 @@ function Vn({
|
|
|
3812
3819
|
}
|
|
3813
3820
|
);
|
|
3814
3821
|
}
|
|
3815
|
-
function
|
|
3822
|
+
function Eo(e) {
|
|
3816
3823
|
if (!e) return;
|
|
3817
3824
|
const [a, n] = e.split(":").map((i) => Number.parseInt(i, 10));
|
|
3818
3825
|
if (!(Number.isNaN(a) || Number.isNaN(n)))
|
|
3819
3826
|
return { hours: a, minutes: n };
|
|
3820
3827
|
}
|
|
3821
|
-
function
|
|
3828
|
+
function Do(e) {
|
|
3822
3829
|
const a = (n) => String(n).padStart(2, "0");
|
|
3823
3830
|
return `${a(e.hours)}:${a(e.minutes)}`;
|
|
3824
3831
|
}
|
|
3825
|
-
const
|
|
3832
|
+
const Io = /* @__PURE__ */ new Set(["weightSelf", "waterPerDay"]);
|
|
3826
3833
|
function Rt({
|
|
3827
3834
|
def: e,
|
|
3828
3835
|
answer: a,
|
|
@@ -3832,7 +3839,7 @@ function Rt({
|
|
|
3832
3839
|
readOnly: o = !1,
|
|
3833
3840
|
t: r
|
|
3834
3841
|
}) {
|
|
3835
|
-
const l =
|
|
3842
|
+
const l = Yi(e, r), c = ot(e, r), m = i && s === "patient";
|
|
3836
3843
|
let g = null;
|
|
3837
3844
|
switch (e.type) {
|
|
3838
3845
|
case "text": {
|
|
@@ -3869,7 +3876,7 @@ function Rt({
|
|
|
3869
3876
|
disabled: o,
|
|
3870
3877
|
value: h,
|
|
3871
3878
|
min: 0,
|
|
3872
|
-
mode: e.decimal ||
|
|
3879
|
+
mode: e.decimal || Io.has(e.key) ? "decimal" : "integer",
|
|
3873
3880
|
onChange: (p) => n({ kind: "number", value: p })
|
|
3874
3881
|
}
|
|
3875
3882
|
) });
|
|
@@ -3886,9 +3893,9 @@ function Rt({
|
|
|
3886
3893
|
min: 0,
|
|
3887
3894
|
max: 21,
|
|
3888
3895
|
mode: "integer",
|
|
3889
|
-
onChange: (
|
|
3896
|
+
onChange: (b) => n({
|
|
3890
3897
|
kind: "frequency",
|
|
3891
|
-
perWeek:
|
|
3898
|
+
perWeek: b,
|
|
3892
3899
|
detail: p || void 0
|
|
3893
3900
|
})
|
|
3894
3901
|
}
|
|
@@ -3898,10 +3905,10 @@ function Rt({
|
|
|
3898
3905
|
{
|
|
3899
3906
|
disabled: o,
|
|
3900
3907
|
value: p,
|
|
3901
|
-
onChange: (
|
|
3908
|
+
onChange: (b) => n({
|
|
3902
3909
|
kind: "frequency",
|
|
3903
3910
|
perWeek: h,
|
|
3904
|
-
detail:
|
|
3911
|
+
detail: b.target.value || void 0
|
|
3905
3912
|
})
|
|
3906
3913
|
}
|
|
3907
3914
|
) }) : null
|
|
@@ -3919,9 +3926,9 @@ function Rt({
|
|
|
3919
3926
|
description: c,
|
|
3920
3927
|
variant: "horizontal",
|
|
3921
3928
|
value: h,
|
|
3922
|
-
onValueChange: (
|
|
3929
|
+
onValueChange: (b) => n({
|
|
3923
3930
|
kind: "yesNo",
|
|
3924
|
-
present:
|
|
3931
|
+
present: b,
|
|
3925
3932
|
detail: p || void 0
|
|
3926
3933
|
}),
|
|
3927
3934
|
children: [
|
|
@@ -3957,10 +3964,10 @@ function Rt({
|
|
|
3957
3964
|
{
|
|
3958
3965
|
disabled: o,
|
|
3959
3966
|
value: p,
|
|
3960
|
-
onChange: (
|
|
3967
|
+
onChange: (b) => n({
|
|
3961
3968
|
kind: "yesNo",
|
|
3962
3969
|
present: h,
|
|
3963
|
-
detail:
|
|
3970
|
+
detail: b.target.value || void 0
|
|
3964
3971
|
})
|
|
3965
3972
|
}
|
|
3966
3973
|
) }) : null
|
|
@@ -3968,7 +3975,7 @@ function Rt({
|
|
|
3968
3975
|
break;
|
|
3969
3976
|
}
|
|
3970
3977
|
case "choice": {
|
|
3971
|
-
const h = (a == null ? void 0 : a.kind) === "choice" ? a.selected ?? "" : "", p = (a == null ? void 0 : a.kind) === "choice" ? a.detail ?? "" : "",
|
|
3978
|
+
const h = (a == null ? void 0 : a.kind) === "choice" ? a.selected ?? "" : "", p = (a == null ? void 0 : a.kind) === "choice" ? a.detail ?? "" : "", b = (e.options ?? []).map((N) => ({
|
|
3972
3979
|
value: N,
|
|
3973
3980
|
// A practice-added option has no kit translation; show it verbatim
|
|
3974
3981
|
// rather than the unresolved key.
|
|
@@ -3981,7 +3988,7 @@ function Rt({
|
|
|
3981
3988
|
Me,
|
|
3982
3989
|
{
|
|
3983
3990
|
disabled: o,
|
|
3984
|
-
options:
|
|
3991
|
+
options: b,
|
|
3985
3992
|
value: h,
|
|
3986
3993
|
placeholder: r("anamnesis.common.choose"),
|
|
3987
3994
|
onValueChange: (N) => n({
|
|
@@ -4007,24 +4014,24 @@ function Rt({
|
|
|
4007
4014
|
break;
|
|
4008
4015
|
}
|
|
4009
4016
|
case "multiChoice": {
|
|
4010
|
-
const h = (a == null ? void 0 : a.kind) === "multiChoice" ? a.selected : [], p = (
|
|
4017
|
+
const h = (a == null ? void 0 : a.kind) === "multiChoice" ? a.selected : [], p = (b) => n({
|
|
4011
4018
|
kind: "multiChoice",
|
|
4012
|
-
selected: h.includes(
|
|
4019
|
+
selected: h.includes(b) ? h.filter((N) => N !== b) : [...h, b]
|
|
4013
4020
|
});
|
|
4014
4021
|
g = /* @__PURE__ */ d("fieldset", { className: "ds:m-0 ds:border-0 ds:p-0", children: [
|
|
4015
4022
|
/* @__PURE__ */ t("legend", { className: "type-label ds:mb-[var(--spacing-2xs)] ds:text-[color:var(--foreground)]", children: l }),
|
|
4016
4023
|
c ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:mb-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: c }) : null,
|
|
4017
|
-
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: (e.options ?? []).map((
|
|
4024
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: (e.options ?? []).map((b) => /* @__PURE__ */ t(
|
|
4018
4025
|
li,
|
|
4019
4026
|
{
|
|
4020
4027
|
disabled: o,
|
|
4021
|
-
label: r(`anamnesis.field.${e.key}.option.${
|
|
4022
|
-
defaultValue:
|
|
4028
|
+
label: r(`anamnesis.field.${e.key}.option.${b}`, {
|
|
4029
|
+
defaultValue: b
|
|
4023
4030
|
}),
|
|
4024
|
-
checked: h.includes(
|
|
4025
|
-
onCheckedChange: () => p(
|
|
4031
|
+
checked: h.includes(b),
|
|
4032
|
+
onCheckedChange: () => p(b)
|
|
4026
4033
|
},
|
|
4027
|
-
|
|
4034
|
+
b
|
|
4028
4035
|
)) })
|
|
4029
4036
|
] });
|
|
4030
4037
|
break;
|
|
@@ -4038,10 +4045,10 @@ function Rt({
|
|
|
4038
4045
|
ci,
|
|
4039
4046
|
{
|
|
4040
4047
|
disabled: o,
|
|
4041
|
-
value:
|
|
4042
|
-
onChange: (
|
|
4048
|
+
value: Eo(h),
|
|
4049
|
+
onChange: (b) => n({
|
|
4043
4050
|
kind: "meal",
|
|
4044
|
-
time:
|
|
4051
|
+
time: Do(b),
|
|
4045
4052
|
description: p
|
|
4046
4053
|
})
|
|
4047
4054
|
}
|
|
@@ -4051,10 +4058,10 @@ function Rt({
|
|
|
4051
4058
|
{
|
|
4052
4059
|
disabled: o,
|
|
4053
4060
|
value: p,
|
|
4054
|
-
onChange: (
|
|
4061
|
+
onChange: (b) => n({
|
|
4055
4062
|
kind: "meal",
|
|
4056
4063
|
time: h,
|
|
4057
|
-
description:
|
|
4064
|
+
description: b.target.value
|
|
4058
4065
|
})
|
|
4059
4066
|
}
|
|
4060
4067
|
) }) })
|
|
@@ -4078,7 +4085,7 @@ function Rt({
|
|
|
4078
4085
|
function Lt(e) {
|
|
4079
4086
|
return Ne(e).filter((a) => a.goal === !0);
|
|
4080
4087
|
}
|
|
4081
|
-
const
|
|
4088
|
+
const Ro = {
|
|
4082
4089
|
// ±2% of goal weight (≈1.2 kg at 62 kg) is the day-to-day hydration and
|
|
4083
4090
|
// gut-content swing — indistinguishable from being at target. 10% is the
|
|
4084
4091
|
// clinically meaningful unit of weight change (the 5–10% loss guidelines are
|
|
@@ -4111,43 +4118,43 @@ const Io = {
|
|
|
4111
4118
|
approaching: 0.1,
|
|
4112
4119
|
sided: "atLeast"
|
|
4113
4120
|
}
|
|
4114
|
-
},
|
|
4121
|
+
}, Lo = {
|
|
4115
4122
|
kind: "relative",
|
|
4116
4123
|
onTarget: 0.05,
|
|
4117
4124
|
approaching: 0.15,
|
|
4118
4125
|
sided: "both"
|
|
4119
4126
|
};
|
|
4120
|
-
function
|
|
4121
|
-
return
|
|
4127
|
+
function Fo(e) {
|
|
4128
|
+
return Ro[e] ?? Lo;
|
|
4122
4129
|
}
|
|
4123
4130
|
function Bn(e, a, n) {
|
|
4124
4131
|
return e.kind === "absolute" ? a : Math.abs(n) * a;
|
|
4125
4132
|
}
|
|
4126
|
-
function
|
|
4133
|
+
function Po(e, a, n) {
|
|
4127
4134
|
if (e == null || !Number.isFinite(e) || a == null || !Number.isFinite(a)) return null;
|
|
4128
|
-
const i =
|
|
4135
|
+
const i = Fo(n), s = e - a;
|
|
4129
4136
|
if (i.sided === "atLeast" && s >= 0 || i.sided === "atMost" && s <= 0) return "onTarget";
|
|
4130
4137
|
const o = Math.abs(s);
|
|
4131
4138
|
return o <= Bn(i, i.onTarget, a) ? "onTarget" : o <= Bn(i, i.approaching, a) ? "approaching" : "offTarget";
|
|
4132
4139
|
}
|
|
4133
|
-
const
|
|
4140
|
+
const _o = {
|
|
4134
4141
|
weight: { min: 20, max: 400, step: 0.1 },
|
|
4135
4142
|
bmi: { min: 10, max: 60, step: 0.1 },
|
|
4136
4143
|
waist: { min: 30, max: 250, step: 1 },
|
|
4137
4144
|
energy: { min: 500, max: 6e3, step: 50 },
|
|
4138
4145
|
protein: { min: 10, max: 400, step: 5 }
|
|
4139
4146
|
};
|
|
4140
|
-
function
|
|
4141
|
-
const a =
|
|
4147
|
+
function $o(e) {
|
|
4148
|
+
const a = _o[e.key];
|
|
4142
4149
|
return a || { min: 0, max: 1e4, step: 10 ** -(e.precision ?? 0) };
|
|
4143
4150
|
}
|
|
4144
|
-
function
|
|
4151
|
+
function zo(e, a) {
|
|
4145
4152
|
return e == null ? !0 : Number.isFinite(e) ? e >= a.min && e <= a.max : !1;
|
|
4146
4153
|
}
|
|
4147
|
-
function
|
|
4154
|
+
function Oo(e, a) {
|
|
4148
4155
|
return e == null || a == null, e === a;
|
|
4149
4156
|
}
|
|
4150
|
-
function
|
|
4157
|
+
function Mo(e, a) {
|
|
4151
4158
|
return a.unit ? `${e.min}–${e.max} ${a.unit}` : `${e.min}–${e.max}`;
|
|
4152
4159
|
}
|
|
4153
4160
|
function Ft({
|
|
@@ -4158,7 +4165,7 @@ function Ft({
|
|
|
4158
4165
|
t: s,
|
|
4159
4166
|
onCommit: o
|
|
4160
4167
|
}) {
|
|
4161
|
-
const [r, l] =
|
|
4168
|
+
const [r, l] = $(!1), [c, m] = $(n), g = $o(e), h = zo(c, g), p = !Oo(c, n), b = Te(e, s), N = Mo(g, e), f = (k) => {
|
|
4162
4169
|
k && m(n), l(k);
|
|
4163
4170
|
}, C = (k) => {
|
|
4164
4171
|
o(k), l(!1);
|
|
@@ -4182,7 +4189,7 @@ function Ft({
|
|
|
4182
4189
|
"data-testid": `anamnesis-target-form-${e.key}`,
|
|
4183
4190
|
children: [
|
|
4184
4191
|
/* @__PURE__ */ t(fe.Close, {}),
|
|
4185
|
-
/* @__PURE__ */ t(fe.Heading, { children: s("anamnesis.targets.editTitle", { parameter:
|
|
4192
|
+
/* @__PURE__ */ t(fe.Heading, { children: s("anamnesis.targets.editTitle", { parameter: b }) }),
|
|
4186
4193
|
/* @__PURE__ */ t(fe.Description, { children: i }),
|
|
4187
4194
|
/* @__PURE__ */ d("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
4188
4195
|
/* @__PURE__ */ t(
|
|
@@ -4236,12 +4243,12 @@ function Ft({
|
|
|
4236
4243
|
)
|
|
4237
4244
|
] });
|
|
4238
4245
|
}
|
|
4239
|
-
const
|
|
4246
|
+
const qo = {
|
|
4240
4247
|
onTarget: "success",
|
|
4241
4248
|
approaching: "warning",
|
|
4242
4249
|
offTarget: "error"
|
|
4243
4250
|
};
|
|
4244
|
-
function
|
|
4251
|
+
function Vo({
|
|
4245
4252
|
variant: e = "outlined",
|
|
4246
4253
|
label: a,
|
|
4247
4254
|
target: n,
|
|
@@ -4270,7 +4277,7 @@ function qo({
|
|
|
4270
4277
|
// `mt-auto` pins it to the tile's foot, so a row of tiles stretched to
|
|
4271
4278
|
// the tallest one lines its chips up instead of leaving a hole.
|
|
4272
4279
|
/* @__PURE__ */ d("div", { className: "ds:mt-auto ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
4273
|
-
s ? /* @__PURE__ */ t(Q, { variant:
|
|
4280
|
+
s ? /* @__PURE__ */ t(Q, { variant: qo[s], size: "sm", withDot: !0, children: o }) : null,
|
|
4274
4281
|
r
|
|
4275
4282
|
] })
|
|
4276
4283
|
) : null
|
|
@@ -4282,15 +4289,16 @@ function Ha(e, a) {
|
|
|
4282
4289
|
const n = Ve(e, a.precision);
|
|
4283
4290
|
return a.unit ? `${n} ${a.unit}` : n;
|
|
4284
4291
|
}
|
|
4285
|
-
function
|
|
4286
|
-
|
|
4292
|
+
function Bo({ def: e, visits: a, target: n, t: i, onTargetChange: s }) {
|
|
4293
|
+
var h;
|
|
4294
|
+
const { t: o } = di(), r = ((h = qi(a, e)) == null ? void 0 : h.value) ?? null, l = Po(r, n, e.key), c = i("anamnesis.targets.tileLabel", {
|
|
4287
4295
|
name: Pe(e, i)
|
|
4288
4296
|
}), m = e.computed && r != null, g = r == null ? i("anamnesis.targets.nowUnset") : m ? i("anamnesis.targets.nowBanded", {
|
|
4289
4297
|
value: Ha(r, e),
|
|
4290
4298
|
band: o(`bmiCalculator.category.${ui(r)}`)
|
|
4291
4299
|
}) : i("anamnesis.targets.now", { value: Ha(r, e) });
|
|
4292
4300
|
return /* @__PURE__ */ t(
|
|
4293
|
-
|
|
4301
|
+
Vo,
|
|
4294
4302
|
{
|
|
4295
4303
|
variant: "elevated",
|
|
4296
4304
|
label: c,
|
|
@@ -4306,17 +4314,17 @@ function Vo({ def: e, visit: a, target: n, t: i, onTargetChange: s }) {
|
|
|
4306
4314
|
committed: n,
|
|
4307
4315
|
nowLabel: g,
|
|
4308
4316
|
t: i,
|
|
4309
|
-
onCommit: (
|
|
4317
|
+
onCommit: (p) => s(e, p)
|
|
4310
4318
|
}
|
|
4311
4319
|
)
|
|
4312
4320
|
}
|
|
4313
4321
|
);
|
|
4314
4322
|
}
|
|
4315
|
-
function
|
|
4323
|
+
function Uo(e) {
|
|
4316
4324
|
return e <= 1 ? "ds:grid-cols-1" : e === 2 ? "ds:grid-cols-2" : e === 3 ? "ds:grid-cols-2 ds:sm:grid-cols-3" : "ds:grid-cols-2 ds:sm:grid-cols-4";
|
|
4317
4325
|
}
|
|
4318
4326
|
function Pt({
|
|
4319
|
-
|
|
4327
|
+
visits: e,
|
|
4320
4328
|
defs: a,
|
|
4321
4329
|
targets: n,
|
|
4322
4330
|
t: i,
|
|
@@ -4338,12 +4346,12 @@ function Pt({
|
|
|
4338
4346
|
/* @__PURE__ */ t(
|
|
4339
4347
|
"div",
|
|
4340
4348
|
{
|
|
4341
|
-
className: `ds:grid ds:gap-[var(--spacing-md)] ${
|
|
4349
|
+
className: `ds:grid ds:gap-[var(--spacing-md)] ${Uo(a.length)}`,
|
|
4342
4350
|
children: a.map((o) => /* @__PURE__ */ t(
|
|
4343
|
-
|
|
4351
|
+
Bo,
|
|
4344
4352
|
{
|
|
4345
4353
|
def: o,
|
|
4346
|
-
|
|
4354
|
+
visits: e,
|
|
4347
4355
|
target: n.get(o.key) ?? null,
|
|
4348
4356
|
t: i,
|
|
4349
4357
|
onTargetChange: s
|
|
@@ -4368,7 +4376,7 @@ function ja({
|
|
|
4368
4376
|
onTargetChange: l
|
|
4369
4377
|
}) {
|
|
4370
4378
|
return /* @__PURE__ */ t("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: a.filter((c) => !c.computed).map((c) => {
|
|
4371
|
-
const m = Fe(n, c), g = i ? Fe(i, c) : null, h = i ? va(m, g, c) : null, p = ya(m, c.referenceRange),
|
|
4379
|
+
const m = Fe(n, c), g = i ? Fe(i, c) : null, h = i ? va(m, g, c) : null, p = ya(m, c.referenceRange), b = s.get(c.key) ?? null, N = Te(c, o), f = l != null && Pi(c.key) && !e.has(c.key);
|
|
4372
4380
|
return /* @__PURE__ */ d(
|
|
4373
4381
|
"div",
|
|
4374
4382
|
{
|
|
@@ -4385,9 +4393,9 @@ function ja({
|
|
|
4385
4393
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
4386
4394
|
p ? /* @__PURE__ */ t(fn, { flag: p, t: o }) : null,
|
|
4387
4395
|
/* @__PURE__ */ t(za, { delta: h, def: c, t: o }),
|
|
4388
|
-
f ||
|
|
4389
|
-
/* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children:
|
|
4390
|
-
value: Ve(
|
|
4396
|
+
f || b != null ? /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
4397
|
+
/* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: b == null ? o("anamnesis.targets.unset") : o("anamnesis.grid.target", {
|
|
4398
|
+
value: Ve(b, c.precision),
|
|
4391
4399
|
unit: c.unit ?? ""
|
|
4392
4400
|
}) }),
|
|
4393
4401
|
f ? /* @__PURE__ */ t(
|
|
@@ -4395,7 +4403,7 @@ function ja({
|
|
|
4395
4403
|
{
|
|
4396
4404
|
def: c,
|
|
4397
4405
|
label: N,
|
|
4398
|
-
committed:
|
|
4406
|
+
committed: b,
|
|
4399
4407
|
nowLabel: o("anamnesis.targets.now", {
|
|
4400
4408
|
value: `${Ve(m, c.precision)} ${c.unit ?? ""}`.trim()
|
|
4401
4409
|
}),
|
|
@@ -4470,7 +4478,7 @@ function ge({
|
|
|
4470
4478
|
}
|
|
4471
4479
|
);
|
|
4472
4480
|
}
|
|
4473
|
-
function
|
|
4481
|
+
function Ko({
|
|
4474
4482
|
record: e,
|
|
4475
4483
|
t: a,
|
|
4476
4484
|
embedded: n = !1,
|
|
@@ -4484,70 +4492,70 @@ function Uo({
|
|
|
4484
4492
|
practitioners: g,
|
|
4485
4493
|
newVisitDateIso: h,
|
|
4486
4494
|
defaultView: p = "summary",
|
|
4487
|
-
defaultExportMenuOpen:
|
|
4495
|
+
defaultExportMenuOpen: b = !1,
|
|
4488
4496
|
defaultShareOpen: N = !1,
|
|
4489
4497
|
defaultExportAudience: f = "clinician"
|
|
4490
4498
|
}) {
|
|
4491
4499
|
var An;
|
|
4492
|
-
const [C, k] =
|
|
4500
|
+
const [C, k] = $(
|
|
4493
4501
|
() => structuredClone(e)
|
|
4494
|
-
),
|
|
4502
|
+
), E = we(!1);
|
|
4495
4503
|
ia(() => {
|
|
4496
|
-
if (!
|
|
4497
|
-
|
|
4504
|
+
if (!E.current) {
|
|
4505
|
+
E.current = !0;
|
|
4498
4506
|
return;
|
|
4499
4507
|
}
|
|
4500
4508
|
m == null || m(C);
|
|
4501
4509
|
}, [C]);
|
|
4502
|
-
const S = we(0), { patient: D, visits:
|
|
4503
|
-
() => new Map(C.targets.map((
|
|
4510
|
+
const S = we(0), { patient: D, visits: A } = C, w = A[A.length - 1], u = A.length > 1 ? A[A.length - 2] : void 0, T = M(
|
|
4511
|
+
() => new Map(C.targets.map((v) => [v.parameterKey, v.target])),
|
|
4504
4512
|
[C.targets]
|
|
4505
|
-
),
|
|
4513
|
+
), y = M(
|
|
4506
4514
|
() => Ne(i, "anthropometric"),
|
|
4507
4515
|
[i]
|
|
4508
|
-
),
|
|
4516
|
+
), F = M(
|
|
4509
4517
|
() => Ne(i, "dietary"),
|
|
4510
4518
|
[i]
|
|
4511
|
-
),
|
|
4512
|
-
() => new Set(
|
|
4513
|
-
[
|
|
4519
|
+
), z = M(() => Ne(i, "lab"), [i]), U = M(() => Lt(i), [i]), I = M(
|
|
4520
|
+
() => new Set(U.map((v) => v.key)),
|
|
4521
|
+
[U]
|
|
4514
4522
|
), P = M(
|
|
4515
|
-
() => Fn(
|
|
4516
|
-
[
|
|
4517
|
-
), [
|
|
4518
|
-
const
|
|
4519
|
-
for (const
|
|
4520
|
-
return
|
|
4523
|
+
() => Fn(w, z),
|
|
4524
|
+
[w, z]
|
|
4525
|
+
), [V, G] = $(() => {
|
|
4526
|
+
const v = Fn(w, z), x = {};
|
|
4527
|
+
for (const L of ht) x[L] = v[L].open;
|
|
4528
|
+
return x;
|
|
4521
4529
|
}), ne = na(
|
|
4522
|
-
(
|
|
4530
|
+
(v) => (x) => G((L) => ({ ...L, [v]: x })),
|
|
4523
4531
|
[]
|
|
4524
4532
|
), ue = M(
|
|
4525
4533
|
() => He(i),
|
|
4526
4534
|
[i]
|
|
4527
|
-
), pe = M(() => dn(i), [i]), ce = M(() => Pa(i), [i]), [J, Ae] =
|
|
4535
|
+
), pe = M(() => dn(i), [i]), ce = M(() => Pa(i), [i]), [J, Ae] = $(p), [R, B] = $(!0), [Z, de] = $([]), le = na((v) => {
|
|
4528
4536
|
de(
|
|
4529
|
-
(
|
|
4537
|
+
(x) => x.length === v.length && x.every((L, K) => L === v[K]) ? x : [...v]
|
|
4530
4538
|
);
|
|
4531
4539
|
}, []), { containerRef: Ee, requestJump: De } = lt(), Ie = na(
|
|
4532
|
-
(
|
|
4533
|
-
var
|
|
4534
|
-
return (
|
|
4540
|
+
(v) => {
|
|
4541
|
+
var x, L;
|
|
4542
|
+
return (L = (x = C.intake) == null ? void 0 : x.answers[v]) == null ? void 0 : L.value;
|
|
4535
4543
|
},
|
|
4536
4544
|
[C.intake]
|
|
4537
4545
|
), xa = M(
|
|
4538
|
-
() =>
|
|
4546
|
+
() => as(ue, Ie, D.sex, a),
|
|
4539
4547
|
[ue, Ie, D.sex, a]
|
|
4540
4548
|
), la = M(
|
|
4541
4549
|
() => rt(pe, Ie, D.sex, a),
|
|
4542
4550
|
[pe, Ie, D.sex, a]
|
|
4543
|
-
), [O] =
|
|
4551
|
+
), [O] = $(() => new Set(la.map((v) => v.key))), H = (v) => {
|
|
4544
4552
|
if (c) {
|
|
4545
|
-
c(
|
|
4553
|
+
c(v);
|
|
4546
4554
|
return;
|
|
4547
4555
|
}
|
|
4548
|
-
Ae("compile"),
|
|
4556
|
+
Ae("compile"), B(!0), De(v.key);
|
|
4549
4557
|
};
|
|
4550
|
-
if (!
|
|
4558
|
+
if (!w)
|
|
4551
4559
|
return /* @__PURE__ */ t(Un, { embedded: n, children: /* @__PURE__ */ t(ve, { variant: "elevated", children: /* @__PURE__ */ t(ve.Body, { children: /* @__PURE__ */ t(
|
|
4552
4560
|
Be,
|
|
4553
4561
|
{
|
|
@@ -4557,42 +4565,42 @@ function Uo({
|
|
|
4557
4565
|
description: a("anamnesis.empty.noRecord.description")
|
|
4558
4566
|
}
|
|
4559
4567
|
) }) }) });
|
|
4560
|
-
const j = (
|
|
4561
|
-
k((
|
|
4562
|
-
if (
|
|
4563
|
-
const
|
|
4564
|
-
return
|
|
4568
|
+
const j = (v) => {
|
|
4569
|
+
k((x) => {
|
|
4570
|
+
if (x.visits.length === 0) return x;
|
|
4571
|
+
const L = x.visits.slice();
|
|
4572
|
+
return L[L.length - 1] = v(L[L.length - 1]), { ...x, visits: L };
|
|
4565
4573
|
});
|
|
4566
|
-
}, be = (
|
|
4574
|
+
}, be = (v, x) => j((L) => In(L, v, x)), Xe = (v, x, L) => k((K) => ({
|
|
4567
4575
|
...K,
|
|
4568
4576
|
visits: K.visits.map(
|
|
4569
|
-
(Je) => Je.id ===
|
|
4577
|
+
(Je) => Je.id === v.id ? In(Je, x, L) : Je
|
|
4570
4578
|
)
|
|
4571
|
-
})), Va = (
|
|
4572
|
-
k((
|
|
4573
|
-
}, Mt = (
|
|
4574
|
-
...
|
|
4575
|
-
therapy:
|
|
4576
|
-
})), qt = (
|
|
4577
|
-
...
|
|
4578
|
-
therapy:
|
|
4579
|
+
})), Va = (v, x) => {
|
|
4580
|
+
k((L) => tt(L, v.key, x)), s == null || s(v.key, x);
|
|
4581
|
+
}, Mt = (v) => j((x) => ({ ...x, pathologyCodes: v })), Sn = (v, x) => j((L) => ({
|
|
4582
|
+
...L,
|
|
4583
|
+
therapy: L.therapy.map((K) => K.id === v ? { ...K, ...x } : K)
|
|
4584
|
+
})), qt = (v) => j((x) => ({
|
|
4585
|
+
...x,
|
|
4586
|
+
therapy: x.therapy.filter((L) => L.id !== v)
|
|
4579
4587
|
})), Vt = () => {
|
|
4580
4588
|
S.current += 1;
|
|
4581
|
-
const
|
|
4582
|
-
j((
|
|
4583
|
-
...
|
|
4584
|
-
therapy: [...
|
|
4589
|
+
const v = `new-${S.current}`;
|
|
4590
|
+
j((x) => ({
|
|
4591
|
+
...x,
|
|
4592
|
+
therapy: [...x.therapy, { id: v, name: "", dose: "", kind: "medication" }]
|
|
4585
4593
|
}));
|
|
4586
4594
|
}, Bt = () => {
|
|
4587
4595
|
S.current += 1;
|
|
4588
|
-
const
|
|
4589
|
-
k((
|
|
4590
|
-
const
|
|
4591
|
-
if (!
|
|
4596
|
+
const v = `new-visit-${S.current}`;
|
|
4597
|
+
k((x) => {
|
|
4598
|
+
const L = x.visits[x.visits.length - 1];
|
|
4599
|
+
if (!L) return x;
|
|
4592
4600
|
const K = {
|
|
4593
|
-
id:
|
|
4601
|
+
id: v,
|
|
4594
4602
|
visitType: "followUp",
|
|
4595
|
-
dateIso: h ??
|
|
4603
|
+
dateIso: h ?? L.dateIso,
|
|
4596
4604
|
anthropometrics: {
|
|
4597
4605
|
weightKg: null,
|
|
4598
4606
|
heightCm: null,
|
|
@@ -4606,32 +4614,32 @@ function Uo({
|
|
|
4606
4614
|
therapy: [],
|
|
4607
4615
|
fmdCycles: []
|
|
4608
4616
|
};
|
|
4609
|
-
return { ...
|
|
4617
|
+
return { ...x, visits: [...x.visits, K] };
|
|
4610
4618
|
});
|
|
4611
|
-
}, Ut = (
|
|
4612
|
-
k((
|
|
4619
|
+
}, Ut = (v, x) => {
|
|
4620
|
+
k((L) => {
|
|
4613
4621
|
var K;
|
|
4614
4622
|
return {
|
|
4615
|
-
...
|
|
4623
|
+
...L,
|
|
4616
4624
|
intake: {
|
|
4617
|
-
...
|
|
4625
|
+
...L.intake,
|
|
4618
4626
|
answers: {
|
|
4619
|
-
...(K =
|
|
4620
|
-
[
|
|
4627
|
+
...(K = L.intake) == null ? void 0 : K.answers,
|
|
4628
|
+
[v]: { value: x, origin: "clinician" }
|
|
4621
4629
|
}
|
|
4622
4630
|
}
|
|
4623
4631
|
};
|
|
4624
4632
|
});
|
|
4625
4633
|
}, Kt = $i(i).map(
|
|
4626
|
-
(
|
|
4627
|
-
const
|
|
4634
|
+
(v) => {
|
|
4635
|
+
const x = ce[v], L = x == null ? void 0 : x.parentCode;
|
|
4628
4636
|
return {
|
|
4629
|
-
value:
|
|
4630
|
-
label: Se(
|
|
4631
|
-
group:
|
|
4637
|
+
value: v,
|
|
4638
|
+
label: Se(v, a, x),
|
|
4639
|
+
group: L ? hn(L, a, ce[L]) : a("anamnesis.pathology.groupGeneral")
|
|
4632
4640
|
};
|
|
4633
4641
|
}
|
|
4634
|
-
), ka =
|
|
4642
|
+
), ka = w.oncological ?? {}, wa = w.annualProgramme ?? {
|
|
4635
4643
|
proposed: !1,
|
|
4636
4644
|
accepted: !1
|
|
4637
4645
|
}, Ht = /* @__PURE__ */ d(Le, { children: [
|
|
@@ -4645,7 +4653,7 @@ function Uo({
|
|
|
4645
4653
|
/* @__PURE__ */ d("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: [
|
|
4646
4654
|
$a(C, a),
|
|
4647
4655
|
" · ",
|
|
4648
|
-
a("anamnesis.compile.visitCount", { visits:
|
|
4656
|
+
a("anamnesis.compile.visitCount", { visits: A.length })
|
|
4649
4657
|
] })
|
|
4650
4658
|
] }),
|
|
4651
4659
|
r ? /* @__PURE__ */ t(
|
|
@@ -4660,8 +4668,8 @@ function Uo({
|
|
|
4660
4668
|
o ? null : /* @__PURE__ */ t(
|
|
4661
4669
|
Pt,
|
|
4662
4670
|
{
|
|
4663
|
-
|
|
4664
|
-
defs:
|
|
4671
|
+
visits: A,
|
|
4672
|
+
defs: U,
|
|
4665
4673
|
targets: T,
|
|
4666
4674
|
t: a,
|
|
4667
4675
|
onTargetChange: Va
|
|
@@ -4671,7 +4679,7 @@ function Uo({
|
|
|
4671
4679
|
W,
|
|
4672
4680
|
{
|
|
4673
4681
|
value: J,
|
|
4674
|
-
onValueChange: (
|
|
4682
|
+
onValueChange: (v) => Ae(v),
|
|
4675
4683
|
children: [
|
|
4676
4684
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
4677
4685
|
/* @__PURE__ */ d(W.List, { "aria-label": a("anamnesis.compile.viewsLabel"), children: [
|
|
@@ -4680,21 +4688,21 @@ function Uo({
|
|
|
4680
4688
|
/* @__PURE__ */ t(W.Trigger, { value: "evolution", children: a("anamnesis.compile.tabEvolution") })
|
|
4681
4689
|
] }),
|
|
4682
4690
|
/* @__PURE__ */ t(
|
|
4683
|
-
|
|
4691
|
+
So,
|
|
4684
4692
|
{
|
|
4685
4693
|
tab: J,
|
|
4686
4694
|
record: C,
|
|
4687
4695
|
t: a,
|
|
4688
4696
|
config: i,
|
|
4689
4697
|
shownVisitIds: Z,
|
|
4690
|
-
defaultOpen:
|
|
4698
|
+
defaultOpen: b,
|
|
4691
4699
|
defaultShareOpen: N,
|
|
4692
4700
|
defaultAudience: f
|
|
4693
4701
|
}
|
|
4694
4702
|
)
|
|
4695
4703
|
] }),
|
|
4696
4704
|
/* @__PURE__ */ t(W.Content, { value: "summary", children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(
|
|
4697
|
-
|
|
4705
|
+
cs,
|
|
4698
4706
|
{
|
|
4699
4707
|
intake: C.intake,
|
|
4700
4708
|
sections: ue,
|
|
@@ -4721,10 +4729,10 @@ function Uo({
|
|
|
4721
4729
|
label: a("anamnesis.visitType.followUp")
|
|
4722
4730
|
}
|
|
4723
4731
|
],
|
|
4724
|
-
value:
|
|
4725
|
-
onValueChange: (
|
|
4726
|
-
...
|
|
4727
|
-
visitType:
|
|
4732
|
+
value: w.visitType,
|
|
4733
|
+
onValueChange: (v) => j((x) => ({
|
|
4734
|
+
...x,
|
|
4735
|
+
visitType: v || "followUp"
|
|
4728
4736
|
}))
|
|
4729
4737
|
}
|
|
4730
4738
|
) }),
|
|
@@ -4732,29 +4740,29 @@ function Uo({
|
|
|
4732
4740
|
Me,
|
|
4733
4741
|
{
|
|
4734
4742
|
options: g,
|
|
4735
|
-
value:
|
|
4736
|
-
onValueChange: (
|
|
4737
|
-
...
|
|
4738
|
-
practitioner:
|
|
4743
|
+
value: w.practitioner ?? "",
|
|
4744
|
+
onValueChange: (v) => j((x) => ({
|
|
4745
|
+
...x,
|
|
4746
|
+
practitioner: v || void 0
|
|
4739
4747
|
}))
|
|
4740
4748
|
}
|
|
4741
4749
|
) : /* @__PURE__ */ t(
|
|
4742
4750
|
ae,
|
|
4743
4751
|
{
|
|
4744
|
-
value:
|
|
4745
|
-
onChange: (
|
|
4746
|
-
...
|
|
4747
|
-
practitioner:
|
|
4752
|
+
value: w.practitioner ?? "",
|
|
4753
|
+
onChange: (v) => j((x) => ({
|
|
4754
|
+
...x,
|
|
4755
|
+
practitioner: v.target.value
|
|
4748
4756
|
}))
|
|
4749
4757
|
}
|
|
4750
4758
|
) }),
|
|
4751
4759
|
/* @__PURE__ */ t(q, { label: a("anamnesis.header.visitDate"), children: /* @__PURE__ */ t(
|
|
4752
4760
|
Yt,
|
|
4753
4761
|
{
|
|
4754
|
-
value:
|
|
4755
|
-
onChange: (
|
|
4756
|
-
...
|
|
4757
|
-
dateIso:
|
|
4762
|
+
value: Gi(w.dateIso),
|
|
4763
|
+
onChange: (v) => v && j((x) => ({
|
|
4764
|
+
...x,
|
|
4765
|
+
dateIso: Wi(v)
|
|
4758
4766
|
}))
|
|
4759
4767
|
}
|
|
4760
4768
|
) })
|
|
@@ -4776,8 +4784,8 @@ function Uo({
|
|
|
4776
4784
|
{
|
|
4777
4785
|
titleKey: "anamnesis.section.intakeGaps",
|
|
4778
4786
|
t: a,
|
|
4779
|
-
open:
|
|
4780
|
-
onOpenChange:
|
|
4787
|
+
open: R,
|
|
4788
|
+
onOpenChange: B,
|
|
4781
4789
|
fill: la.length,
|
|
4782
4790
|
fillKind: "outstanding",
|
|
4783
4791
|
children: [
|
|
@@ -4787,33 +4795,33 @@ function Uo({
|
|
|
4787
4795
|
{
|
|
4788
4796
|
ref: Ee,
|
|
4789
4797
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]",
|
|
4790
|
-
children: pe.map((
|
|
4791
|
-
const
|
|
4792
|
-
return
|
|
4798
|
+
children: pe.map((v) => {
|
|
4799
|
+
const x = v.fields.filter((L) => ra(L, D.sex)).filter((L) => O.has(L.key));
|
|
4800
|
+
return x.length === 0 ? null : /* @__PURE__ */ d(
|
|
4793
4801
|
"div",
|
|
4794
4802
|
{
|
|
4795
4803
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
4796
4804
|
children: [
|
|
4797
|
-
/* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: ye(
|
|
4798
|
-
|
|
4805
|
+
/* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: ye(v, a) }),
|
|
4806
|
+
x.map((L) => {
|
|
4799
4807
|
var Je;
|
|
4800
|
-
const K = (Je = C.intake) == null ? void 0 : Je.answers[
|
|
4808
|
+
const K = (Je = C.intake) == null ? void 0 : Je.answers[L.key];
|
|
4801
4809
|
return /* @__PURE__ */ t(
|
|
4802
4810
|
Rt,
|
|
4803
4811
|
{
|
|
4804
|
-
def:
|
|
4812
|
+
def: L,
|
|
4805
4813
|
answer: K == null ? void 0 : K.value,
|
|
4806
4814
|
origin: K == null ? void 0 : K.origin,
|
|
4807
4815
|
showOrigin: !0,
|
|
4808
|
-
onChange: (jt) => Ut(
|
|
4816
|
+
onChange: (jt) => Ut(L.key, jt),
|
|
4809
4817
|
t: a
|
|
4810
4818
|
},
|
|
4811
|
-
|
|
4819
|
+
L.key
|
|
4812
4820
|
);
|
|
4813
4821
|
})
|
|
4814
4822
|
]
|
|
4815
4823
|
},
|
|
4816
|
-
|
|
4824
|
+
v.key
|
|
4817
4825
|
);
|
|
4818
4826
|
})
|
|
4819
4827
|
}
|
|
@@ -4826,9 +4834,9 @@ function Uo({
|
|
|
4826
4834
|
/* @__PURE__ */ t(
|
|
4827
4835
|
ja,
|
|
4828
4836
|
{
|
|
4829
|
-
stripKeys:
|
|
4830
|
-
defs:
|
|
4831
|
-
visit:
|
|
4837
|
+
stripKeys: I,
|
|
4838
|
+
defs: y,
|
|
4839
|
+
visit: w,
|
|
4832
4840
|
previous: u,
|
|
4833
4841
|
targets: T,
|
|
4834
4842
|
t: a,
|
|
@@ -4837,12 +4845,12 @@ function Uo({
|
|
|
4837
4845
|
}
|
|
4838
4846
|
)
|
|
4839
4847
|
] }),
|
|
4840
|
-
|
|
4848
|
+
F.length > 0 ? /* @__PURE__ */ t(ge, { titleKey: "anamnesis.section.dietary", t: a, children: /* @__PURE__ */ t(
|
|
4841
4849
|
ja,
|
|
4842
4850
|
{
|
|
4843
|
-
stripKeys:
|
|
4844
|
-
defs:
|
|
4845
|
-
visit:
|
|
4851
|
+
stripKeys: I,
|
|
4852
|
+
defs: F,
|
|
4853
|
+
visit: w,
|
|
4846
4854
|
previous: u,
|
|
4847
4855
|
targets: T,
|
|
4848
4856
|
t: a,
|
|
@@ -4859,7 +4867,7 @@ function Uo({
|
|
|
4859
4867
|
rn,
|
|
4860
4868
|
{
|
|
4861
4869
|
options: Kt,
|
|
4862
|
-
value:
|
|
4870
|
+
value: w.pathologyCodes,
|
|
4863
4871
|
allowClear: !0,
|
|
4864
4872
|
placeholder: a(
|
|
4865
4873
|
"anamnesis.compile.pathologiesPlaceholder"
|
|
@@ -4874,7 +4882,7 @@ function Uo({
|
|
|
4874
4882
|
{
|
|
4875
4883
|
titleKey: "anamnesis.section.oncological",
|
|
4876
4884
|
t: a,
|
|
4877
|
-
open:
|
|
4885
|
+
open: V.oncological,
|
|
4878
4886
|
onOpenChange: ne("oncological"),
|
|
4879
4887
|
fill: P.oncological.fill,
|
|
4880
4888
|
children: /* @__PURE__ */ d("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
@@ -4882,11 +4890,11 @@ function Uo({
|
|
|
4882
4890
|
ae,
|
|
4883
4891
|
{
|
|
4884
4892
|
value: ka.tumourType ?? "",
|
|
4885
|
-
onChange: (
|
|
4886
|
-
...
|
|
4893
|
+
onChange: (v) => j((x) => ({
|
|
4894
|
+
...x,
|
|
4887
4895
|
oncological: {
|
|
4888
|
-
...
|
|
4889
|
-
tumourType:
|
|
4896
|
+
...x.oncological,
|
|
4897
|
+
tumourType: v.target.value
|
|
4890
4898
|
}
|
|
4891
4899
|
}))
|
|
4892
4900
|
}
|
|
@@ -4895,11 +4903,11 @@ function Uo({
|
|
|
4895
4903
|
ae,
|
|
4896
4904
|
{
|
|
4897
4905
|
value: ka.stage ?? "",
|
|
4898
|
-
onChange: (
|
|
4899
|
-
...
|
|
4906
|
+
onChange: (v) => j((x) => ({
|
|
4907
|
+
...x,
|
|
4900
4908
|
oncological: {
|
|
4901
|
-
...
|
|
4902
|
-
stage:
|
|
4909
|
+
...x.oncological,
|
|
4910
|
+
stage: v.target.value
|
|
4903
4911
|
}
|
|
4904
4912
|
}))
|
|
4905
4913
|
}
|
|
@@ -4910,15 +4918,15 @@ function Uo({
|
|
|
4910
4918
|
label: a("anamnesis.field.metastases.label"),
|
|
4911
4919
|
variant: "horizontal",
|
|
4912
4920
|
value: ((An = ka.metastases) == null ? void 0 : An.present) ?? "unknown",
|
|
4913
|
-
onValueChange: (
|
|
4914
|
-
var
|
|
4921
|
+
onValueChange: (v) => j((x) => {
|
|
4922
|
+
var L, K;
|
|
4915
4923
|
return {
|
|
4916
|
-
...
|
|
4924
|
+
...x,
|
|
4917
4925
|
oncological: {
|
|
4918
|
-
...
|
|
4926
|
+
...x.oncological,
|
|
4919
4927
|
metastases: {
|
|
4920
|
-
present:
|
|
4921
|
-
site: (K = (
|
|
4928
|
+
present: v,
|
|
4929
|
+
site: (K = (L = x.oncological) == null ? void 0 : L.metastases) == null ? void 0 : K.site
|
|
4922
4930
|
}
|
|
4923
4931
|
}
|
|
4924
4932
|
};
|
|
@@ -4944,11 +4952,11 @@ function Uo({
|
|
|
4944
4952
|
ae,
|
|
4945
4953
|
{
|
|
4946
4954
|
value: ka.treatmentStatus ?? "",
|
|
4947
|
-
onChange: (
|
|
4948
|
-
...
|
|
4955
|
+
onChange: (v) => j((x) => ({
|
|
4956
|
+
...x,
|
|
4949
4957
|
oncological: {
|
|
4950
|
-
...
|
|
4951
|
-
treatmentStatus:
|
|
4958
|
+
...x.oncological,
|
|
4959
|
+
treatmentStatus: v.target.value
|
|
4952
4960
|
}
|
|
4953
4961
|
}))
|
|
4954
4962
|
}
|
|
@@ -4959,7 +4967,7 @@ function Uo({
|
|
|
4959
4967
|
}
|
|
4960
4968
|
),
|
|
4961
4969
|
/* @__PURE__ */ t(ge, { titleKey: "anamnesis.section.therapy", t: a, children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
4962
|
-
|
|
4970
|
+
w.therapy.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noTherapy") }) : w.therapy.map((v) => /* @__PURE__ */ d(
|
|
4963
4971
|
"div",
|
|
4964
4972
|
{
|
|
4965
4973
|
className: "ds:flex ds:flex-wrap ds:items-end ds:gap-[var(--spacing-sm)]",
|
|
@@ -4971,9 +4979,9 @@ function Uo({
|
|
|
4971
4979
|
children: /* @__PURE__ */ t(
|
|
4972
4980
|
ae,
|
|
4973
4981
|
{
|
|
4974
|
-
value:
|
|
4975
|
-
onChange: (
|
|
4976
|
-
name:
|
|
4982
|
+
value: v.name,
|
|
4983
|
+
onChange: (x) => Sn(v.id, {
|
|
4984
|
+
name: x.target.value
|
|
4977
4985
|
})
|
|
4978
4986
|
}
|
|
4979
4987
|
)
|
|
@@ -4982,18 +4990,18 @@ function Uo({
|
|
|
4982
4990
|
/* @__PURE__ */ t(q, { label: a("anamnesis.field.medDose.label"), children: /* @__PURE__ */ t(
|
|
4983
4991
|
ae,
|
|
4984
4992
|
{
|
|
4985
|
-
value:
|
|
4986
|
-
onChange: (
|
|
4987
|
-
dose:
|
|
4993
|
+
value: v.dose ?? "",
|
|
4994
|
+
onChange: (x) => Sn(v.id, {
|
|
4995
|
+
dose: x.target.value
|
|
4988
4996
|
})
|
|
4989
4997
|
}
|
|
4990
4998
|
) }),
|
|
4991
4999
|
/* @__PURE__ */ t(
|
|
4992
5000
|
Q,
|
|
4993
5001
|
{
|
|
4994
|
-
variant:
|
|
5002
|
+
variant: v.kind === "medication" ? "info" : "neutral",
|
|
4995
5003
|
size: "md",
|
|
4996
|
-
children: a(`anamnesis.medKind.${
|
|
5004
|
+
children: a(`anamnesis.medKind.${v.kind}`)
|
|
4997
5005
|
}
|
|
4998
5006
|
),
|
|
4999
5007
|
/* @__PURE__ */ t(
|
|
@@ -5002,14 +5010,14 @@ function Uo({
|
|
|
5002
5010
|
icon: /* @__PURE__ */ t(pi, { "aria-hidden": "true" }),
|
|
5003
5011
|
intent: "ghost",
|
|
5004
5012
|
"aria-label": a("anamnesis.compile.removeTherapy", {
|
|
5005
|
-
name:
|
|
5013
|
+
name: v.name
|
|
5006
5014
|
}),
|
|
5007
|
-
onClick: () => qt(
|
|
5015
|
+
onClick: () => qt(v.id)
|
|
5008
5016
|
}
|
|
5009
5017
|
)
|
|
5010
5018
|
]
|
|
5011
5019
|
},
|
|
5012
|
-
|
|
5020
|
+
v.id
|
|
5013
5021
|
)),
|
|
5014
5022
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
5015
5023
|
X,
|
|
@@ -5027,16 +5035,16 @@ function Uo({
|
|
|
5027
5035
|
{
|
|
5028
5036
|
titleKey: "anamnesis.section.labs",
|
|
5029
5037
|
t: a,
|
|
5030
|
-
open:
|
|
5038
|
+
open: V.labs,
|
|
5031
5039
|
onOpenChange: ne("labs"),
|
|
5032
5040
|
fill: P.labs.fill,
|
|
5033
5041
|
flagged: P.labs.flagged,
|
|
5034
5042
|
children: /* @__PURE__ */ t(
|
|
5035
5043
|
ja,
|
|
5036
5044
|
{
|
|
5037
|
-
stripKeys:
|
|
5038
|
-
defs:
|
|
5039
|
-
visit:
|
|
5045
|
+
stripKeys: I,
|
|
5046
|
+
defs: z,
|
|
5047
|
+
visit: w,
|
|
5040
5048
|
previous: u,
|
|
5041
5049
|
targets: T,
|
|
5042
5050
|
t: a,
|
|
@@ -5050,21 +5058,21 @@ function Uo({
|
|
|
5050
5058
|
{
|
|
5051
5059
|
titleKey: "anamnesis.section.fmd",
|
|
5052
5060
|
t: a,
|
|
5053
|
-
open:
|
|
5061
|
+
open: V.fmd,
|
|
5054
5062
|
onOpenChange: ne("fmd"),
|
|
5055
5063
|
fill: P.fmd.fill,
|
|
5056
|
-
children:
|
|
5064
|
+
children: w.fmdCycles.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noFmd") }) : /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: w.fmdCycles.map((v) => /* @__PURE__ */ d(
|
|
5057
5065
|
"li",
|
|
5058
5066
|
{
|
|
5059
5067
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
5060
5068
|
children: [
|
|
5061
5069
|
/* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: a("anamnesis.compile.cycleNumber", {
|
|
5062
|
-
number:
|
|
5070
|
+
number: v.cycleNumber
|
|
5063
5071
|
}) }),
|
|
5064
5072
|
/* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: /* @__PURE__ */ t(
|
|
5065
5073
|
sa,
|
|
5066
5074
|
{
|
|
5067
|
-
value:
|
|
5075
|
+
value: v.startDateIso,
|
|
5068
5076
|
format: "absolute",
|
|
5069
5077
|
shape: "bare",
|
|
5070
5078
|
absoluteFormat: Ye
|
|
@@ -5073,15 +5081,15 @@ function Uo({
|
|
|
5073
5081
|
/* @__PURE__ */ t(
|
|
5074
5082
|
Q,
|
|
5075
5083
|
{
|
|
5076
|
-
variant:
|
|
5084
|
+
variant: v.completed ? "success" : "warning",
|
|
5077
5085
|
size: "sm",
|
|
5078
5086
|
withDot: !0,
|
|
5079
|
-
children:
|
|
5087
|
+
children: v.completed ? a("anamnesis.compile.cycleCompleted") : a("anamnesis.compile.cycleInProgress")
|
|
5080
5088
|
}
|
|
5081
5089
|
)
|
|
5082
5090
|
]
|
|
5083
5091
|
},
|
|
5084
|
-
|
|
5092
|
+
v.cycleNumber
|
|
5085
5093
|
)) })
|
|
5086
5094
|
}
|
|
5087
5095
|
),
|
|
@@ -5093,12 +5101,12 @@ function Uo({
|
|
|
5093
5101
|
children: /* @__PURE__ */ t(
|
|
5094
5102
|
ta,
|
|
5095
5103
|
{
|
|
5096
|
-
value:
|
|
5104
|
+
value: w.nutritionalProposal ?? "",
|
|
5097
5105
|
autoResize: !0,
|
|
5098
5106
|
minRows: 2,
|
|
5099
|
-
onChange: (
|
|
5100
|
-
...
|
|
5101
|
-
nutritionalProposal:
|
|
5107
|
+
onChange: (v) => j((x) => ({
|
|
5108
|
+
...x,
|
|
5109
|
+
nutritionalProposal: v.target.value
|
|
5102
5110
|
}))
|
|
5103
5111
|
}
|
|
5104
5112
|
)
|
|
@@ -5107,12 +5115,12 @@ function Uo({
|
|
|
5107
5115
|
/* @__PURE__ */ t(q, { label: a("anamnesis.field.clinicalNotes.label"), children: /* @__PURE__ */ t(
|
|
5108
5116
|
ta,
|
|
5109
5117
|
{
|
|
5110
|
-
value:
|
|
5118
|
+
value: w.clinicalNotes ?? "",
|
|
5111
5119
|
autoResize: !0,
|
|
5112
5120
|
minRows: 2,
|
|
5113
|
-
onChange: (
|
|
5114
|
-
...
|
|
5115
|
-
clinicalNotes:
|
|
5121
|
+
onChange: (v) => j((x) => ({
|
|
5122
|
+
...x,
|
|
5123
|
+
clinicalNotes: v.target.value
|
|
5116
5124
|
}))
|
|
5117
5125
|
}
|
|
5118
5126
|
) })
|
|
@@ -5122,7 +5130,7 @@ function Uo({
|
|
|
5122
5130
|
{
|
|
5123
5131
|
titleKey: "anamnesis.section.annual",
|
|
5124
5132
|
t: a,
|
|
5125
|
-
open:
|
|
5133
|
+
open: V.annual,
|
|
5126
5134
|
onOpenChange: ne("annual"),
|
|
5127
5135
|
fill: P.annual.fill,
|
|
5128
5136
|
children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
@@ -5132,14 +5140,14 @@ function Uo({
|
|
|
5132
5140
|
label: a("anamnesis.field.annualProposed.label"),
|
|
5133
5141
|
variant: "horizontal",
|
|
5134
5142
|
value: wa.proposed ? "yes" : "no",
|
|
5135
|
-
onValueChange: (
|
|
5136
|
-
var
|
|
5143
|
+
onValueChange: (v) => j((x) => {
|
|
5144
|
+
var L, K;
|
|
5137
5145
|
return {
|
|
5138
|
-
...
|
|
5146
|
+
...x,
|
|
5139
5147
|
annualProgramme: {
|
|
5140
|
-
proposed:
|
|
5141
|
-
accepted: ((
|
|
5142
|
-
declineReason: (K =
|
|
5148
|
+
proposed: v === "yes",
|
|
5149
|
+
accepted: ((L = x.annualProgramme) == null ? void 0 : L.accepted) ?? !1,
|
|
5150
|
+
declineReason: (K = x.annualProgramme) == null ? void 0 : K.declineReason
|
|
5143
5151
|
}
|
|
5144
5152
|
};
|
|
5145
5153
|
}),
|
|
@@ -5155,14 +5163,14 @@ function Uo({
|
|
|
5155
5163
|
label: a("anamnesis.field.annualAccepted.label"),
|
|
5156
5164
|
variant: "horizontal",
|
|
5157
5165
|
value: wa.accepted ? "yes" : "no",
|
|
5158
|
-
onValueChange: (
|
|
5159
|
-
var
|
|
5166
|
+
onValueChange: (v) => j((x) => {
|
|
5167
|
+
var L, K;
|
|
5160
5168
|
return {
|
|
5161
|
-
...
|
|
5169
|
+
...x,
|
|
5162
5170
|
annualProgramme: {
|
|
5163
|
-
proposed: ((
|
|
5164
|
-
accepted:
|
|
5165
|
-
declineReason: (K =
|
|
5171
|
+
proposed: ((L = x.annualProgramme) == null ? void 0 : L.proposed) ?? !1,
|
|
5172
|
+
accepted: v === "yes",
|
|
5173
|
+
declineReason: (K = x.annualProgramme) == null ? void 0 : K.declineReason
|
|
5166
5174
|
}
|
|
5167
5175
|
};
|
|
5168
5176
|
}),
|
|
@@ -5182,14 +5190,14 @@ function Uo({
|
|
|
5182
5190
|
value: wa.declineReason ?? "",
|
|
5183
5191
|
autoResize: !0,
|
|
5184
5192
|
minRows: 2,
|
|
5185
|
-
onChange: (
|
|
5186
|
-
var
|
|
5193
|
+
onChange: (v) => j((x) => {
|
|
5194
|
+
var L, K;
|
|
5187
5195
|
return {
|
|
5188
|
-
...
|
|
5196
|
+
...x,
|
|
5189
5197
|
annualProgramme: {
|
|
5190
|
-
proposed: ((
|
|
5191
|
-
accepted: ((K =
|
|
5192
|
-
declineReason:
|
|
5198
|
+
proposed: ((L = x.annualProgramme) == null ? void 0 : L.proposed) ?? !1,
|
|
5199
|
+
accepted: ((K = x.annualProgramme) == null ? void 0 : K.accepted) ?? !1,
|
|
5200
|
+
declineReason: v.target.value
|
|
5193
5201
|
}
|
|
5194
5202
|
};
|
|
5195
5203
|
})
|
|
@@ -5243,27 +5251,27 @@ function _t({
|
|
|
5243
5251
|
jumpToField: r,
|
|
5244
5252
|
readOnly: l = !1
|
|
5245
5253
|
}) {
|
|
5246
|
-
const { patient: c } = e, m = _a(e), [g, h] =
|
|
5247
|
-
e !== p && (
|
|
5248
|
-
const [N, f] =
|
|
5254
|
+
const { patient: c } = e, m = _a(e), [g, h] = $(() => Kn(e)), [p, b] = $(e);
|
|
5255
|
+
e !== p && (b(e), h(Kn(e)));
|
|
5256
|
+
const [N, f] = $(
|
|
5249
5257
|
() => {
|
|
5250
5258
|
var P;
|
|
5251
5259
|
return ((P = e.intake) == null ? void 0 : P.submittedAtIso) != null;
|
|
5252
5260
|
}
|
|
5253
|
-
), C = (P,
|
|
5254
|
-
h((G) => ({ ...G, [P]:
|
|
5261
|
+
), C = (P, V) => {
|
|
5262
|
+
h((G) => ({ ...G, [P]: V }));
|
|
5255
5263
|
}, k = M(
|
|
5256
5264
|
() => dn(i).map((P) => ({
|
|
5257
5265
|
...P,
|
|
5258
|
-
fields: P.fields.filter((
|
|
5266
|
+
fields: P.fields.filter((V) => ra(V, c.sex))
|
|
5259
5267
|
})).filter((P) => P.fields.length > 0),
|
|
5260
5268
|
[i, c.sex]
|
|
5261
|
-
), [
|
|
5269
|
+
), [E, S] = $(
|
|
5262
5270
|
() => {
|
|
5263
5271
|
var P;
|
|
5264
5272
|
return s ?? ((P = k[0]) == null ? void 0 : P.key) ?? "";
|
|
5265
5273
|
}
|
|
5266
|
-
), { containerRef: D, requestJump:
|
|
5274
|
+
), { containerRef: D, requestJump: A } = lt(), w = M(
|
|
5267
5275
|
() => rt(
|
|
5268
5276
|
k,
|
|
5269
5277
|
(P) => g[P],
|
|
@@ -5272,25 +5280,25 @@ function _t({
|
|
|
5272
5280
|
),
|
|
5273
5281
|
[k, g, c.sex, a]
|
|
5274
5282
|
), u = (P) => {
|
|
5275
|
-
S(P.sectionKey),
|
|
5283
|
+
S(P.sectionKey), A(P.key);
|
|
5276
5284
|
};
|
|
5277
5285
|
ia(() => {
|
|
5278
5286
|
if (!r) return;
|
|
5279
5287
|
const P = k.find(
|
|
5280
|
-
(
|
|
5288
|
+
(V) => V.fields.some((G) => G.key === r)
|
|
5281
5289
|
);
|
|
5282
|
-
P && (S(P.key),
|
|
5290
|
+
P && (S(P.key), A(r));
|
|
5283
5291
|
}, [r]);
|
|
5284
|
-
const { answeredCount: T, totalCount:
|
|
5285
|
-
let P = 0,
|
|
5292
|
+
const { answeredCount: T, totalCount: y } = M(() => {
|
|
5293
|
+
let P = 0, V = 0;
|
|
5286
5294
|
for (const G of k)
|
|
5287
5295
|
for (const ne of G.fields)
|
|
5288
|
-
|
|
5289
|
-
return { answeredCount: P, totalCount:
|
|
5290
|
-
}, [k, g]),
|
|
5296
|
+
V += 1, ga(g[ne.key]) && (P += 1);
|
|
5297
|
+
return { answeredCount: P, totalCount: V };
|
|
5298
|
+
}, [k, g]), F = y === 0 ? 0 : Math.round(T / y * 100), z = a("anamnesis.intake.answered", {
|
|
5291
5299
|
answered: T,
|
|
5292
|
-
total:
|
|
5293
|
-
}),
|
|
5300
|
+
total: y
|
|
5301
|
+
}), U = w.length > 0 && (T > 0 || N), I = /* @__PURE__ */ d(Le, { children: [
|
|
5294
5302
|
n ? null : /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
5295
5303
|
/* @__PURE__ */ t("h1", { className: "type-title-page ds:m-0 ds:text-[color:var(--foreground)]", children: a("anamnesis.intake.title") }),
|
|
5296
5304
|
/* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.intake.subtitle") })
|
|
@@ -5334,20 +5342,20 @@ function _t({
|
|
|
5334
5342
|
] }) : null
|
|
5335
5343
|
] }),
|
|
5336
5344
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
5337
|
-
/* @__PURE__ */ t(vi, { value:
|
|
5345
|
+
/* @__PURE__ */ t(vi, { value: F, ariaLabel: z }),
|
|
5338
5346
|
/* @__PURE__ */ t(
|
|
5339
5347
|
"p",
|
|
5340
5348
|
{
|
|
5341
5349
|
className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]",
|
|
5342
5350
|
"aria-live": "polite",
|
|
5343
|
-
children:
|
|
5351
|
+
children: z
|
|
5344
5352
|
}
|
|
5345
5353
|
)
|
|
5346
5354
|
] }),
|
|
5347
|
-
|
|
5355
|
+
U ? /* @__PURE__ */ t(
|
|
5348
5356
|
ct,
|
|
5349
5357
|
{
|
|
5350
|
-
missing:
|
|
5358
|
+
missing: w,
|
|
5351
5359
|
t: a,
|
|
5352
5360
|
onJump: u,
|
|
5353
5361
|
announce: "off"
|
|
@@ -5374,17 +5382,17 @@ function _t({
|
|
|
5374
5382
|
type: "single",
|
|
5375
5383
|
collapsible: !0,
|
|
5376
5384
|
variant: "default",
|
|
5377
|
-
value:
|
|
5385
|
+
value: E,
|
|
5378
5386
|
onValueChange: S,
|
|
5379
5387
|
children: k.map((P) => {
|
|
5380
|
-
const
|
|
5388
|
+
const V = P.fields.filter(
|
|
5381
5389
|
(G) => ga(g[G.key])
|
|
5382
5390
|
).length;
|
|
5383
5391
|
return /* @__PURE__ */ d(gi, { value: P.key, children: [
|
|
5384
5392
|
/* @__PURE__ */ t(fi, { children: /* @__PURE__ */ d("span", { className: "ds:flex ds:w-full ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
5385
5393
|
/* @__PURE__ */ t("span", { children: ye(P, a) }),
|
|
5386
5394
|
/* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.intake.sectionProgress", {
|
|
5387
|
-
answered:
|
|
5395
|
+
answered: V,
|
|
5388
5396
|
total: P.fields.length
|
|
5389
5397
|
}) })
|
|
5390
5398
|
] }) }),
|
|
@@ -5429,7 +5437,7 @@ function _t({
|
|
|
5429
5437
|
) })
|
|
5430
5438
|
] })
|
|
5431
5439
|
] });
|
|
5432
|
-
return n ? /* @__PURE__ */ t("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children:
|
|
5440
|
+
return n ? /* @__PURE__ */ t("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children: I }) : /* @__PURE__ */ t("div", { className: "ds:min-h-[100dvh] ds:w-full ds:bg-[color:var(--app-shell-background)] ds:py-[var(--spacing-xl)]", children: /* @__PURE__ */ t("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[48rem] ds:flex-col ds:gap-[var(--spacing-lg)] ds:px-[var(--spacing-md)]", children: I }) });
|
|
5433
5441
|
}
|
|
5434
5442
|
function xe({
|
|
5435
5443
|
titleKey: e,
|
|
@@ -5467,7 +5475,7 @@ function Ga({
|
|
|
5467
5475
|
] }, o.key);
|
|
5468
5476
|
}) });
|
|
5469
5477
|
}
|
|
5470
|
-
function
|
|
5478
|
+
function Ho({
|
|
5471
5479
|
record: e,
|
|
5472
5480
|
t: a,
|
|
5473
5481
|
embedded: n = !1,
|
|
@@ -5475,8 +5483,8 @@ function Ko({
|
|
|
5475
5483
|
onOpenNote: s
|
|
5476
5484
|
}) {
|
|
5477
5485
|
const { patient: o, visits: r } = e, l = r[r.length - 1], c = r.length > 1 ? r[r.length - 2] : void 0, m = new Map(
|
|
5478
|
-
e.targets.map((
|
|
5479
|
-
), g = Re(i, "anthropometric"), h = Re(i, "dietary"), p = Re(i, "lab"),
|
|
5486
|
+
e.targets.map((E) => [E.parameterKey, E.target])
|
|
5487
|
+
), g = Re(i, "anthropometric"), h = Re(i, "dietary"), p = Re(i, "lab"), b = He(i), N = Pa(i);
|
|
5480
5488
|
if (!l)
|
|
5481
5489
|
return /* @__PURE__ */ t(Hn, { embedded: n, children: /* @__PURE__ */ t(ve, { variant: "elevated", children: /* @__PURE__ */ t(ve.Body, { children: /* @__PURE__ */ t(
|
|
5482
5490
|
Be,
|
|
@@ -5555,7 +5563,7 @@ function Ko({
|
|
|
5555
5563
|
t: a
|
|
5556
5564
|
}
|
|
5557
5565
|
) }) : null,
|
|
5558
|
-
/* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.pathologies", t: a, children: l.pathologyCodes.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: l.pathologyCodes.map((
|
|
5566
|
+
/* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.pathologies", t: a, children: l.pathologyCodes.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: l.pathologyCodes.map((E) => /* @__PURE__ */ t(Q, { variant: "neutral", size: "md", children: Se(E, a, N[E]) }, E)) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
|
|
5559
5567
|
f ? /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.oncological", t: a, children: /* @__PURE__ */ d(
|
|
5560
5568
|
_,
|
|
5561
5569
|
{
|
|
@@ -5578,24 +5586,24 @@ function Ko({
|
|
|
5578
5586
|
]
|
|
5579
5587
|
}
|
|
5580
5588
|
) }) : null,
|
|
5581
|
-
/* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.therapy", t: a, children: l.therapy.length > 0 ? /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: l.therapy.map((
|
|
5589
|
+
/* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.therapy", t: a, children: l.therapy.length > 0 ? /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: l.therapy.map((E) => /* @__PURE__ */ d(
|
|
5582
5590
|
"li",
|
|
5583
5591
|
{
|
|
5584
5592
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
5585
5593
|
children: [
|
|
5586
|
-
/* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children:
|
|
5587
|
-
|
|
5594
|
+
/* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: E.name }),
|
|
5595
|
+
E.dose ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: E.dose }) : null,
|
|
5588
5596
|
/* @__PURE__ */ t(
|
|
5589
5597
|
Q,
|
|
5590
5598
|
{
|
|
5591
|
-
variant:
|
|
5599
|
+
variant: E.kind === "medication" ? "info" : "neutral",
|
|
5592
5600
|
size: "sm",
|
|
5593
|
-
children: a(`anamnesis.medKind.${
|
|
5601
|
+
children: a(`anamnesis.medKind.${E.kind}`)
|
|
5594
5602
|
}
|
|
5595
5603
|
)
|
|
5596
5604
|
]
|
|
5597
5605
|
},
|
|
5598
|
-
|
|
5606
|
+
E.id
|
|
5599
5607
|
)) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
|
|
5600
5608
|
/* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.labs", t: a, children: /* @__PURE__ */ t(
|
|
5601
5609
|
Ga,
|
|
@@ -5651,7 +5659,7 @@ function Ko({
|
|
|
5651
5659
|
pt,
|
|
5652
5660
|
{
|
|
5653
5661
|
intake: e.intake,
|
|
5654
|
-
sections:
|
|
5662
|
+
sections: b,
|
|
5655
5663
|
sex: o.sex,
|
|
5656
5664
|
t: a
|
|
5657
5665
|
}
|
|
@@ -5688,38 +5696,38 @@ function $t({
|
|
|
5688
5696
|
canEdit: c = !0,
|
|
5689
5697
|
defaultTab: m = "questionnaire"
|
|
5690
5698
|
}) {
|
|
5691
|
-
var
|
|
5692
|
-
const [g, h] =
|
|
5693
|
-
e !== k && (
|
|
5699
|
+
var u, T;
|
|
5700
|
+
const [g, h] = $(m), p = ((u = e.intake) == null ? void 0 : u.submittedAtIso) != null, [b, N] = $(!p), [f, C] = $(e), [k, E] = $(e);
|
|
5701
|
+
e !== k && (E(e), C(e), N(((T = e.intake) == null ? void 0 : T.submittedAtIso) == null));
|
|
5694
5702
|
const S = M(
|
|
5695
|
-
() => new Map(f.targets.map((
|
|
5703
|
+
() => new Map(f.targets.map((y) => [y.parameterKey, y.target])),
|
|
5696
5704
|
[f.targets]
|
|
5697
|
-
), D = M(() => Lt(n), [n]),
|
|
5705
|
+
), D = M(() => Lt(n), [n]), A = M(
|
|
5698
5706
|
() => Re(n),
|
|
5699
5707
|
[n]
|
|
5700
|
-
),
|
|
5708
|
+
), w = (y, F) => {
|
|
5709
|
+
C((z) => tt(z, y.key, F)), r == null || r(y.key, F);
|
|
5710
|
+
};
|
|
5701
5711
|
return (
|
|
5702
5712
|
// The goals strip and the tabs are two objects, not one run-on block: an
|
|
5703
5713
|
// explicit column gap keeps the strip from sitting flush on the card
|
|
5704
5714
|
// below it, which read as a rendering fault rather than as a heading.
|
|
5705
5715
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
|
|
5706
|
-
l ||
|
|
5716
|
+
l || f.visits.length === 0 ? null : /* @__PURE__ */ t(
|
|
5707
5717
|
Pt,
|
|
5708
5718
|
{
|
|
5709
|
-
|
|
5719
|
+
visits: f.visits,
|
|
5710
5720
|
defs: D,
|
|
5711
5721
|
targets: S,
|
|
5712
5722
|
t: a,
|
|
5713
|
-
onTargetChange:
|
|
5714
|
-
C((V) => tt(V, I.key, $)), r == null || r(I.key, $);
|
|
5715
|
-
}
|
|
5723
|
+
onTargetChange: w
|
|
5716
5724
|
}
|
|
5717
5725
|
),
|
|
5718
5726
|
/* @__PURE__ */ d(
|
|
5719
5727
|
W,
|
|
5720
5728
|
{
|
|
5721
5729
|
value: g,
|
|
5722
|
-
onValueChange: (
|
|
5730
|
+
onValueChange: (y) => h(y),
|
|
5723
5731
|
children: [
|
|
5724
5732
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
5725
5733
|
/* @__PURE__ */ d(W.List, { "aria-label": a("anamnesis.compile.viewsLabel"), children: [
|
|
@@ -5728,8 +5736,8 @@ function $t({
|
|
|
5728
5736
|
] }),
|
|
5729
5737
|
/* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
5730
5738
|
o,
|
|
5731
|
-
p && !
|
|
5732
|
-
c && !
|
|
5739
|
+
p && !b ? /* @__PURE__ */ t(Q, { variant: "neutral", children: a("anamnesis.questionnaire.compiled") }) : null,
|
|
5740
|
+
c && !b ? /* @__PURE__ */ t(
|
|
5733
5741
|
X,
|
|
5734
5742
|
{
|
|
5735
5743
|
intent: "outline",
|
|
@@ -5751,14 +5759,14 @@ function $t({
|
|
|
5751
5759
|
t: a,
|
|
5752
5760
|
embedded: !0,
|
|
5753
5761
|
config: n,
|
|
5754
|
-
readOnly: !
|
|
5755
|
-
onSubmit: (
|
|
5756
|
-
N(!1), i == null || i(
|
|
5762
|
+
readOnly: !b,
|
|
5763
|
+
onSubmit: (y) => {
|
|
5764
|
+
N(!1), i == null || i(y);
|
|
5757
5765
|
},
|
|
5758
5766
|
jumpToField: s
|
|
5759
5767
|
}
|
|
5760
5768
|
) }),
|
|
5761
|
-
/* @__PURE__ */ t(W.Content, { value: "trend", children:
|
|
5769
|
+
/* @__PURE__ */ t(W.Content, { value: "trend", children: A.length === 0 ? /* @__PURE__ */ t(
|
|
5762
5770
|
Be,
|
|
5763
5771
|
{
|
|
5764
5772
|
variant: "no-results",
|
|
@@ -5785,7 +5793,7 @@ function $t({
|
|
|
5785
5793
|
);
|
|
5786
5794
|
}
|
|
5787
5795
|
$t.displayName = "AnamnesisQuestionnaire";
|
|
5788
|
-
function
|
|
5796
|
+
function cl({
|
|
5789
5797
|
mode: e,
|
|
5790
5798
|
record: a,
|
|
5791
5799
|
t: n,
|
|
@@ -5799,17 +5807,17 @@ function ll({
|
|
|
5799
5807
|
onIntakeSubmit: g,
|
|
5800
5808
|
intakeJumpToField: h,
|
|
5801
5809
|
onMissingAnswerJump: p,
|
|
5802
|
-
onRecordChange:
|
|
5810
|
+
onRecordChange: b,
|
|
5803
5811
|
canEdit: N,
|
|
5804
5812
|
defaultQuestionnaireTab: f,
|
|
5805
5813
|
practitioners: C,
|
|
5806
5814
|
newVisitDateIso: k,
|
|
5807
|
-
defaultView:
|
|
5815
|
+
defaultView: E,
|
|
5808
5816
|
defaultExportMenuOpen: S,
|
|
5809
5817
|
defaultShareOpen: D,
|
|
5810
|
-
defaultExportAudience:
|
|
5818
|
+
defaultExportAudience: A
|
|
5811
5819
|
}) {
|
|
5812
|
-
const
|
|
5820
|
+
const w = e === "intake" ? /* @__PURE__ */ t(
|
|
5813
5821
|
_t,
|
|
5814
5822
|
{
|
|
5815
5823
|
record: a,
|
|
@@ -5834,7 +5842,7 @@ function ll({
|
|
|
5834
5842
|
defaultTab: f
|
|
5835
5843
|
}
|
|
5836
5844
|
) : e === "compile" ? /* @__PURE__ */ t(
|
|
5837
|
-
|
|
5845
|
+
Ko,
|
|
5838
5846
|
{
|
|
5839
5847
|
record: a,
|
|
5840
5848
|
t: n,
|
|
@@ -5845,16 +5853,16 @@ function ll({
|
|
|
5845
5853
|
statusSlot: c,
|
|
5846
5854
|
onOpenNote: m,
|
|
5847
5855
|
onMissingAnswerJump: p,
|
|
5848
|
-
onRecordChange:
|
|
5856
|
+
onRecordChange: b,
|
|
5849
5857
|
practitioners: C,
|
|
5850
5858
|
newVisitDateIso: k,
|
|
5851
|
-
defaultView:
|
|
5859
|
+
defaultView: E,
|
|
5852
5860
|
defaultExportMenuOpen: S,
|
|
5853
5861
|
defaultShareOpen: D,
|
|
5854
|
-
defaultExportAudience:
|
|
5862
|
+
defaultExportAudience: A
|
|
5855
5863
|
}
|
|
5856
5864
|
) : /* @__PURE__ */ t(
|
|
5857
|
-
|
|
5865
|
+
Ho,
|
|
5858
5866
|
{
|
|
5859
5867
|
record: a,
|
|
5860
5868
|
t: n,
|
|
@@ -5869,7 +5877,7 @@ function ll({
|
|
|
5869
5877
|
"data-component": i,
|
|
5870
5878
|
"data-mode": e,
|
|
5871
5879
|
className: "ds:w-full",
|
|
5872
|
-
children:
|
|
5880
|
+
children: w
|
|
5873
5881
|
}
|
|
5874
5882
|
) : /* @__PURE__ */ t(
|
|
5875
5883
|
"main",
|
|
@@ -5880,11 +5888,11 @@ function ll({
|
|
|
5880
5888
|
mode: n(`anamnesis.mode.${e}`)
|
|
5881
5889
|
}),
|
|
5882
5890
|
className: "ds:w-full",
|
|
5883
|
-
children:
|
|
5891
|
+
children: w
|
|
5884
5892
|
}
|
|
5885
5893
|
);
|
|
5886
5894
|
}
|
|
5887
|
-
const
|
|
5895
|
+
const jo = Wn("", {
|
|
5888
5896
|
variants: {
|
|
5889
5897
|
dragging: {
|
|
5890
5898
|
true: "ds:opacity-60",
|
|
@@ -5903,7 +5911,7 @@ function Wa({
|
|
|
5903
5911
|
t: n,
|
|
5904
5912
|
children: i
|
|
5905
5913
|
}) {
|
|
5906
|
-
const [s, o] =
|
|
5914
|
+
const [s, o] = $(null), [r, l] = $(""), c = we(!1), m = na((h) => {
|
|
5907
5915
|
c.current = !c.current, l(c.current ? h : `${h}`);
|
|
5908
5916
|
}, []), g = M(
|
|
5909
5917
|
() => ({ onReorder: a, count: e, dragSource: s, setDragSource: o, announce: m, t: n }),
|
|
@@ -5919,13 +5927,13 @@ function Qa({
|
|
|
5919
5927
|
label: a,
|
|
5920
5928
|
children: n
|
|
5921
5929
|
}) {
|
|
5922
|
-
const i = Wt(zt), [s, o] =
|
|
5930
|
+
const i = Wt(zt), [s, o] = $(!1);
|
|
5923
5931
|
if (!i)
|
|
5924
5932
|
throw new Error(
|
|
5925
5933
|
"AnamnesisReorderRow must render inside an AnamnesisReorderGroup"
|
|
5926
5934
|
);
|
|
5927
|
-
const { t: r } = i, l = (p,
|
|
5928
|
-
const N = Math.max(0, Math.min(i.count - 1,
|
|
5935
|
+
const { t: r } = i, l = (p, b) => {
|
|
5936
|
+
const N = Math.max(0, Math.min(i.count - 1, b));
|
|
5929
5937
|
N !== p && (i.onReorder(p, N), i.announce(
|
|
5930
5938
|
r("anamnesis.configEditor.reorderAnnounce", {
|
|
5931
5939
|
name: a,
|
|
@@ -5949,10 +5957,10 @@ function Qa({
|
|
|
5949
5957
|
onDragLeave: () => o(!1),
|
|
5950
5958
|
onDrop: (p) => {
|
|
5951
5959
|
p.preventDefault();
|
|
5952
|
-
const
|
|
5953
|
-
o(!1), i.setDragSource(null), !(
|
|
5960
|
+
const b = i.dragSource;
|
|
5961
|
+
o(!1), i.setDragSource(null), !(b === null || b === e) && l(b, e);
|
|
5954
5962
|
},
|
|
5955
|
-
className:
|
|
5963
|
+
className: jo({
|
|
5956
5964
|
dragging: m,
|
|
5957
5965
|
dropTarget: s && !m
|
|
5958
5966
|
})
|
|
@@ -5969,7 +5977,7 @@ function Qa({
|
|
|
5969
5977
|
);
|
|
5970
5978
|
return n({ rowProps: g, handle: h });
|
|
5971
5979
|
}
|
|
5972
|
-
function
|
|
5980
|
+
function dl() {
|
|
5973
5981
|
return {
|
|
5974
5982
|
parameters: Ge.parameters.map((e) => ({
|
|
5975
5983
|
...e,
|
|
@@ -5998,7 +6006,7 @@ function Xa(e, a, n) {
|
|
|
5998
6006
|
const i = [...e], [s] = i.splice(a, 1);
|
|
5999
6007
|
return i.splice(n, 0, s), i;
|
|
6000
6008
|
}
|
|
6001
|
-
const
|
|
6009
|
+
const Go = [
|
|
6002
6010
|
"text",
|
|
6003
6011
|
"textarea",
|
|
6004
6012
|
"numberInteger",
|
|
@@ -6009,7 +6017,7 @@ const jo = [
|
|
|
6009
6017
|
"multiChoice",
|
|
6010
6018
|
"frequency",
|
|
6011
6019
|
"meal"
|
|
6012
|
-
],
|
|
6020
|
+
], Wo = new Set(
|
|
6013
6021
|
Ge.intakeSections.flatMap(
|
|
6014
6022
|
(e) => e.fields.map((a) => a.key)
|
|
6015
6023
|
)
|
|
@@ -6018,71 +6026,71 @@ function Ot(e, a) {
|
|
|
6018
6026
|
const n = e.type === "number" ? e.decimal ? "numberDecimal" : "numberInteger" : e.type === "choice" && e.detail ? "choiceWithText" : e.type;
|
|
6019
6027
|
return a(`anamnesis.configEditor.type.${n}`);
|
|
6020
6028
|
}
|
|
6021
|
-
const
|
|
6022
|
-
function
|
|
6029
|
+
const Qo = ["down", "up", "toRange"], tn = ["anthropometric", "dietary", "lab"];
|
|
6030
|
+
function ml({
|
|
6023
6031
|
config: e,
|
|
6024
6032
|
onConfigChange: a,
|
|
6025
6033
|
t: n,
|
|
6026
6034
|
dataComponent: i = "anamnesis-config-editor"
|
|
6027
6035
|
}) {
|
|
6028
|
-
const [s, o] =
|
|
6036
|
+
const [s, o] = $(null), [r, l] = $(null), c = (u) => a({ ...e, parameters: e.parameters.map(u) }), m = (u) => a({
|
|
6029
6037
|
...e,
|
|
6030
6038
|
intakeSections: e.intakeSections.map(u)
|
|
6031
|
-
}), g = (u, T,
|
|
6032
|
-
(
|
|
6033
|
-
...
|
|
6034
|
-
fields:
|
|
6035
|
-
(
|
|
6039
|
+
}), g = (u, T, y) => m(
|
|
6040
|
+
(F) => F.key === u ? {
|
|
6041
|
+
...F,
|
|
6042
|
+
fields: F.fields.map(
|
|
6043
|
+
(z) => z.key === T ? y(z) : z
|
|
6036
6044
|
)
|
|
6037
|
-
} :
|
|
6038
|
-
), h = (u) => a({ ...e, pathologies: e.pathologies.map(u) }), p = (u, T,
|
|
6039
|
-
const
|
|
6040
|
-
if (
|
|
6041
|
-
const
|
|
6045
|
+
} : F
|
|
6046
|
+
), h = (u) => a({ ...e, pathologies: e.pathologies.map(u) }), p = (u, T, y) => {
|
|
6047
|
+
const F = Re(e, u), z = Xa(F, T, y);
|
|
6048
|
+
if (!z) return;
|
|
6049
|
+
const U = new Map(z.map((I, P) => [I.key, P]));
|
|
6042
6050
|
c(
|
|
6043
|
-
(
|
|
6051
|
+
(I) => U.has(I.key) ? { ...I, order: U.get(I.key) } : I
|
|
6044
6052
|
);
|
|
6045
|
-
},
|
|
6046
|
-
const
|
|
6047
|
-
if (!
|
|
6048
|
-
const
|
|
6049
|
-
|
|
6053
|
+
}, b = (u, T) => {
|
|
6054
|
+
const y = Xa(He(e), u, T);
|
|
6055
|
+
if (!y) return;
|
|
6056
|
+
const F = new Map(
|
|
6057
|
+
y.map((z, U) => [z.key, U])
|
|
6050
6058
|
);
|
|
6051
6059
|
m(
|
|
6052
|
-
(
|
|
6060
|
+
(z) => F.has(z.key) ? { ...z, order: F.get(z.key) } : z
|
|
6053
6061
|
);
|
|
6054
|
-
}, N = (u, T,
|
|
6055
|
-
const
|
|
6056
|
-
if (!
|
|
6057
|
-
const
|
|
6058
|
-
|
|
6062
|
+
}, N = (u, T, y) => {
|
|
6063
|
+
const F = Xa(u.fields, T, y);
|
|
6064
|
+
if (!F) return;
|
|
6065
|
+
const z = new Map(
|
|
6066
|
+
F.map((U, I) => [U.key, I])
|
|
6059
6067
|
);
|
|
6060
6068
|
m(
|
|
6061
|
-
(
|
|
6062
|
-
...
|
|
6063
|
-
fields:
|
|
6064
|
-
(
|
|
6069
|
+
(U) => U.key === u.key ? {
|
|
6070
|
+
...U,
|
|
6071
|
+
fields: U.fields.map(
|
|
6072
|
+
(I) => z.has(I.key) ? { ...I, order: z.get(I.key) } : I
|
|
6065
6073
|
)
|
|
6066
|
-
} :
|
|
6074
|
+
} : U
|
|
6067
6075
|
);
|
|
6068
6076
|
}, f = (u, T) => {
|
|
6069
6077
|
u.kind === "parameter" ? c(
|
|
6070
|
-
(
|
|
6078
|
+
(y) => y.key === u.entry.key ? { ...y, enabled: T } : y
|
|
6071
6079
|
) : u.kind === "section" ? m(
|
|
6072
|
-
(
|
|
6073
|
-
) : u.kind === "field" ? g(u.sectionKey, u.entry.key, (
|
|
6074
|
-
...
|
|
6080
|
+
(y) => y.key === u.entry.key ? { ...y, enabled: T } : y
|
|
6081
|
+
) : u.kind === "field" ? g(u.sectionKey, u.entry.key, (y) => ({
|
|
6082
|
+
...y,
|
|
6075
6083
|
enabled: T
|
|
6076
6084
|
})) : h(
|
|
6077
|
-
(
|
|
6085
|
+
(y) => y.code === u.entry.code ? { ...y, enabled: T } : y
|
|
6078
6086
|
);
|
|
6079
|
-
}, C = Ne(e).length, k = Re(e).length,
|
|
6087
|
+
}, C = Ne(e).length, k = Re(e).length, E = dn(e).reduce(
|
|
6080
6088
|
(u, T) => u + T.fields.length,
|
|
6081
6089
|
0
|
|
6082
6090
|
), S = He(e).reduce(
|
|
6083
6091
|
(u, T) => u + T.fields.length,
|
|
6084
6092
|
0
|
|
6085
|
-
), D = at(e).length,
|
|
6093
|
+
), D = at(e).length, A = en(e).length, w = Ne(e).filter(
|
|
6086
6094
|
(u) => u.goal === !0
|
|
6087
6095
|
).length;
|
|
6088
6096
|
return /* @__PURE__ */ d(
|
|
@@ -6105,22 +6113,22 @@ function dl({
|
|
|
6105
6113
|
] }),
|
|
6106
6114
|
/* @__PURE__ */ t(W.Content, { value: "questionnaire", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
|
|
6107
6115
|
/* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${n("anamnesis.configEditor.panelLive", {
|
|
6108
|
-
count:
|
|
6116
|
+
count: E
|
|
6109
6117
|
})} · ${n("anamnesis.configEditor.panelNotCaptured", {
|
|
6110
6118
|
// Not "archived": this also counts live questions inside
|
|
6111
6119
|
// an archived section, which capture drops as a whole.
|
|
6112
|
-
count: S -
|
|
6120
|
+
count: S - E
|
|
6113
6121
|
})}` }),
|
|
6114
6122
|
/* @__PURE__ */ t(
|
|
6115
6123
|
Wa,
|
|
6116
6124
|
{
|
|
6117
6125
|
count: He(e).length,
|
|
6118
|
-
onReorder:
|
|
6126
|
+
onReorder: b,
|
|
6119
6127
|
t: n,
|
|
6120
6128
|
children: He(e).map(
|
|
6121
6129
|
(u, T) => {
|
|
6122
|
-
const
|
|
6123
|
-
(
|
|
6130
|
+
const y = u.enabled === !1, F = u.fields.filter(
|
|
6131
|
+
(z) => z.enabled !== !1
|
|
6124
6132
|
).length;
|
|
6125
6133
|
return /* @__PURE__ */ t(
|
|
6126
6134
|
Qa,
|
|
@@ -6128,21 +6136,21 @@ function dl({
|
|
|
6128
6136
|
index: T,
|
|
6129
6137
|
label: ye(u, n),
|
|
6130
6138
|
children: ({
|
|
6131
|
-
rowProps:
|
|
6132
|
-
handle:
|
|
6139
|
+
rowProps: z,
|
|
6140
|
+
handle: U
|
|
6133
6141
|
}) => /* @__PURE__ */ d("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
6134
6142
|
/* @__PURE__ */ d(
|
|
6135
6143
|
"div",
|
|
6136
6144
|
{
|
|
6137
|
-
|
|
6145
|
+
...z,
|
|
6138
6146
|
className: [
|
|
6139
6147
|
"ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]",
|
|
6140
|
-
|
|
6148
|
+
z.className
|
|
6141
6149
|
].filter(Boolean).join(" "),
|
|
6142
6150
|
children: [
|
|
6143
6151
|
/* @__PURE__ */ d("h3", { className: "type-title-item ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]", children: [
|
|
6144
6152
|
ye(u, n),
|
|
6145
|
-
|
|
6153
|
+
y ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n("anamnesis.configEditor.archived") }) : null
|
|
6146
6154
|
] }),
|
|
6147
6155
|
/* @__PURE__ */ d(
|
|
6148
6156
|
Na,
|
|
@@ -6154,7 +6162,7 @@ function dl({
|
|
|
6154
6162
|
}
|
|
6155
6163
|
),
|
|
6156
6164
|
children: [
|
|
6157
|
-
|
|
6165
|
+
U,
|
|
6158
6166
|
/* @__PURE__ */ t(
|
|
6159
6167
|
re,
|
|
6160
6168
|
{
|
|
@@ -6173,7 +6181,7 @@ function dl({
|
|
|
6173
6181
|
})
|
|
6174
6182
|
}
|
|
6175
6183
|
),
|
|
6176
|
-
|
|
6184
|
+
y ? /* @__PURE__ */ t(
|
|
6177
6185
|
re,
|
|
6178
6186
|
{
|
|
6179
6187
|
size: "sm",
|
|
@@ -6210,27 +6218,27 @@ function dl({
|
|
|
6210
6218
|
]
|
|
6211
6219
|
}
|
|
6212
6220
|
),
|
|
6213
|
-
|
|
6221
|
+
F === 0 && !y ? /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n(
|
|
6214
6222
|
"anamnesis.configEditor.sectionEmptyCapture"
|
|
6215
6223
|
) }) : null,
|
|
6216
6224
|
u.fields.length > 0 ? /* @__PURE__ */ t(
|
|
6217
6225
|
Wa,
|
|
6218
6226
|
{
|
|
6219
6227
|
count: u.fields.length,
|
|
6220
|
-
onReorder: (
|
|
6228
|
+
onReorder: (I, P) => N(u, I, P),
|
|
6221
6229
|
t: n,
|
|
6222
|
-
children: /* @__PURE__ */ t(Ze, { divider: "divided", children: u.fields.map((
|
|
6230
|
+
children: /* @__PURE__ */ t(Ze, { divider: "divided", children: u.fields.map((I, P) => /* @__PURE__ */ t(
|
|
6223
6231
|
Qa,
|
|
6224
6232
|
{
|
|
6225
6233
|
index: P,
|
|
6226
|
-
label: he(
|
|
6227
|
-
children: ({ rowProps:
|
|
6234
|
+
label: he(I, n),
|
|
6235
|
+
children: ({ rowProps: V, handle: G }) => /* @__PURE__ */ t(
|
|
6228
6236
|
Ze.Item,
|
|
6229
6237
|
{
|
|
6230
|
-
...
|
|
6238
|
+
...V,
|
|
6231
6239
|
title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
6232
|
-
he(
|
|
6233
|
-
|
|
6240
|
+
he(I, n),
|
|
6241
|
+
I.required === !0 ? /* @__PURE__ */ t(
|
|
6234
6242
|
Q,
|
|
6235
6243
|
{
|
|
6236
6244
|
size: "sm",
|
|
@@ -6240,7 +6248,7 @@ function dl({
|
|
|
6240
6248
|
)
|
|
6241
6249
|
}
|
|
6242
6250
|
) : null,
|
|
6243
|
-
|
|
6251
|
+
I.enabled === !1 ? /* @__PURE__ */ t(
|
|
6244
6252
|
Q,
|
|
6245
6253
|
{
|
|
6246
6254
|
size: "sm",
|
|
@@ -6252,8 +6260,8 @@ function dl({
|
|
|
6252
6260
|
) : null
|
|
6253
6261
|
] }),
|
|
6254
6262
|
description: [
|
|
6255
|
-
Ot(
|
|
6256
|
-
ot(
|
|
6263
|
+
Ot(I, n),
|
|
6264
|
+
ot(I, n)
|
|
6257
6265
|
].filter(Boolean).join(" · "),
|
|
6258
6266
|
trailing: /* @__PURE__ */ d(
|
|
6259
6267
|
Na,
|
|
@@ -6262,7 +6270,7 @@ function dl({
|
|
|
6262
6270
|
"anamnesis.configEditor.rowActions",
|
|
6263
6271
|
{
|
|
6264
6272
|
name: he(
|
|
6265
|
-
|
|
6273
|
+
I,
|
|
6266
6274
|
n
|
|
6267
6275
|
)
|
|
6268
6276
|
}
|
|
@@ -6279,7 +6287,7 @@ function dl({
|
|
|
6279
6287
|
"anamnesis.configEditor.edit",
|
|
6280
6288
|
{
|
|
6281
6289
|
name: he(
|
|
6282
|
-
|
|
6290
|
+
I,
|
|
6283
6291
|
n
|
|
6284
6292
|
)
|
|
6285
6293
|
}
|
|
@@ -6287,11 +6295,11 @@ function dl({
|
|
|
6287
6295
|
onClick: () => o({
|
|
6288
6296
|
kind: "field",
|
|
6289
6297
|
sectionKey: u.key,
|
|
6290
|
-
entry:
|
|
6298
|
+
entry: I
|
|
6291
6299
|
})
|
|
6292
6300
|
}
|
|
6293
6301
|
),
|
|
6294
|
-
|
|
6302
|
+
I.enabled === !1 ? /* @__PURE__ */ t(
|
|
6295
6303
|
re,
|
|
6296
6304
|
{
|
|
6297
6305
|
size: "sm",
|
|
@@ -6301,7 +6309,7 @@ function dl({
|
|
|
6301
6309
|
"anamnesis.configEditor.restore",
|
|
6302
6310
|
{
|
|
6303
6311
|
name: he(
|
|
6304
|
-
|
|
6312
|
+
I,
|
|
6305
6313
|
n
|
|
6306
6314
|
)
|
|
6307
6315
|
}
|
|
@@ -6310,7 +6318,7 @@ function dl({
|
|
|
6310
6318
|
{
|
|
6311
6319
|
kind: "field",
|
|
6312
6320
|
sectionKey: u.key,
|
|
6313
|
-
entry:
|
|
6321
|
+
entry: I
|
|
6314
6322
|
},
|
|
6315
6323
|
void 0
|
|
6316
6324
|
)
|
|
@@ -6325,7 +6333,7 @@ function dl({
|
|
|
6325
6333
|
"anamnesis.configEditor.archive",
|
|
6326
6334
|
{
|
|
6327
6335
|
name: he(
|
|
6328
|
-
|
|
6336
|
+
I,
|
|
6329
6337
|
n
|
|
6330
6338
|
)
|
|
6331
6339
|
}
|
|
@@ -6334,7 +6342,7 @@ function dl({
|
|
|
6334
6342
|
{
|
|
6335
6343
|
kind: "field",
|
|
6336
6344
|
sectionKey: u.key,
|
|
6337
|
-
entry:
|
|
6345
|
+
entry: I
|
|
6338
6346
|
},
|
|
6339
6347
|
!1
|
|
6340
6348
|
)
|
|
@@ -6346,7 +6354,7 @@ function dl({
|
|
|
6346
6354
|
}
|
|
6347
6355
|
)
|
|
6348
6356
|
},
|
|
6349
|
-
|
|
6357
|
+
I.key
|
|
6350
6358
|
)) })
|
|
6351
6359
|
}
|
|
6352
6360
|
) : null,
|
|
@@ -6403,28 +6411,28 @@ function dl({
|
|
|
6403
6411
|
Wa,
|
|
6404
6412
|
{
|
|
6405
6413
|
count: T.length,
|
|
6406
|
-
onReorder: (
|
|
6414
|
+
onReorder: (y, F) => p(u, y, F),
|
|
6407
6415
|
t: n,
|
|
6408
|
-
children: /* @__PURE__ */ t(Ze, { divider: "divided", children: T.map((
|
|
6409
|
-
const
|
|
6410
|
-
|
|
6416
|
+
children: /* @__PURE__ */ t(Ze, { divider: "divided", children: T.map((y, F) => {
|
|
6417
|
+
const z = [
|
|
6418
|
+
Yo(y, n),
|
|
6411
6419
|
n(
|
|
6412
|
-
`anamnesis.configEditor.direction.${
|
|
6420
|
+
`anamnesis.configEditor.direction.${y.betterDirection}`
|
|
6413
6421
|
),
|
|
6414
|
-
|
|
6422
|
+
y.locked ? n("anamnesis.configEditor.lockedHint") : null
|
|
6415
6423
|
].filter(Boolean).join(" · ");
|
|
6416
6424
|
return /* @__PURE__ */ t(
|
|
6417
6425
|
Qa,
|
|
6418
6426
|
{
|
|
6419
|
-
index:
|
|
6420
|
-
label: Te(
|
|
6421
|
-
children: ({ rowProps:
|
|
6427
|
+
index: F,
|
|
6428
|
+
label: Te(y, n),
|
|
6429
|
+
children: ({ rowProps: U, handle: I }) => /* @__PURE__ */ t(
|
|
6422
6430
|
Ze.Item,
|
|
6423
6431
|
{
|
|
6424
|
-
...
|
|
6432
|
+
...U,
|
|
6425
6433
|
title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
6426
|
-
Te(
|
|
6427
|
-
|
|
6434
|
+
Te(y, n),
|
|
6435
|
+
y.locked ? /* @__PURE__ */ t(
|
|
6428
6436
|
Q,
|
|
6429
6437
|
{
|
|
6430
6438
|
size: "sm",
|
|
@@ -6433,11 +6441,11 @@ function dl({
|
|
|
6433
6441
|
children: n("anamnesis.configEditor.locked")
|
|
6434
6442
|
}
|
|
6435
6443
|
) : null,
|
|
6436
|
-
|
|
6444
|
+
y.enabled === !1 ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n(
|
|
6437
6445
|
"anamnesis.configEditor.archived"
|
|
6438
6446
|
) }) : null
|
|
6439
6447
|
] }),
|
|
6440
|
-
description:
|
|
6448
|
+
description: z,
|
|
6441
6449
|
trailing: /* @__PURE__ */ d(
|
|
6442
6450
|
Na,
|
|
6443
6451
|
{
|
|
@@ -6445,13 +6453,13 @@ function dl({
|
|
|
6445
6453
|
"anamnesis.configEditor.rowActions",
|
|
6446
6454
|
{
|
|
6447
6455
|
name: Te(
|
|
6448
|
-
|
|
6456
|
+
y,
|
|
6449
6457
|
n
|
|
6450
6458
|
)
|
|
6451
6459
|
}
|
|
6452
6460
|
),
|
|
6453
6461
|
children: [
|
|
6454
|
-
|
|
6462
|
+
I,
|
|
6455
6463
|
/* @__PURE__ */ t(
|
|
6456
6464
|
re,
|
|
6457
6465
|
{
|
|
@@ -6462,18 +6470,18 @@ function dl({
|
|
|
6462
6470
|
"anamnesis.configEditor.edit",
|
|
6463
6471
|
{
|
|
6464
6472
|
name: Te(
|
|
6465
|
-
|
|
6473
|
+
y,
|
|
6466
6474
|
n
|
|
6467
6475
|
)
|
|
6468
6476
|
}
|
|
6469
6477
|
),
|
|
6470
6478
|
onClick: () => o({
|
|
6471
6479
|
kind: "parameter",
|
|
6472
|
-
entry:
|
|
6480
|
+
entry: y
|
|
6473
6481
|
})
|
|
6474
6482
|
}
|
|
6475
6483
|
),
|
|
6476
|
-
|
|
6484
|
+
y.locked ? null : y.enabled === !1 ? /* @__PURE__ */ t(
|
|
6477
6485
|
re,
|
|
6478
6486
|
{
|
|
6479
6487
|
size: "sm",
|
|
@@ -6483,7 +6491,7 @@ function dl({
|
|
|
6483
6491
|
"anamnesis.configEditor.restore",
|
|
6484
6492
|
{
|
|
6485
6493
|
name: Te(
|
|
6486
|
-
|
|
6494
|
+
y,
|
|
6487
6495
|
n
|
|
6488
6496
|
)
|
|
6489
6497
|
}
|
|
@@ -6491,7 +6499,7 @@ function dl({
|
|
|
6491
6499
|
onClick: () => f(
|
|
6492
6500
|
{
|
|
6493
6501
|
kind: "parameter",
|
|
6494
|
-
entry:
|
|
6502
|
+
entry: y
|
|
6495
6503
|
},
|
|
6496
6504
|
void 0
|
|
6497
6505
|
)
|
|
@@ -6506,7 +6514,7 @@ function dl({
|
|
|
6506
6514
|
"anamnesis.configEditor.archive",
|
|
6507
6515
|
{
|
|
6508
6516
|
name: Te(
|
|
6509
|
-
|
|
6517
|
+
y,
|
|
6510
6518
|
n
|
|
6511
6519
|
)
|
|
6512
6520
|
}
|
|
@@ -6514,7 +6522,7 @@ function dl({
|
|
|
6514
6522
|
onClick: () => f(
|
|
6515
6523
|
{
|
|
6516
6524
|
kind: "parameter",
|
|
6517
|
-
entry:
|
|
6525
|
+
entry: y
|
|
6518
6526
|
},
|
|
6519
6527
|
!1
|
|
6520
6528
|
)
|
|
@@ -6526,7 +6534,7 @@ function dl({
|
|
|
6526
6534
|
}
|
|
6527
6535
|
)
|
|
6528
6536
|
},
|
|
6529
|
-
|
|
6537
|
+
y.key
|
|
6530
6538
|
);
|
|
6531
6539
|
}) })
|
|
6532
6540
|
}
|
|
@@ -6551,12 +6559,12 @@ function dl({
|
|
|
6551
6559
|
/* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${n("anamnesis.configEditor.panelLive", {
|
|
6552
6560
|
count: D
|
|
6553
6561
|
})} · ${n("anamnesis.configEditor.panelArchived", {
|
|
6554
|
-
count:
|
|
6562
|
+
count: A - D
|
|
6555
6563
|
})}` }),
|
|
6556
6564
|
/* @__PURE__ */ t(Ze, { divider: "divided", children: en(e).map((u) => {
|
|
6557
6565
|
const T = e.pathologies.some(
|
|
6558
|
-
(
|
|
6559
|
-
),
|
|
6566
|
+
(F) => F.parentCode === u.code && F.enabled !== !1
|
|
6567
|
+
), y = [
|
|
6560
6568
|
u.parentCode ? n("anamnesis.configEditor.subCodeOf", {
|
|
6561
6569
|
code: u.parentCode
|
|
6562
6570
|
}) : null,
|
|
@@ -6569,7 +6577,7 @@ function dl({
|
|
|
6569
6577
|
Se(u.code, n, u),
|
|
6570
6578
|
u.enabled === !1 ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n("anamnesis.configEditor.archived") }) : null
|
|
6571
6579
|
] }),
|
|
6572
|
-
description:
|
|
6580
|
+
description: y || void 0,
|
|
6573
6581
|
trailing: /* @__PURE__ */ d(
|
|
6574
6582
|
Na,
|
|
6575
6583
|
{
|
|
@@ -6656,7 +6664,7 @@ function dl({
|
|
|
6656
6664
|
] }) }),
|
|
6657
6665
|
/* @__PURE__ */ t(W.Content, { value: "targets", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
|
|
6658
6666
|
/* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.configEditor.panelTracked", {
|
|
6659
|
-
count:
|
|
6667
|
+
count: w
|
|
6660
6668
|
}) }),
|
|
6661
6669
|
/* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.configEditor.targetsIntro") }),
|
|
6662
6670
|
tn.map((u) => {
|
|
@@ -6667,16 +6675,16 @@ function dl({
|
|
|
6667
6675
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
6668
6676
|
children: [
|
|
6669
6677
|
/* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: n(`anamnesis.group.${u}`) }),
|
|
6670
|
-
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: T.map((
|
|
6678
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: T.map((y) => /* @__PURE__ */ t(
|
|
6671
6679
|
cn,
|
|
6672
6680
|
{
|
|
6673
|
-
label: Te(
|
|
6674
|
-
checked:
|
|
6675
|
-
onCheckedChange: (
|
|
6676
|
-
(
|
|
6681
|
+
label: Te(y, n),
|
|
6682
|
+
checked: y.goal === !0,
|
|
6683
|
+
onCheckedChange: (F) => c(
|
|
6684
|
+
(z) => z.key === y.key ? { ...z, goal: F === !0 } : z
|
|
6677
6685
|
)
|
|
6678
6686
|
},
|
|
6679
|
-
|
|
6687
|
+
y.key
|
|
6680
6688
|
)) })
|
|
6681
6689
|
]
|
|
6682
6690
|
},
|
|
@@ -6686,7 +6694,7 @@ function dl({
|
|
|
6686
6694
|
] }) })
|
|
6687
6695
|
] }) }) }),
|
|
6688
6696
|
/* @__PURE__ */ t(
|
|
6689
|
-
|
|
6697
|
+
Xo,
|
|
6690
6698
|
{
|
|
6691
6699
|
editing: s,
|
|
6692
6700
|
onClose: () => o(null),
|
|
@@ -6696,7 +6704,7 @@ function dl({
|
|
|
6696
6704
|
}
|
|
6697
6705
|
),
|
|
6698
6706
|
/* @__PURE__ */ t(
|
|
6699
|
-
|
|
6707
|
+
ar,
|
|
6700
6708
|
{
|
|
6701
6709
|
adding: r,
|
|
6702
6710
|
onClose: () => l(null),
|
|
@@ -6709,11 +6717,11 @@ function dl({
|
|
|
6709
6717
|
}
|
|
6710
6718
|
);
|
|
6711
6719
|
}
|
|
6712
|
-
function
|
|
6720
|
+
function Yo(e, a) {
|
|
6713
6721
|
const n = e.referenceRange;
|
|
6714
6722
|
return n ? n.min != null && n.max != null ? `${n.min}–${n.max}` : n.max != null ? a("anamnesis.range.atMost", { value: n.max }) : n.min != null ? a("anamnesis.range.atLeast", { value: n.min }) : null : null;
|
|
6715
6723
|
}
|
|
6716
|
-
function
|
|
6724
|
+
function Xo({
|
|
6717
6725
|
editing: e,
|
|
6718
6726
|
onClose: a,
|
|
6719
6727
|
config: n,
|
|
@@ -6728,7 +6736,7 @@ function Yo({
|
|
|
6728
6736
|
o || a();
|
|
6729
6737
|
},
|
|
6730
6738
|
children: e ? /* @__PURE__ */ t(
|
|
6731
|
-
|
|
6739
|
+
Zo,
|
|
6732
6740
|
{
|
|
6733
6741
|
editing: e,
|
|
6734
6742
|
onClose: a,
|
|
@@ -6736,44 +6744,44 @@ function Yo({
|
|
|
6736
6744
|
onConfigChange: i,
|
|
6737
6745
|
t: s
|
|
6738
6746
|
},
|
|
6739
|
-
|
|
6747
|
+
Jo(e)
|
|
6740
6748
|
) : null
|
|
6741
6749
|
}
|
|
6742
6750
|
);
|
|
6743
6751
|
}
|
|
6744
|
-
function
|
|
6752
|
+
function Jo(e) {
|
|
6745
6753
|
return e.kind === "pathology" ? `pathology:${e.entry.code}` : e.kind === "field" ? `field:${e.sectionKey}:${e.entry.key}` : `${e.kind}:${e.entry.key}`;
|
|
6746
6754
|
}
|
|
6747
|
-
function
|
|
6755
|
+
function Zo({
|
|
6748
6756
|
editing: e,
|
|
6749
6757
|
onClose: a,
|
|
6750
6758
|
config: n,
|
|
6751
6759
|
onConfigChange: i,
|
|
6752
6760
|
t: s
|
|
6753
6761
|
}) {
|
|
6754
|
-
const o = e.entry, r =
|
|
6762
|
+
const o = e.entry, r = er(e, s), [l, c] = $(o.label ?? ""), [m, g] = $(
|
|
6755
6763
|
e.kind === "field" ? o.helpText ?? "" : ""
|
|
6756
|
-
), [h, p] =
|
|
6764
|
+
), [h, p] = $(
|
|
6757
6765
|
e.kind === "field" && e.entry.required === !0
|
|
6758
|
-
),
|
|
6759
|
-
f ? (
|
|
6760
|
-
),
|
|
6761
|
-
const
|
|
6766
|
+
), b = e.kind === "field" ? e.entry : null, N = b !== null && (b.type === "choice" || b.type === "multiChoice"), f = N && !Wo.has(b.key), [C, k] = $(
|
|
6767
|
+
f ? (b.options ?? []).join(", ") : ""
|
|
6768
|
+
), E = C.split(",").map((A) => A.trim()).filter(Boolean), S = !f || E.length > 0, D = () => {
|
|
6769
|
+
const A = l.trim(), w = (u) => {
|
|
6762
6770
|
const T = { ...u };
|
|
6763
|
-
return
|
|
6771
|
+
return A ? T.label = A : delete T.label, T;
|
|
6764
6772
|
};
|
|
6765
6773
|
if (e.kind === "parameter")
|
|
6766
6774
|
i({
|
|
6767
6775
|
...n,
|
|
6768
6776
|
parameters: n.parameters.map(
|
|
6769
|
-
(u) => u.key === e.entry.key ?
|
|
6777
|
+
(u) => u.key === e.entry.key ? w(u) : u
|
|
6770
6778
|
)
|
|
6771
6779
|
});
|
|
6772
6780
|
else if (e.kind === "section")
|
|
6773
6781
|
i({
|
|
6774
6782
|
...n,
|
|
6775
6783
|
intakeSections: n.intakeSections.map(
|
|
6776
|
-
(u) => u.key === e.entry.key ?
|
|
6784
|
+
(u) => u.key === e.entry.key ? w(u) : u
|
|
6777
6785
|
)
|
|
6778
6786
|
});
|
|
6779
6787
|
else if (e.kind === "field") {
|
|
@@ -6783,10 +6791,10 @@ function Jo({
|
|
|
6783
6791
|
intakeSections: n.intakeSections.map(
|
|
6784
6792
|
(T) => T.key === e.sectionKey ? {
|
|
6785
6793
|
...T,
|
|
6786
|
-
fields: T.fields.map((
|
|
6787
|
-
if (
|
|
6788
|
-
const
|
|
6789
|
-
return u ?
|
|
6794
|
+
fields: T.fields.map((y) => {
|
|
6795
|
+
if (y.key !== e.entry.key) return y;
|
|
6796
|
+
const F = w(y);
|
|
6797
|
+
return u ? F.helpText = u : delete F.helpText, f && (F.options = E), h ? F.required = !0 : delete F.required, F;
|
|
6790
6798
|
})
|
|
6791
6799
|
} : T
|
|
6792
6800
|
)
|
|
@@ -6795,7 +6803,7 @@ function Jo({
|
|
|
6795
6803
|
i({
|
|
6796
6804
|
...n,
|
|
6797
6805
|
pathologies: n.pathologies.map(
|
|
6798
|
-
(u) => u.code === o.code ?
|
|
6806
|
+
(u) => u.code === o.code ? w(u) : u
|
|
6799
6807
|
)
|
|
6800
6808
|
});
|
|
6801
6809
|
a();
|
|
@@ -6823,7 +6831,7 @@ function Jo({
|
|
|
6823
6831
|
ae,
|
|
6824
6832
|
{
|
|
6825
6833
|
value: l,
|
|
6826
|
-
onChange: (
|
|
6834
|
+
onChange: (A) => c(A.target.value),
|
|
6827
6835
|
placeholder: r
|
|
6828
6836
|
}
|
|
6829
6837
|
)
|
|
@@ -6833,7 +6841,7 @@ function Jo({
|
|
|
6833
6841
|
ta,
|
|
6834
6842
|
{
|
|
6835
6843
|
value: m,
|
|
6836
|
-
onChange: (
|
|
6844
|
+
onChange: (A) => g(A.target.value),
|
|
6837
6845
|
minRows: 2
|
|
6838
6846
|
}
|
|
6839
6847
|
) }) : null,
|
|
@@ -6842,7 +6850,7 @@ function Jo({
|
|
|
6842
6850
|
{
|
|
6843
6851
|
label: s("anamnesis.configEditor.requiredField"),
|
|
6844
6852
|
checked: h,
|
|
6845
|
-
onCheckedChange: (
|
|
6853
|
+
onCheckedChange: (A) => p(A === !0)
|
|
6846
6854
|
}
|
|
6847
6855
|
) : null,
|
|
6848
6856
|
f ? /* @__PURE__ */ t(
|
|
@@ -6855,14 +6863,14 @@ function Jo({
|
|
|
6855
6863
|
ae,
|
|
6856
6864
|
{
|
|
6857
6865
|
value: C,
|
|
6858
|
-
onChange: (
|
|
6866
|
+
onChange: (A) => k(A.target.value)
|
|
6859
6867
|
}
|
|
6860
6868
|
)
|
|
6861
6869
|
}
|
|
6862
6870
|
) : N ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: s("anamnesis.configEditor.optionsCurrent", {
|
|
6863
|
-
list: (
|
|
6864
|
-
(
|
|
6865
|
-
defaultValue:
|
|
6871
|
+
list: (b.options ?? []).map(
|
|
6872
|
+
(A) => s(`anamnesis.field.${b.key}.option.${A}`, {
|
|
6873
|
+
defaultValue: A
|
|
6866
6874
|
})
|
|
6867
6875
|
).join(", ")
|
|
6868
6876
|
}) }) : null
|
|
@@ -6873,7 +6881,7 @@ function Jo({
|
|
|
6873
6881
|
] })
|
|
6874
6882
|
] });
|
|
6875
6883
|
}
|
|
6876
|
-
function
|
|
6884
|
+
function er(e, a) {
|
|
6877
6885
|
return e.kind === "parameter" ? Te({ ...e.entry, label: void 0 }, a) : e.kind === "section" ? ye({ ...e.entry, label: void 0 }, a) : e.kind === "field" ? he({ ...e.entry, label: void 0 }, a) : Se(e.entry.code, a, {
|
|
6878
6886
|
...e.entry,
|
|
6879
6887
|
label: void 0
|
|
@@ -6882,7 +6890,7 @@ function Zo(e, a) {
|
|
|
6882
6890
|
function Ja(e) {
|
|
6883
6891
|
return e === "choice" || e === "choiceWithText" || e === "multiChoice";
|
|
6884
6892
|
}
|
|
6885
|
-
function
|
|
6893
|
+
function ar({
|
|
6886
6894
|
adding: e,
|
|
6887
6895
|
onClose: a,
|
|
6888
6896
|
config: n,
|
|
@@ -6897,7 +6905,7 @@ function er({
|
|
|
6897
6905
|
o || a();
|
|
6898
6906
|
},
|
|
6899
6907
|
children: e ? /* @__PURE__ */ t(
|
|
6900
|
-
|
|
6908
|
+
nr,
|
|
6901
6909
|
{
|
|
6902
6910
|
adding: e,
|
|
6903
6911
|
onClose: a,
|
|
@@ -6910,41 +6918,41 @@ function er({
|
|
|
6910
6918
|
}
|
|
6911
6919
|
);
|
|
6912
6920
|
}
|
|
6913
|
-
function
|
|
6921
|
+
function nr({
|
|
6914
6922
|
adding: e,
|
|
6915
6923
|
onClose: a,
|
|
6916
6924
|
config: n,
|
|
6917
6925
|
onConfigChange: i,
|
|
6918
6926
|
t: s
|
|
6919
6927
|
}) {
|
|
6920
|
-
const [o, r] =
|
|
6921
|
-
value:
|
|
6922
|
-
label: s(`anamnesis.group.${
|
|
6923
|
-
})), G =
|
|
6924
|
-
value:
|
|
6925
|
-
label: s(`anamnesis.configEditor.direction.${
|
|
6926
|
-
})), ne =
|
|
6927
|
-
value:
|
|
6928
|
-
label: s(`anamnesis.configEditor.type.${
|
|
6929
|
-
})), ue = n.pathologies.filter((
|
|
6930
|
-
value:
|
|
6931
|
-
label: Se(
|
|
6932
|
-
})), pe =
|
|
6928
|
+
const [o, r] = $(""), [l, c] = $(""), [m, g] = $(""), [h, p] = $(""), [b, N] = $(""), [f, C] = $(""), [k, E] = $("0"), [S, D] = $(""), [A, w] = $(""), [u, T] = $(""), [y, F] = $(""), [z, U] = $(!1), [I, P] = $(""), V = tn.map((R) => ({
|
|
6929
|
+
value: R,
|
|
6930
|
+
label: s(`anamnesis.group.${R}`)
|
|
6931
|
+
})), G = Qo.map((R) => ({
|
|
6932
|
+
value: R,
|
|
6933
|
+
label: s(`anamnesis.configEditor.direction.${R}`)
|
|
6934
|
+
})), ne = Go.map((R) => ({
|
|
6935
|
+
value: R,
|
|
6936
|
+
label: s(`anamnesis.configEditor.type.${R}`)
|
|
6937
|
+
})), ue = n.pathologies.filter((R) => !R.parentCode && R.enabled !== !1).map((R) => ({
|
|
6938
|
+
value: R.code,
|
|
6939
|
+
label: Se(R.code, s, R)
|
|
6940
|
+
})), pe = A.split(",").map((R) => R.trim()).filter(Boolean), ce = e.kind === "parameter" ? o.trim() !== "" && l !== "" && m !== "" : e.kind === "field" ? o.trim() !== "" && S !== "" && (!Ja(S) || pe.length > 0) : e.kind === "section" ? o.trim() !== "" : o.trim() !== "" && y.trim() !== "" && // A duplicate code would collide with the existing entry
|
|
6933
6941
|
// everywhere codes are matched (lookup, archive, edit) —
|
|
6934
6942
|
// uniqueness is the add gate, matching keyFromLabel's guarantee
|
|
6935
6943
|
// on the other vocabularies.
|
|
6936
6944
|
!n.pathologies.some(
|
|
6937
|
-
(
|
|
6945
|
+
(R) => R.code.toLowerCase() === y.trim().toLowerCase()
|
|
6938
6946
|
), J = () => {
|
|
6939
|
-
const
|
|
6947
|
+
const R = o.trim();
|
|
6940
6948
|
if (e.kind === "parameter") {
|
|
6941
|
-
const
|
|
6949
|
+
const B = new Set(n.parameters.map((De) => De.key)), Z = (De) => {
|
|
6942
6950
|
if (De.trim() === "") return;
|
|
6943
6951
|
const Ie = Number(De);
|
|
6944
6952
|
return Number.isFinite(Ie) ? Ie : void 0;
|
|
6945
|
-
}, de = Z(
|
|
6946
|
-
key: Ya(
|
|
6947
|
-
label:
|
|
6953
|
+
}, de = Z(b), le = Z(f), Ee = {
|
|
6954
|
+
key: Ya(R, B),
|
|
6955
|
+
label: R,
|
|
6948
6956
|
group: l,
|
|
6949
6957
|
betterDirection: m,
|
|
6950
6958
|
precision: Number(k),
|
|
@@ -6958,19 +6966,19 @@ function ar({
|
|
|
6958
6966
|
};
|
|
6959
6967
|
i({ ...n, parameters: [...n.parameters, Ee] });
|
|
6960
6968
|
} else if (e.kind === "field") {
|
|
6961
|
-
const
|
|
6969
|
+
const B = new Set(
|
|
6962
6970
|
n.intakeSections.flatMap(
|
|
6963
6971
|
(le) => le.fields.map((Ee) => Ee.key)
|
|
6964
6972
|
)
|
|
6965
6973
|
), Z = S === "numberInteger" || S === "numberDecimal" ? "number" : S === "choiceWithText" ? "choice" : S, de = {
|
|
6966
|
-
key: Ya(
|
|
6967
|
-
label:
|
|
6974
|
+
key: Ya(R, B),
|
|
6975
|
+
label: R,
|
|
6968
6976
|
type: Z,
|
|
6969
6977
|
...S === "numberDecimal" ? { decimal: !0 } : {},
|
|
6970
6978
|
...S === "choiceWithText" ? { detail: !0 } : {},
|
|
6971
6979
|
...Ja(S) ? { options: pe } : {},
|
|
6972
6980
|
...u.trim() ? { helpText: u.trim() } : {},
|
|
6973
|
-
|
|
6981
|
+
...z ? { required: !0 } : {}
|
|
6974
6982
|
};
|
|
6975
6983
|
i({
|
|
6976
6984
|
...n,
|
|
@@ -6979,11 +6987,11 @@ function ar({
|
|
|
6979
6987
|
)
|
|
6980
6988
|
});
|
|
6981
6989
|
} else if (e.kind === "section") {
|
|
6982
|
-
const
|
|
6990
|
+
const B = new Set(
|
|
6983
6991
|
n.intakeSections.map((de) => de.key)
|
|
6984
6992
|
), Z = {
|
|
6985
|
-
key: Ya(
|
|
6986
|
-
label:
|
|
6993
|
+
key: Ya(R, B),
|
|
6994
|
+
label: R,
|
|
6987
6995
|
fields: []
|
|
6988
6996
|
};
|
|
6989
6997
|
i({
|
|
@@ -6991,19 +6999,19 @@ function ar({
|
|
|
6991
6999
|
intakeSections: [...n.intakeSections, Z]
|
|
6992
7000
|
});
|
|
6993
7001
|
} else {
|
|
6994
|
-
const
|
|
6995
|
-
code:
|
|
6996
|
-
label:
|
|
6997
|
-
...
|
|
7002
|
+
const B = {
|
|
7003
|
+
code: y.trim(),
|
|
7004
|
+
label: R,
|
|
7005
|
+
...I ? { parentCode: I } : {}
|
|
6998
7006
|
};
|
|
6999
7007
|
i({
|
|
7000
7008
|
...n,
|
|
7001
|
-
pathologies: [...n.pathologies,
|
|
7009
|
+
pathologies: [...n.pathologies, B]
|
|
7002
7010
|
});
|
|
7003
7011
|
}
|
|
7004
7012
|
a();
|
|
7005
7013
|
}, Ae = e.kind === "parameter" ? s("anamnesis.configEditor.addParameterTitle") : e.kind === "field" ? s("anamnesis.configEditor.addQuestionTitle", {
|
|
7006
|
-
section:
|
|
7014
|
+
section: tr(n, e.sectionKey, s)
|
|
7007
7015
|
}) : e.kind === "section" ? s("anamnesis.configEditor.addSectionTitle") : s("anamnesis.configEditor.addCodeTitle");
|
|
7008
7016
|
return /* @__PURE__ */ d(Y.Content, { size: "sm", children: [
|
|
7009
7017
|
/* @__PURE__ */ d(Y.Header, { children: [
|
|
@@ -7014,24 +7022,24 @@ function ar({
|
|
|
7014
7022
|
e.kind === "pathology" ? /* @__PURE__ */ t(q, { label: s("anamnesis.configEditor.codeField"), required: !0, children: /* @__PURE__ */ t(
|
|
7015
7023
|
ae,
|
|
7016
7024
|
{
|
|
7017
|
-
value:
|
|
7018
|
-
onChange: (
|
|
7025
|
+
value: y,
|
|
7026
|
+
onChange: (R) => F(R.target.value)
|
|
7019
7027
|
}
|
|
7020
7028
|
) }) : null,
|
|
7021
7029
|
/* @__PURE__ */ t(q, { label: s("anamnesis.configEditor.labelField"), required: !0, children: /* @__PURE__ */ t(
|
|
7022
7030
|
ae,
|
|
7023
7031
|
{
|
|
7024
7032
|
value: o,
|
|
7025
|
-
onChange: (
|
|
7033
|
+
onChange: (R) => r(R.target.value)
|
|
7026
7034
|
}
|
|
7027
7035
|
) }),
|
|
7028
7036
|
e.kind === "parameter" ? /* @__PURE__ */ d(Le, { children: [
|
|
7029
7037
|
/* @__PURE__ */ t(q, { label: s("anamnesis.configEditor.groupField"), required: !0, children: /* @__PURE__ */ t(
|
|
7030
7038
|
Me,
|
|
7031
7039
|
{
|
|
7032
|
-
options:
|
|
7040
|
+
options: V,
|
|
7033
7041
|
value: l,
|
|
7034
|
-
onValueChange: (
|
|
7042
|
+
onValueChange: (R) => c(R),
|
|
7035
7043
|
placeholder: s("anamnesis.configEditor.selectPlaceholder"),
|
|
7036
7044
|
"aria-label": s("anamnesis.configEditor.groupField")
|
|
7037
7045
|
}
|
|
@@ -7046,7 +7054,7 @@ function ar({
|
|
|
7046
7054
|
{
|
|
7047
7055
|
options: G,
|
|
7048
7056
|
value: m,
|
|
7049
|
-
onValueChange: (
|
|
7057
|
+
onValueChange: (R) => g(R),
|
|
7050
7058
|
placeholder: s("anamnesis.configEditor.selectPlaceholder"),
|
|
7051
7059
|
"aria-label": s("anamnesis.configEditor.directionField")
|
|
7052
7060
|
}
|
|
@@ -7058,7 +7066,7 @@ function ar({
|
|
|
7058
7066
|
ae,
|
|
7059
7067
|
{
|
|
7060
7068
|
value: h,
|
|
7061
|
-
onChange: (
|
|
7069
|
+
onChange: (R) => p(R.target.value)
|
|
7062
7070
|
}
|
|
7063
7071
|
) }),
|
|
7064
7072
|
/* @__PURE__ */ t(
|
|
@@ -7075,7 +7083,7 @@ function ar({
|
|
|
7075
7083
|
{ value: "2", label: "2" }
|
|
7076
7084
|
],
|
|
7077
7085
|
value: k,
|
|
7078
|
-
onValueChange: (
|
|
7086
|
+
onValueChange: (R) => E(R || "0"),
|
|
7079
7087
|
"aria-label": s("anamnesis.configEditor.precisionField")
|
|
7080
7088
|
}
|
|
7081
7089
|
)
|
|
@@ -7092,8 +7100,8 @@ function ar({
|
|
|
7092
7100
|
ae,
|
|
7093
7101
|
{
|
|
7094
7102
|
inputMode: "decimal",
|
|
7095
|
-
value:
|
|
7096
|
-
onChange: (
|
|
7103
|
+
value: b,
|
|
7104
|
+
onChange: (R) => N(R.target.value)
|
|
7097
7105
|
}
|
|
7098
7106
|
)
|
|
7099
7107
|
}
|
|
@@ -7108,7 +7116,7 @@ function ar({
|
|
|
7108
7116
|
{
|
|
7109
7117
|
inputMode: "decimal",
|
|
7110
7118
|
value: f,
|
|
7111
|
-
onChange: (
|
|
7119
|
+
onChange: (R) => C(R.target.value)
|
|
7112
7120
|
}
|
|
7113
7121
|
)
|
|
7114
7122
|
}
|
|
@@ -7121,7 +7129,7 @@ function ar({
|
|
|
7121
7129
|
{
|
|
7122
7130
|
options: ne,
|
|
7123
7131
|
value: S,
|
|
7124
|
-
onValueChange: (
|
|
7132
|
+
onValueChange: (R) => D(R),
|
|
7125
7133
|
placeholder: s("anamnesis.configEditor.selectPlaceholder"),
|
|
7126
7134
|
"aria-label": s("anamnesis.configEditor.typeField")
|
|
7127
7135
|
}
|
|
@@ -7135,8 +7143,8 @@ function ar({
|
|
|
7135
7143
|
children: /* @__PURE__ */ t(
|
|
7136
7144
|
ae,
|
|
7137
7145
|
{
|
|
7138
|
-
value:
|
|
7139
|
-
onChange: (
|
|
7146
|
+
value: A,
|
|
7147
|
+
onChange: (R) => w(R.target.value)
|
|
7140
7148
|
}
|
|
7141
7149
|
)
|
|
7142
7150
|
}
|
|
@@ -7145,7 +7153,7 @@ function ar({
|
|
|
7145
7153
|
ta,
|
|
7146
7154
|
{
|
|
7147
7155
|
value: u,
|
|
7148
|
-
onChange: (
|
|
7156
|
+
onChange: (R) => T(R.target.value),
|
|
7149
7157
|
minRows: 2
|
|
7150
7158
|
}
|
|
7151
7159
|
) }),
|
|
@@ -7153,8 +7161,8 @@ function ar({
|
|
|
7153
7161
|
cn,
|
|
7154
7162
|
{
|
|
7155
7163
|
label: s("anamnesis.configEditor.requiredField"),
|
|
7156
|
-
checked:
|
|
7157
|
-
onCheckedChange: (
|
|
7164
|
+
checked: z,
|
|
7165
|
+
onCheckedChange: (R) => U(R === !0)
|
|
7158
7166
|
}
|
|
7159
7167
|
)
|
|
7160
7168
|
] }) : null,
|
|
@@ -7168,8 +7176,8 @@ function ar({
|
|
|
7168
7176
|
Me,
|
|
7169
7177
|
{
|
|
7170
7178
|
options: ue,
|
|
7171
|
-
value:
|
|
7172
|
-
onValueChange: (
|
|
7179
|
+
value: I,
|
|
7180
|
+
onValueChange: (R) => P(R),
|
|
7173
7181
|
placeholder: s("anamnesis.configEditor.selectPlaceholder"),
|
|
7174
7182
|
clearable: !0,
|
|
7175
7183
|
"aria-label": s("anamnesis.configEditor.parentField")
|
|
@@ -7185,7 +7193,7 @@ function ar({
|
|
|
7185
7193
|
] })
|
|
7186
7194
|
] });
|
|
7187
7195
|
}
|
|
7188
|
-
function
|
|
7196
|
+
function tr(e, a, n) {
|
|
7189
7197
|
const i = e.intakeSections.find(
|
|
7190
7198
|
(s) => s.key === a
|
|
7191
7199
|
);
|
|
@@ -7194,7 +7202,7 @@ function nr(e, a, n) {
|
|
|
7194
7202
|
function jn(e) {
|
|
7195
7203
|
return e.kind === "visit" ? `anamnesis-visit-${e.visitId}` : `anamnesis-event-${e.eventId}`;
|
|
7196
7204
|
}
|
|
7197
|
-
function
|
|
7205
|
+
function ul(e, a) {
|
|
7198
7206
|
const n = e.visits.filter(gt).map((s) => ({
|
|
7199
7207
|
id: jn({ kind: "visit", visitId: s.id }),
|
|
7200
7208
|
dateIso: s.dateIso,
|
|
@@ -7234,7 +7242,7 @@ function ml(e, a) {
|
|
|
7234
7242
|
(s, o) => o.dateIso.localeCompare(s.dateIso)
|
|
7235
7243
|
);
|
|
7236
7244
|
}
|
|
7237
|
-
const Za = "patterns",
|
|
7245
|
+
const Za = "patterns", ir = {
|
|
7238
7246
|
anamnesis: {
|
|
7239
7247
|
mainLabel: "Anamnesis record — {{mode}}",
|
|
7240
7248
|
mode: { intake: "Intake", compile: "Compile", readOnly: "Read-only" },
|
|
@@ -7871,7 +7879,7 @@ const Za = "patterns", tr = {
|
|
|
7871
7879
|
}
|
|
7872
7880
|
}
|
|
7873
7881
|
}
|
|
7874
|
-
},
|
|
7882
|
+
}, sr = {
|
|
7875
7883
|
anamnesis: {
|
|
7876
7884
|
mainLabel: "Cartella anamnestica — {{mode}}",
|
|
7877
7885
|
mode: {
|
|
@@ -8499,7 +8507,7 @@ const Za = "patterns", tr = {
|
|
|
8499
8507
|
}
|
|
8500
8508
|
}
|
|
8501
8509
|
}
|
|
8502
|
-
},
|
|
8510
|
+
}, or = {
|
|
8503
8511
|
anamnesis: {
|
|
8504
8512
|
mainLabel: "السجل الطبي — {{mode}}",
|
|
8505
8513
|
mode: { intake: "الاستجواب", compile: "التجميع", readOnly: "للقراءة فقط" },
|
|
@@ -8774,7 +8782,7 @@ const Za = "patterns", tr = {
|
|
|
8774
8782
|
groupGeneral: "عام"
|
|
8775
8783
|
}
|
|
8776
8784
|
}
|
|
8777
|
-
},
|
|
8785
|
+
}, rr = {
|
|
8778
8786
|
anamnesis: {
|
|
8779
8787
|
mainLabel: "問診記録 — {{mode}}",
|
|
8780
8788
|
mode: { intake: "問診", compile: "記入", readOnly: "閲覧のみ" },
|
|
@@ -9044,28 +9052,28 @@ const Za = "patterns", tr = {
|
|
|
9044
9052
|
groupGeneral: "一般"
|
|
9045
9053
|
}
|
|
9046
9054
|
}
|
|
9047
|
-
},
|
|
9048
|
-
en:
|
|
9049
|
-
it:
|
|
9050
|
-
ar:
|
|
9051
|
-
ja:
|
|
9055
|
+
}, lr = {
|
|
9056
|
+
en: ir,
|
|
9057
|
+
it: sr,
|
|
9058
|
+
ar: or,
|
|
9059
|
+
ja: rr
|
|
9052
9060
|
};
|
|
9053
|
-
function
|
|
9054
|
-
for (const [a, n] of Object.entries(
|
|
9061
|
+
function pl(e) {
|
|
9062
|
+
for (const [a, n] of Object.entries(lr))
|
|
9055
9063
|
e.hasResourceBundle(a, Za) ? e.addResourceBundle(a, Za, n, !0, !1) : e.addResourceBundle(a, Za, n);
|
|
9056
9064
|
}
|
|
9057
9065
|
export {
|
|
9058
|
-
|
|
9066
|
+
cl as A,
|
|
9059
9067
|
Ri as L,
|
|
9060
9068
|
Za as P,
|
|
9061
9069
|
Ge as S,
|
|
9062
9070
|
Fi as T,
|
|
9063
|
-
|
|
9071
|
+
ml as a,
|
|
9064
9072
|
Re as b,
|
|
9065
9073
|
en as c,
|
|
9066
9074
|
He as d,
|
|
9067
9075
|
jn as e,
|
|
9068
|
-
|
|
9076
|
+
ul as f,
|
|
9069
9077
|
$i as g,
|
|
9070
9078
|
Ne as h,
|
|
9071
9079
|
at as i,
|
|
@@ -9075,7 +9083,7 @@ export {
|
|
|
9075
9083
|
Ya as m,
|
|
9076
9084
|
oa as n,
|
|
9077
9085
|
Lt as o,
|
|
9078
|
-
|
|
9079
|
-
|
|
9086
|
+
pl as r,
|
|
9087
|
+
dl as s
|
|
9080
9088
|
};
|
|
9081
|
-
//# sourceMappingURL=anamnesis-i18n-
|
|
9089
|
+
//# sourceMappingURL=anamnesis-i18n-9OrXTNS3.js.map
|