@icure/api 8.4.5 → 8.4.6

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.
@@ -5,4 +5,191 @@
5
5
  *
6
6
  * @see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
7
7
  */
8
- export type ISO639_1 = 'ab' | 'aa' | 'af' | 'ak' | 'sq' | 'am' | 'ar' | 'an' | 'hy' | 'av' | 'ae' | 'ay' | 'az' | 'as' | 'bm' | 'ba' | 'eu' | 'be' | 'bn' | 'bi' | 'bs' | 'br' | 'bg' | 'my' | 'ca' | 'ch' | 'ce' | 'ny' | 'zh' | 'cu' | 'cv' | 'kw' | 'co' | 'cr' | 'hr' | 'cs' | 'da' | 'dv' | 'nl' | 'dz' | 'en' | 'eo' | 'et' | 'ee' | 'fo' | 'fj' | 'fi' | 'fr' | 'fy' | 'ff' | 'gd' | 'gl' | 'lg' | 'ka' | 'de' | 'el' | 'kl' | 'gn' | 'gu' | 'ht' | 'ha' | 'he' | 'hz' | 'hi' | 'ho' | 'hu' | 'is' | 'io' | 'ig' | 'id' | 'ia' | 'ie' | 'iu' | 'ik' | 'ga' | 'it' | 'ja' | 'jv' | 'kn' | 'kr' | 'ks' | 'kk' | 'km' | 'ki' | 'rw' | 'ky' | 'kv' | 'kg' | 'ko' | 'kj' | 'ku' | 'lo' | 'la' | 'lv' | 'li' | 'ln' | 'lt' | 'lu' | 'lb' | 'mk' | 'mg' | 'ms' | 'ml' | 'mt' | 'gv' | 'mi' | 'mr' | 'mh' | 'mn' | 'na' | 'nv' | 'nd' | 'nr' | 'ng' | 'ne' | 'no' | 'nb' | 'nn' | 'ii' | 'oc' | 'oj' | 'or' | 'om' | 'os' | 'pi' | 'ps' | 'fa' | 'pl' | 'pt' | 'pa' | 'qu' | 'ro' | 'rm' | 'rn' | 'ru' | 'se' | 'sm' | 'sg' | 'sa' | 'sc' | 'sr' | 'sn' | 'sd' | 'si' | 'sk' | 'sl' | 'so' | 'st' | 'es' | 'su' | 'sw' | 'ss' | 'sv' | 'tl' | 'ty' | 'tg' | 'ta' | 'tt' | 'te' | 'th' | 'bo' | 'ti' | 'to' | 'ts' | 'tn' | 'tr' | 'tk' | 'tw' | 'ug' | 'uk' | 'ur' | 'uz' | 've' | 'vi' | 'vo' | 'wa' | 'cy' | 'wo' | 'xh' | 'yi' | 'yo' | 'za' | 'zu' | 'xx';
8
+ export declare enum ISO639_1_VALUES {
9
+ ab = "ab",
10
+ aa = "aa",
11
+ af = "af",
12
+ ak = "ak",
13
+ sq = "sq",
14
+ am = "am",
15
+ ar = "ar",
16
+ an = "an",
17
+ hy = "hy",
18
+ av = "av",
19
+ ae = "ae",
20
+ ay = "ay",
21
+ az = "az",
22
+ as = "as",
23
+ bm = "bm",
24
+ ba = "ba",
25
+ eu = "eu",
26
+ be = "be",
27
+ bn = "bn",
28
+ bi = "bi",
29
+ bs = "bs",
30
+ br = "br",
31
+ bg = "bg",
32
+ my = "my",
33
+ ca = "ca",
34
+ ch = "ch",
35
+ ce = "ce",
36
+ ny = "ny",
37
+ zh = "zh",
38
+ cu = "cu",
39
+ cv = "cv",
40
+ kw = "kw",
41
+ co = "co",
42
+ cr = "cr",
43
+ hr = "hr",
44
+ cs = "cs",
45
+ da = "da",
46
+ dv = "dv",
47
+ nl = "nl",
48
+ dz = "dz",
49
+ en = "en",
50
+ eo = "eo",
51
+ et = "et",
52
+ ee = "ee",
53
+ fo = "fo",
54
+ fj = "fj",
55
+ fi = "fi",
56
+ fr = "fr",
57
+ fy = "fy",
58
+ ff = "ff",
59
+ gd = "gd",
60
+ gl = "gl",
61
+ lg = "lg",
62
+ ka = "ka",
63
+ de = "de",
64
+ el = "el",
65
+ kl = "kl",
66
+ gn = "gn",
67
+ gu = "gu",
68
+ ht = "ht",
69
+ ha = "ha",
70
+ he = "he",
71
+ hz = "hz",
72
+ hi = "hi",
73
+ ho = "ho",
74
+ hu = "hu",
75
+ is = "is",
76
+ io = "io",
77
+ ig = "ig",
78
+ id = "id",
79
+ ia = "ia",
80
+ ie = "ie",
81
+ iu = "iu",
82
+ ik = "ik",
83
+ ga = "ga",
84
+ it = "it",
85
+ ja = "ja",
86
+ jv = "jv",
87
+ kn = "kn",
88
+ kr = "kr",
89
+ ks = "ks",
90
+ kk = "kk",
91
+ km = "km",
92
+ ki = "ki",
93
+ rw = "rw",
94
+ ky = "ky",
95
+ kv = "kv",
96
+ kg = "kg",
97
+ ko = "ko",
98
+ kj = "kj",
99
+ ku = "ku",
100
+ lo = "lo",
101
+ la = "la",
102
+ lv = "lv",
103
+ li = "li",
104
+ ln = "ln",
105
+ lt = "lt",
106
+ lu = "lu",
107
+ lb = "lb",
108
+ mk = "mk",
109
+ mg = "mg",
110
+ ms = "ms",
111
+ ml = "ml",
112
+ mt = "mt",
113
+ gv = "gv",
114
+ mi = "mi",
115
+ mr = "mr",
116
+ mh = "mh",
117
+ mn = "mn",
118
+ na = "na",
119
+ nv = "nv",
120
+ nd = "nd",
121
+ nr = "nr",
122
+ ng = "ng",
123
+ ne = "ne",
124
+ no = "no",
125
+ nb = "nb",
126
+ nn = "nn",
127
+ ii = "ii",
128
+ oc = "oc",
129
+ oj = "oj",
130
+ or = "or",
131
+ om = "om",
132
+ os = "os",
133
+ pi = "pi",
134
+ ps = "ps",
135
+ fa = "fa",
136
+ pl = "pl",
137
+ pt = "pt",
138
+ pa = "pa",
139
+ qu = "qu",
140
+ ro = "ro",
141
+ rm = "rm",
142
+ rn = "rn",
143
+ ru = "ru",
144
+ se = "se",
145
+ sm = "sm",
146
+ sg = "sg",
147
+ sa = "sa",
148
+ sc = "sc",
149
+ sr = "sr",
150
+ sn = "sn",
151
+ sd = "sd",
152
+ si = "si",
153
+ sk = "sk",
154
+ sl = "sl",
155
+ so = "so",
156
+ st = "st",
157
+ es = "es",
158
+ su = "su",
159
+ sw = "sw",
160
+ ss = "ss",
161
+ sv = "sv",
162
+ tl = "tl",
163
+ ty = "ty",
164
+ tg = "tg",
165
+ ta = "ta",
166
+ tt = "tt",
167
+ te = "te",
168
+ th = "th",
169
+ bo = "bo",
170
+ ti = "ti",
171
+ to = "to",
172
+ ts = "ts",
173
+ tn = "tn",
174
+ tr = "tr",
175
+ tk = "tk",
176
+ tw = "tw",
177
+ ug = "ug",
178
+ uk = "uk",
179
+ ur = "ur",
180
+ uz = "uz",
181
+ ve = "ve",
182
+ vi = "vi",
183
+ vo = "vo",
184
+ wa = "wa",
185
+ cy = "cy",
186
+ wo = "wo",
187
+ xh = "xh",
188
+ yi = "yi",
189
+ yo = "yo",
190
+ za = "za",
191
+ zu = "zu",
192
+ xx = "xx"
193
+ }
194
+ export type ISO639_1 = (typeof ISO639_1_VALUES)[keyof typeof ISO639_1_VALUES];
195
+ export declare const ISO639_1_VALUES_ARRAY: ISO639_1[];
@@ -1,3 +1,199 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ISO639_1_VALUES_ARRAY = exports.ISO639_1_VALUES = void 0;
4
+ /**
5
+ * ISO 639-1 language codes
6
+ *
7
+ * Undetermined language is represented by 'xx'
8
+ *
9
+ * @see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
10
+ */
11
+ var ISO639_1_VALUES;
12
+ (function (ISO639_1_VALUES) {
13
+ ISO639_1_VALUES["ab"] = "ab";
14
+ ISO639_1_VALUES["aa"] = "aa";
15
+ ISO639_1_VALUES["af"] = "af";
16
+ ISO639_1_VALUES["ak"] = "ak";
17
+ ISO639_1_VALUES["sq"] = "sq";
18
+ ISO639_1_VALUES["am"] = "am";
19
+ ISO639_1_VALUES["ar"] = "ar";
20
+ ISO639_1_VALUES["an"] = "an";
21
+ ISO639_1_VALUES["hy"] = "hy";
22
+ ISO639_1_VALUES["av"] = "av";
23
+ ISO639_1_VALUES["ae"] = "ae";
24
+ ISO639_1_VALUES["ay"] = "ay";
25
+ ISO639_1_VALUES["az"] = "az";
26
+ ISO639_1_VALUES["as"] = "as";
27
+ ISO639_1_VALUES["bm"] = "bm";
28
+ ISO639_1_VALUES["ba"] = "ba";
29
+ ISO639_1_VALUES["eu"] = "eu";
30
+ ISO639_1_VALUES["be"] = "be";
31
+ ISO639_1_VALUES["bn"] = "bn";
32
+ ISO639_1_VALUES["bi"] = "bi";
33
+ ISO639_1_VALUES["bs"] = "bs";
34
+ ISO639_1_VALUES["br"] = "br";
35
+ ISO639_1_VALUES["bg"] = "bg";
36
+ ISO639_1_VALUES["my"] = "my";
37
+ ISO639_1_VALUES["ca"] = "ca";
38
+ ISO639_1_VALUES["ch"] = "ch";
39
+ ISO639_1_VALUES["ce"] = "ce";
40
+ ISO639_1_VALUES["ny"] = "ny";
41
+ ISO639_1_VALUES["zh"] = "zh";
42
+ ISO639_1_VALUES["cu"] = "cu";
43
+ ISO639_1_VALUES["cv"] = "cv";
44
+ ISO639_1_VALUES["kw"] = "kw";
45
+ ISO639_1_VALUES["co"] = "co";
46
+ ISO639_1_VALUES["cr"] = "cr";
47
+ ISO639_1_VALUES["hr"] = "hr";
48
+ ISO639_1_VALUES["cs"] = "cs";
49
+ ISO639_1_VALUES["da"] = "da";
50
+ ISO639_1_VALUES["dv"] = "dv";
51
+ ISO639_1_VALUES["nl"] = "nl";
52
+ ISO639_1_VALUES["dz"] = "dz";
53
+ ISO639_1_VALUES["en"] = "en";
54
+ ISO639_1_VALUES["eo"] = "eo";
55
+ ISO639_1_VALUES["et"] = "et";
56
+ ISO639_1_VALUES["ee"] = "ee";
57
+ ISO639_1_VALUES["fo"] = "fo";
58
+ ISO639_1_VALUES["fj"] = "fj";
59
+ ISO639_1_VALUES["fi"] = "fi";
60
+ ISO639_1_VALUES["fr"] = "fr";
61
+ ISO639_1_VALUES["fy"] = "fy";
62
+ ISO639_1_VALUES["ff"] = "ff";
63
+ ISO639_1_VALUES["gd"] = "gd";
64
+ ISO639_1_VALUES["gl"] = "gl";
65
+ ISO639_1_VALUES["lg"] = "lg";
66
+ ISO639_1_VALUES["ka"] = "ka";
67
+ ISO639_1_VALUES["de"] = "de";
68
+ ISO639_1_VALUES["el"] = "el";
69
+ ISO639_1_VALUES["kl"] = "kl";
70
+ ISO639_1_VALUES["gn"] = "gn";
71
+ ISO639_1_VALUES["gu"] = "gu";
72
+ ISO639_1_VALUES["ht"] = "ht";
73
+ ISO639_1_VALUES["ha"] = "ha";
74
+ ISO639_1_VALUES["he"] = "he";
75
+ ISO639_1_VALUES["hz"] = "hz";
76
+ ISO639_1_VALUES["hi"] = "hi";
77
+ ISO639_1_VALUES["ho"] = "ho";
78
+ ISO639_1_VALUES["hu"] = "hu";
79
+ ISO639_1_VALUES["is"] = "is";
80
+ ISO639_1_VALUES["io"] = "io";
81
+ ISO639_1_VALUES["ig"] = "ig";
82
+ ISO639_1_VALUES["id"] = "id";
83
+ ISO639_1_VALUES["ia"] = "ia";
84
+ ISO639_1_VALUES["ie"] = "ie";
85
+ ISO639_1_VALUES["iu"] = "iu";
86
+ ISO639_1_VALUES["ik"] = "ik";
87
+ ISO639_1_VALUES["ga"] = "ga";
88
+ ISO639_1_VALUES["it"] = "it";
89
+ ISO639_1_VALUES["ja"] = "ja";
90
+ ISO639_1_VALUES["jv"] = "jv";
91
+ ISO639_1_VALUES["kn"] = "kn";
92
+ ISO639_1_VALUES["kr"] = "kr";
93
+ ISO639_1_VALUES["ks"] = "ks";
94
+ ISO639_1_VALUES["kk"] = "kk";
95
+ ISO639_1_VALUES["km"] = "km";
96
+ ISO639_1_VALUES["ki"] = "ki";
97
+ ISO639_1_VALUES["rw"] = "rw";
98
+ ISO639_1_VALUES["ky"] = "ky";
99
+ ISO639_1_VALUES["kv"] = "kv";
100
+ ISO639_1_VALUES["kg"] = "kg";
101
+ ISO639_1_VALUES["ko"] = "ko";
102
+ ISO639_1_VALUES["kj"] = "kj";
103
+ ISO639_1_VALUES["ku"] = "ku";
104
+ ISO639_1_VALUES["lo"] = "lo";
105
+ ISO639_1_VALUES["la"] = "la";
106
+ ISO639_1_VALUES["lv"] = "lv";
107
+ ISO639_1_VALUES["li"] = "li";
108
+ ISO639_1_VALUES["ln"] = "ln";
109
+ ISO639_1_VALUES["lt"] = "lt";
110
+ ISO639_1_VALUES["lu"] = "lu";
111
+ ISO639_1_VALUES["lb"] = "lb";
112
+ ISO639_1_VALUES["mk"] = "mk";
113
+ ISO639_1_VALUES["mg"] = "mg";
114
+ ISO639_1_VALUES["ms"] = "ms";
115
+ ISO639_1_VALUES["ml"] = "ml";
116
+ ISO639_1_VALUES["mt"] = "mt";
117
+ ISO639_1_VALUES["gv"] = "gv";
118
+ ISO639_1_VALUES["mi"] = "mi";
119
+ ISO639_1_VALUES["mr"] = "mr";
120
+ ISO639_1_VALUES["mh"] = "mh";
121
+ ISO639_1_VALUES["mn"] = "mn";
122
+ ISO639_1_VALUES["na"] = "na";
123
+ ISO639_1_VALUES["nv"] = "nv";
124
+ ISO639_1_VALUES["nd"] = "nd";
125
+ ISO639_1_VALUES["nr"] = "nr";
126
+ ISO639_1_VALUES["ng"] = "ng";
127
+ ISO639_1_VALUES["ne"] = "ne";
128
+ ISO639_1_VALUES["no"] = "no";
129
+ ISO639_1_VALUES["nb"] = "nb";
130
+ ISO639_1_VALUES["nn"] = "nn";
131
+ ISO639_1_VALUES["ii"] = "ii";
132
+ ISO639_1_VALUES["oc"] = "oc";
133
+ ISO639_1_VALUES["oj"] = "oj";
134
+ ISO639_1_VALUES["or"] = "or";
135
+ ISO639_1_VALUES["om"] = "om";
136
+ ISO639_1_VALUES["os"] = "os";
137
+ ISO639_1_VALUES["pi"] = "pi";
138
+ ISO639_1_VALUES["ps"] = "ps";
139
+ ISO639_1_VALUES["fa"] = "fa";
140
+ ISO639_1_VALUES["pl"] = "pl";
141
+ ISO639_1_VALUES["pt"] = "pt";
142
+ ISO639_1_VALUES["pa"] = "pa";
143
+ ISO639_1_VALUES["qu"] = "qu";
144
+ ISO639_1_VALUES["ro"] = "ro";
145
+ ISO639_1_VALUES["rm"] = "rm";
146
+ ISO639_1_VALUES["rn"] = "rn";
147
+ ISO639_1_VALUES["ru"] = "ru";
148
+ ISO639_1_VALUES["se"] = "se";
149
+ ISO639_1_VALUES["sm"] = "sm";
150
+ ISO639_1_VALUES["sg"] = "sg";
151
+ ISO639_1_VALUES["sa"] = "sa";
152
+ ISO639_1_VALUES["sc"] = "sc";
153
+ ISO639_1_VALUES["sr"] = "sr";
154
+ ISO639_1_VALUES["sn"] = "sn";
155
+ ISO639_1_VALUES["sd"] = "sd";
156
+ ISO639_1_VALUES["si"] = "si";
157
+ ISO639_1_VALUES["sk"] = "sk";
158
+ ISO639_1_VALUES["sl"] = "sl";
159
+ ISO639_1_VALUES["so"] = "so";
160
+ ISO639_1_VALUES["st"] = "st";
161
+ ISO639_1_VALUES["es"] = "es";
162
+ ISO639_1_VALUES["su"] = "su";
163
+ ISO639_1_VALUES["sw"] = "sw";
164
+ ISO639_1_VALUES["ss"] = "ss";
165
+ ISO639_1_VALUES["sv"] = "sv";
166
+ ISO639_1_VALUES["tl"] = "tl";
167
+ ISO639_1_VALUES["ty"] = "ty";
168
+ ISO639_1_VALUES["tg"] = "tg";
169
+ ISO639_1_VALUES["ta"] = "ta";
170
+ ISO639_1_VALUES["tt"] = "tt";
171
+ ISO639_1_VALUES["te"] = "te";
172
+ ISO639_1_VALUES["th"] = "th";
173
+ ISO639_1_VALUES["bo"] = "bo";
174
+ ISO639_1_VALUES["ti"] = "ti";
175
+ ISO639_1_VALUES["to"] = "to";
176
+ ISO639_1_VALUES["ts"] = "ts";
177
+ ISO639_1_VALUES["tn"] = "tn";
178
+ ISO639_1_VALUES["tr"] = "tr";
179
+ ISO639_1_VALUES["tk"] = "tk";
180
+ ISO639_1_VALUES["tw"] = "tw";
181
+ ISO639_1_VALUES["ug"] = "ug";
182
+ ISO639_1_VALUES["uk"] = "uk";
183
+ ISO639_1_VALUES["ur"] = "ur";
184
+ ISO639_1_VALUES["uz"] = "uz";
185
+ ISO639_1_VALUES["ve"] = "ve";
186
+ ISO639_1_VALUES["vi"] = "vi";
187
+ ISO639_1_VALUES["vo"] = "vo";
188
+ ISO639_1_VALUES["wa"] = "wa";
189
+ ISO639_1_VALUES["cy"] = "cy";
190
+ ISO639_1_VALUES["wo"] = "wo";
191
+ ISO639_1_VALUES["xh"] = "xh";
192
+ ISO639_1_VALUES["yi"] = "yi";
193
+ ISO639_1_VALUES["yo"] = "yo";
194
+ ISO639_1_VALUES["za"] = "za";
195
+ ISO639_1_VALUES["zu"] = "zu";
196
+ ISO639_1_VALUES["xx"] = "xx";
197
+ })(ISO639_1_VALUES || (exports.ISO639_1_VALUES = ISO639_1_VALUES = {}));
198
+ exports.ISO639_1_VALUES_ARRAY = Object.values(ISO639_1_VALUES);
3
199
  //# sourceMappingURL=ISO639_1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISO639_1.js","sourceRoot":"","sources":["../../../icc-api/model/ISO639_1.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * ISO 639-1 language codes\n *\n * Undetermined language is represented by 'xx'\n *\n * @see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\n */\nexport type ISO639_1 =\n | 'ab'\n | 'aa'\n | 'af'\n | 'ak'\n | 'sq'\n | 'am'\n | 'ar'\n | 'an'\n | 'hy'\n | 'av'\n | 'ae'\n | 'ay'\n | 'az'\n | 'as'\n | 'bm'\n | 'ba'\n | 'eu'\n | 'be'\n | 'bn'\n | 'bi'\n | 'bs'\n | 'br'\n | 'bg'\n | 'my'\n | 'ca'\n | 'ch'\n | 'ce'\n | 'ny'\n | 'zh'\n | 'cu'\n | 'cv'\n | 'kw'\n | 'co'\n | 'cr'\n | 'hr'\n | 'cs'\n | 'da'\n | 'dv'\n | 'nl'\n | 'dz'\n | 'en'\n | 'eo'\n | 'et'\n | 'ee'\n | 'fo'\n | 'fj'\n | 'fi'\n | 'fr'\n | 'fy'\n | 'ff'\n | 'gd'\n | 'gl'\n | 'lg'\n | 'ka'\n | 'de'\n | 'el'\n | 'kl'\n | 'gn'\n | 'gu'\n | 'ht'\n | 'ha'\n | 'he'\n | 'hz'\n | 'hi'\n | 'ho'\n | 'hu'\n | 'is'\n | 'io'\n | 'ig'\n | 'id'\n | 'ia'\n | 'ie'\n | 'iu'\n | 'ik'\n | 'ga'\n | 'it'\n | 'ja'\n | 'jv'\n | 'kn'\n | 'kr'\n | 'ks'\n | 'kk'\n | 'km'\n | 'ki'\n | 'rw'\n | 'ky'\n | 'kv'\n | 'kg'\n | 'ko'\n | 'kj'\n | 'ku'\n | 'lo'\n | 'la'\n | 'lv'\n | 'li'\n | 'ln'\n | 'lt'\n | 'lu'\n | 'lb'\n | 'mk'\n | 'mg'\n | 'ms'\n | 'ml'\n | 'mt'\n | 'gv'\n | 'mi'\n | 'mr'\n | 'mh'\n | 'mn'\n | 'na'\n | 'nv'\n | 'nd'\n | 'nr'\n | 'ng'\n | 'ne'\n | 'no'\n | 'nb'\n | 'nn'\n | 'ii'\n | 'oc'\n | 'oj'\n | 'or'\n | 'om'\n | 'os'\n | 'pi'\n | 'ps'\n | 'fa'\n | 'pl'\n | 'pt'\n | 'pa'\n | 'qu'\n | 'ro'\n | 'rm'\n | 'rn'\n | 'ru'\n | 'se'\n | 'sm'\n | 'sg'\n | 'sa'\n | 'sc'\n | 'sr'\n | 'sn'\n | 'sd'\n | 'si'\n | 'sk'\n | 'sl'\n | 'so'\n | 'st'\n | 'es'\n | 'su'\n | 'sw'\n | 'ss'\n | 'sv'\n | 'tl'\n | 'ty'\n | 'tg'\n | 'ta'\n | 'tt'\n | 'te'\n | 'th'\n | 'bo'\n | 'ti'\n | 'to'\n | 'ts'\n | 'tn'\n | 'tr'\n | 'tk'\n | 'tw'\n | 'ug'\n | 'uk'\n | 'ur'\n | 'uz'\n | 've'\n | 'vi'\n | 'vo'\n | 'wa'\n | 'cy'\n | 'wo'\n | 'xh'\n | 'yi'\n | 'yo'\n | 'za'\n | 'zu'\n | 'xx' // When undetermined\n"]}
1
+ {"version":3,"file":"ISO639_1.js","sourceRoot":"","sources":["../../../icc-api/model/ISO639_1.ts"],"names":[],"mappings":";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4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;AACX,CAAC,EAzLW,eAAe,+BAAf,eAAe,QAyL1B;AAIY,QAAA,qBAAqB,GAAe,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA","sourcesContent":["/**\n * ISO 639-1 language codes\n *\n * Undetermined language is represented by 'xx'\n *\n * @see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\n */\nexport enum ISO639_1_VALUES {\n ab = 'ab',\n aa = 'aa',\n af = 'af',\n ak = 'ak',\n sq = 'sq',\n am = 'am',\n ar = 'ar',\n an = 'an',\n hy = 'hy',\n av = 'av',\n ae = 'ae',\n ay = 'ay',\n az = 'az',\n as = 'as',\n bm = 'bm',\n ba = 'ba',\n eu = 'eu',\n be = 'be',\n bn = 'bn',\n bi = 'bi',\n bs = 'bs',\n br = 'br',\n bg = 'bg',\n my = 'my',\n ca = 'ca',\n ch = 'ch',\n ce = 'ce',\n ny = 'ny',\n zh = 'zh',\n cu = 'cu',\n cv = 'cv',\n kw = 'kw',\n co = 'co',\n cr = 'cr',\n hr = 'hr',\n cs = 'cs',\n da = 'da',\n dv = 'dv',\n nl = 'nl',\n dz = 'dz',\n en = 'en',\n eo = 'eo',\n et = 'et',\n ee = 'ee',\n fo = 'fo',\n fj = 'fj',\n fi = 'fi',\n fr = 'fr',\n fy = 'fy',\n ff = 'ff',\n gd = 'gd',\n gl = 'gl',\n lg = 'lg',\n ka = 'ka',\n de = 'de',\n el = 'el',\n kl = 'kl',\n gn = 'gn',\n gu = 'gu',\n ht = 'ht',\n ha = 'ha',\n he = 'he',\n hz = 'hz',\n hi = 'hi',\n ho = 'ho',\n hu = 'hu',\n is = 'is',\n io = 'io',\n ig = 'ig',\n id = 'id',\n ia = 'ia',\n ie = 'ie',\n iu = 'iu',\n ik = 'ik',\n ga = 'ga',\n it = 'it',\n ja = 'ja',\n jv = 'jv',\n kn = 'kn',\n kr = 'kr',\n ks = 'ks',\n kk = 'kk',\n km = 'km',\n ki = 'ki',\n rw = 'rw',\n ky = 'ky',\n kv = 'kv',\n kg = 'kg',\n ko = 'ko',\n kj = 'kj',\n ku = 'ku',\n lo = 'lo',\n la = 'la',\n lv = 'lv',\n li = 'li',\n ln = 'ln',\n lt = 'lt',\n lu = 'lu',\n lb = 'lb',\n mk = 'mk',\n mg = 'mg',\n ms = 'ms',\n ml = 'ml',\n mt = 'mt',\n gv = 'gv',\n mi = 'mi',\n mr = 'mr',\n mh = 'mh',\n mn = 'mn',\n na = 'na',\n nv = 'nv',\n nd = 'nd',\n nr = 'nr',\n ng = 'ng',\n ne = 'ne',\n no = 'no',\n nb = 'nb',\n nn = 'nn',\n ii = 'ii',\n oc = 'oc',\n oj = 'oj',\n or = 'or',\n om = 'om',\n os = 'os',\n pi = 'pi',\n ps = 'ps',\n fa = 'fa',\n pl = 'pl',\n pt = 'pt',\n pa = 'pa',\n qu = 'qu',\n ro = 'ro',\n rm = 'rm',\n rn = 'rn',\n ru = 'ru',\n se = 'se',\n sm = 'sm',\n sg = 'sg',\n sa = 'sa',\n sc = 'sc',\n sr = 'sr',\n sn = 'sn',\n sd = 'sd',\n si = 'si',\n sk = 'sk',\n sl = 'sl',\n so = 'so',\n st = 'st',\n es = 'es',\n su = 'su',\n sw = 'sw',\n ss = 'ss',\n sv = 'sv',\n tl = 'tl',\n ty = 'ty',\n tg = 'tg',\n ta = 'ta',\n tt = 'tt',\n te = 'te',\n th = 'th',\n bo = 'bo',\n ti = 'ti',\n to = 'to',\n ts = 'ts',\n tn = 'tn',\n tr = 'tr',\n tk = 'tk',\n tw = 'tw',\n ug = 'ug',\n uk = 'uk',\n ur = 'ur',\n uz = 'uz',\n ve = 've',\n vi = 'vi',\n vo = 'vo',\n wa = 'wa',\n cy = 'cy',\n wo = 'wo',\n xh = 'xh',\n yi = 'yi',\n yo = 'yo',\n za = 'za',\n zu = 'zu',\n xx = 'xx', // When undetermined\n}\n\nexport type ISO639_1 = (typeof ISO639_1_VALUES)[keyof typeof ISO639_1_VALUES]\n\nexport const ISO639_1_VALUES_ARRAY: ISO639_1[] = Object.values(ISO639_1_VALUES)\n"]}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Service = void 0;
4
4
  const Content_1 = require("./Content");
5
+ const ISO639_1_1 = require("./ISO639_1");
5
6
  /**
6
7
  * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record
7
8
  */
@@ -9,7 +10,15 @@ class Service {
9
10
  constructor(json) {
10
11
  Object.assign(this, json);
11
12
  if (!!this.content) {
12
- this.content = Object.fromEntries(Object.entries(this.content).map(([key, value]) => [key, new Content_1.Content(value)]));
13
+ const uppercasedIso639_1 = ISO639_1_1.ISO639_1_VALUES_ARRAY.map((e) => e.toUpperCase());
14
+ this.content = Object.fromEntries(Object.entries(this.content).map(([key, value]) => {
15
+ const isUppercasedIso = uppercasedIso639_1.includes(key);
16
+ let contentKey = key;
17
+ if (isUppercasedIso) {
18
+ contentKey = key.toLowerCase();
19
+ }
20
+ return [contentKey, new Content_1.Content(value)];
21
+ }));
13
22
  }
14
23
  }
15
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../icc-api/model/Service.ts"],"names":[],"mappings":";;;AAaA,uCAAmC;AAKnC;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,CACL,CAAA;QAED,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC9E,CAAA;QACH,CAAC;IACH,CAAC;CAoIF;AAhJD,0BAgJC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { Annotation } from './Annotation'\nimport { CodeStub } from './CodeStub'\nimport { Content } from './Content'\nimport { Delegation } from './Delegation'\nimport { Identifier } from './Identifier'\nimport { SecurityMetadata } from './SecurityMetadata'\n\n/**\n * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record\n */\nexport class Service {\n constructor(json: JSON | any) {\n Object.assign(\n this as Service,\n json\n )\n\n if (!!this.content) {\n this.content = Object.fromEntries(\n Object.entries(this.content).map(([key, value]) => [key, new Content(value)])\n )\n }\n }\n\n /**\n * The Id of the Service. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The transactionId is used when a single service had to be split into parts for technical reasons. Several services with the same non null transaction id form one single service\n */\n transactionId?: string\n identifier?: Array<Identifier>\n /**\n * Id of the contact during which the service is provided\n */\n contactId?: string\n /**\n * List of IDs of all sub-contacts that link the service to structural elements. Only used when the Service is emitted outside of its contact\n */\n subContactIds?: Array<string>\n /**\n * List of IDs of all plans of actions (healthcare approaches) as a part of which the Service is provided. Only used when the Service is emitted outside of its contact\n */\n plansOfActionIds?: Array<string>\n /**\n * List of IDs of all healthcare elements for which the service is provided. Only used when the Service is emitted outside of its contact\n */\n healthElementsIds?: Array<string>\n /**\n * List of Ids of all forms linked to the Service. Only used when the Service is emitted outside of its contact.\n */\n formIds?: Array<string>\n /**\n * The secret patient key, encrypted in the patient document, in clear here.\n */\n secretForeignKeys?: Array<string>\n /**\n * The public patient key, encrypted here for separate Crypto Actors.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * The delegations giving access to connected healthcare information.\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * The contact secret encryption key used to encrypt the secured properties (like services for example), encrypted for separate Crypto Actors.\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * Description / Unambiguous qualification (LOINC code) of the type of information contained in the service. Could be a code to qualify temperature, complaint, diagnostic, ...\n */\n label?: string\n dataClassName?: string\n /**\n * Used for sorting services inside an upper object (A contact, a transaction, a FHIR bundle, ...)\n */\n index?: number\n /**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\n content?: { [key: string]: Content }\n encryptedContent?: string\n textIndexes?: { [key: string]: string }\n /**\n * The date (YYYYMMDDhhmmss) when the Service is noted to have started and also closes on the same date\n */\n valueDate?: number\n /**\n * The date (YYYYMMDDhhmmss) of the start of the Service\n */\n openingDate?: number\n /**\n * The date (YYYYMMDDhhmmss) marking the end of the Service\n */\n closingDate?: number\n /**\n * Id of the form used during the Service\n */\n formId?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The date (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Text, comments on the Service provided\n */\n comment?: string\n status?: number\n /**\n * List of invoicing codes\n */\n invoicingCodes?: Array<string>\n /**\n * Comments - Notes recorded by a HCP about this service\n */\n notes?: Array<Annotation>\n /**\n * Links towards related services (possibly in other contacts)\n */\n qualifiedLinks?: { [key: string]: { [key: string]: string } }\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n securityMetadata?: SecurityMetadata\n}\n"]}
1
+ {"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../icc-api/model/Service.ts"],"names":[],"mappings":";;;AAaA,uCAAmC;AAInC,yCAAgD;AAEhD;;GAEG;AACH,MAAa,OAAO;IAClB,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CACX,IAAe,EACf,IAAI,CACL,CAAA;QAED,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,kBAAkB,GAAG,gCAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;YAC5E,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CACZ,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACjC,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;gBAExD,IAAI,UAAU,GAAG,GAAG,CAAA;gBACpB,IAAI,eAAe,EAAE,CAAC;oBACpB,UAAU,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;gBAChC,CAAC;gBAED,OAAO,CAAC,UAAU,EAAE,IAAI,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAA;YACzC,CAAC,CACF,CACF,CAAA;QACH,CAAC;IACH,CAAC;CAoIF;AA5JD,0BA4JC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { Annotation } from './Annotation'\nimport { CodeStub } from './CodeStub'\nimport { Content } from './Content'\nimport { Delegation } from './Delegation'\nimport { Identifier } from './Identifier'\nimport { SecurityMetadata } from './SecurityMetadata'\nimport {ISO639_1_VALUES_ARRAY} from \"./ISO639_1\"\n\n/**\n * This entity represents a Service. A Service is created in the course a contact. Services include subjective information provided by the patient, such as complaints, reason for visit, feelings, etc. or objective information like bio-metric measures (blood pressure, temperature, heart beat, etc.), or physical exam description, diagnosis, prescription, integration of lab reports from another healthcare party, action plan, etc. Any action performed by the healthcare party which is relevant for the healthcare element of a patient is considered a service. The services can be linked to healthcare elements or other structuring elements of the medical record\n */\nexport class Service {\n constructor(json: JSON | any) {\n Object.assign(\n this as Service,\n json\n )\n\n if (!!this.content) {\n const uppercasedIso639_1 = ISO639_1_VALUES_ARRAY.map((e) => e.toUpperCase())\n this.content = Object.fromEntries(\n Object.entries(\n this.content).map(([key, value]) => {\n const isUppercasedIso = uppercasedIso639_1.includes(key)\n\n let contentKey = key\n if (isUppercasedIso) {\n contentKey = key.toLowerCase()\n }\n\n return [contentKey, new Content(value)]\n }\n )\n )\n }\n }\n\n /**\n * The Id of the Service. We encourage using either a v4 UUID or a HL7 Id.\n */\n id?: string\n /**\n * The transactionId is used when a single service had to be split into parts for technical reasons. Several services with the same non null transaction id form one single service\n */\n transactionId?: string\n identifier?: Array<Identifier>\n /**\n * Id of the contact during which the service is provided\n */\n contactId?: string\n /**\n * List of IDs of all sub-contacts that link the service to structural elements. Only used when the Service is emitted outside of its contact\n */\n subContactIds?: Array<string>\n /**\n * List of IDs of all plans of actions (healthcare approaches) as a part of which the Service is provided. Only used when the Service is emitted outside of its contact\n */\n plansOfActionIds?: Array<string>\n /**\n * List of IDs of all healthcare elements for which the service is provided. Only used when the Service is emitted outside of its contact\n */\n healthElementsIds?: Array<string>\n /**\n * List of Ids of all forms linked to the Service. Only used when the Service is emitted outside of its contact.\n */\n formIds?: Array<string>\n /**\n * The secret patient key, encrypted in the patient document, in clear here.\n */\n secretForeignKeys?: Array<string>\n /**\n * The public patient key, encrypted here for separate Crypto Actors.\n */\n cryptedForeignKeys?: { [key: string]: Array<Delegation> }\n /**\n * The delegations giving access to connected healthcare information.\n */\n delegations?: { [key: string]: Array<Delegation> }\n /**\n * The contact secret encryption key used to encrypt the secured properties (like services for example), encrypted for separate Crypto Actors.\n */\n encryptionKeys?: { [key: string]: Array<Delegation> }\n /**\n * Description / Unambiguous qualification (LOINC code) of the type of information contained in the service. Could be a code to qualify temperature, complaint, diagnostic, ...\n */\n label?: string\n dataClassName?: string\n /**\n * Used for sorting services inside an upper object (A contact, a transaction, a FHIR bundle, ...)\n */\n index?: number\n /**\n * Information contained in the service. Content is localized, using ISO language code as key\n */\n content?: { [key: string]: Content }\n encryptedContent?: string\n textIndexes?: { [key: string]: string }\n /**\n * The date (YYYYMMDDhhmmss) when the Service is noted to have started and also closes on the same date\n */\n valueDate?: number\n /**\n * The date (YYYYMMDDhhmmss) of the start of the Service\n */\n openingDate?: number\n /**\n * The date (YYYYMMDDhhmmss) marking the end of the Service\n */\n closingDate?: number\n /**\n * Id of the form used during the Service\n */\n formId?: string\n /**\n * The timestamp (unix epoch in ms) of creation of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n created?: number\n /**\n * The date (unix epoch in ms) of the latest modification of this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n modified?: number\n /**\n * Soft delete (unix epoch in ms) timestamp of the object.\n */\n endOfLife?: number\n /**\n * The id of the User that has created this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n author?: string\n /**\n * The id of the HealthcareParty that is responsible for this entity, will be filled automatically if missing. Not enforced by the application server.\n */\n responsible?: string\n /**\n * The id of the medical location where this entity was created.\n */\n medicalLocationId?: string\n /**\n * Text, comments on the Service provided\n */\n comment?: string\n status?: number\n /**\n * List of invoicing codes\n */\n invoicingCodes?: Array<string>\n /**\n * Comments - Notes recorded by a HCP about this service\n */\n notes?: Array<Annotation>\n /**\n * Links towards related services (possibly in other contacts)\n */\n qualifiedLinks?: { [key: string]: { [key: string]: string } }\n /**\n * A code is an item from a codification system that qualifies the content of this entity. SNOMED-CT, ICPC-2 or ICD-10 codifications systems can be used for codes\n */\n codes?: Array<CodeStub>\n /**\n * A tag is an item from a codification system that qualifies an entity as being member of a certain class, whatever the value it might have taken. If the tag qualifies the content of a field, it means that whatever the content of the field, the tag will always apply. For example, the label of a field is qualified using a tag. LOINC is a codification system typically used for tags.\n */\n tags?: Array<CodeStub>\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n securityMetadata?: SecurityMetadata\n}\n"]}
@@ -454,7 +454,7 @@ class IccContactXApi extends icc_api_1.IccContactApi {
454
454
  if (!e) {
455
455
  return null;
456
456
  }
457
- return e[lng] || e.fr || e.en || e.nl;
457
+ return e[lng] || e.fr || e.FR || e.en || e.EN || e.nl || e.NL;
458
458
  }
459
459
  /**
460
460
  * Modifies the subcontacts this svc belongs to while minimizing the number of references to the svcs inside the subcontacts
@@ -1 +1 @@
1
- {"version":3,"file":"icc-contact-x-api.js","sourceRoot":"","sources":["../../icc-x-api/icc-contact-x-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsD;AAGtD,sDAAsC;AAEtC,iCAAgC;AAChC,4BAA2B;AAC3B,kDAAiD;AACjD,oDAAyF;AAEzF,uDAA+C;AAC/C,qEAAiE;AAEjE,mCASgB;AAChB,0EAAgG;AAChG,wEAAoE;AAQpE,4DAAwE;AACxE,IAAO,eAAe,GAAG,mCAAgB,CAAC,eAAe,CAAA;AAEzD,kEAA8D;AAE9D,MAAa,cAAe,SAAQ,uBAAa;IAM/C,IAAI,OAAO;QACT,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,I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,EAC5B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,EACZ,oCAA4B,CAAC,OAAO,EACpC,UAAU,EACV,MAAM,EACN,UAAU,EACV,OAAO,EACP,CAAO,SAAkB,EAAE,EAAE,gDAAC,OAAA,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAkB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,GAAA,CACnG,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,2BAAc,CAAC,EAAE,CAAC,CAAC,CAAA;QACxC,CAAC;KAAA;IAED,uCAAuC,CAAC,MAAe,EAAE,SAAmB;QAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,iCAAiC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oCAA4B,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAA;IACpJ,CAAC;CACF;AArmCD,wCAqmCC","sourcesContent":["import { IccAuthApi, IccContactApi } from '../icc-api'\nimport { IccCryptoXApi } from './icc-crypto-x-api'\n\nimport i18n from './rsrc/contact.i18n'\n\nimport * as moment from 'moment'\nimport * as _ from 'lodash'\nimport * as models from '../icc-api/model/models'\nimport { Contact, FilterChainService, ListOfIds, Service } from '../icc-api/model/models'\nimport { PaginatedListContact } from '../icc-api/model/PaginatedListContact'\nimport { utf8_2ua } from './utils/binary-utils'\nimport { ServiceByIdsFilter } from './filters/ServiceByIdsFilter'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport {\n before,\n decryptObject,\n EncryptedFieldsManifest,\n encryptObject,\n EntityWithDelegationTypeName,\n parseEncryptedFields,\n subscribeToEntityEvents,\n SubscriptionOptions,\n} from './utils'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport { XHR } from '../icc-api/api/XHR'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AbstractFilter } from './filters/filters'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { SecretIdUseOption } from './crypto/SecretIdUseOption'\n\nexport class IccContactXApi extends IccContactApi implements EncryptedEntityXApi<models.Contact> {\n i18n: any = i18n\n private readonly contactEncryptedFields: EncryptedFieldsManifest\n private readonly serviceEncryptedFieldsNoContent: EncryptedFieldsManifest | undefined\n private readonly serviceEncryptedFieldsWithContent: EncryptedFieldsManifest\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Contact))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly userApi: IccUserXApi,\n private readonly authApi: IccAuthApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n contactEncryptedKeys: string[] = ['descr'],\n serviceEncryptedKeys: string[] = []\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n if (contactEncryptedKeys.some((key) => key.startsWith('services'))) {\n throw new Error(\"You can't customise encryption of the `services` field of Contact. Use the serviceEncryptedKeys parameter instead.\")\n }\n if (serviceEncryptedKeys.some((key) => key.startsWith('content'))) {\n throw new Error(\"You can't customise encryption of the `content` of a Service. The content values for services is automatically encrypted.\")\n }\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n this.userApi = userApi\n this.authApi = authApi\n this.contactEncryptedFields = parseEncryptedFields(contactEncryptedKeys, 'Contact.')\n const customServiceEncryptedFields = parseEncryptedFields(serviceEncryptedKeys, 'Service.')\n if (serviceEncryptedKeys.length > 0) {\n this.serviceEncryptedFieldsNoContent = customServiceEncryptedFields\n }\n this.serviceEncryptedFieldsWithContent = {\n ...customServiceEncryptedFields,\n topLevelFields: [...customServiceEncryptedFields.topLevelFields, { fieldName: 'content', fieldPath: 'Service.content' }],\n }\n }\n\n /**\n * Creates a new instance of contact with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param patient the patient this contact refers to.\n * @param c initialised data for the contact. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify other\n * kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - sfkOption: specifies which sfk of the owning entity to use.\n * - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of contact.\n */\n async newInstance(\n user: models.User,\n patient: models.Patient,\n c: any,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n sfkOption?: SecretIdUseOption\n ignoreAutoDelegations?: boolean // default is considered false\n alternateRootDelegation?: string\n } = {}\n ): Promise<models.Contact> {\n const contact = new models.Contact({\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Contact',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n groupId: c?.groupId ?? this.crypto.primitives.randomUuid(),\n subContacts: c?.subContacts ?? [],\n services: c?.services ?? [],\n openingDate: c?.openingDate ?? parseInt(moment().format('YYYYMMDDHHmmss')),\n })\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = await this.crypto.xapi.resolveSecretIdUseOptions(\n { entity: patient, type: EntityWithDelegationTypeName.Patient },\n options.sfkOption ?? SecretIdUseOption.UseAnySharedWithParent\n )\n const extraDelegations = {\n ...(options.ignoreAutoDelegations == true\n ? {}\n : Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n )),\n ...(options?.additionalDelegates ?? {}),\n }\n const initialisationInfo = await this.crypto.xapi.entityWithInitialisedEncryptedMetadata(\n contact,\n EntityWithDelegationTypeName.Contact,\n patient.id,\n sfk,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n return new models.Contact(initialisationInfo.updatedEntity)\n }\n\n /**\n * 1. Check whether there is a delegation with 'hcpartyId' or not.\n * 2. 'fetchHcParty[hcpartyId][1]': is encrypted AES exchange key by RSA public key of him.\n * 3. Obtain the AES exchange key, by decrypting the previous step value with hcparty private key\n * 3.1. KeyPair should be fetch from cache (in jwk)\n * 3.2. if it doesn't exist in the cache, it has to be loaded from Browser Local store, and then import it to WebCrypto\n * 4. Obtain the array of delegations which are delegated to his ID (hcpartyId) in this patient\n * 5. Decrypt and collect all keys (secretForeignKeys) within delegations of previous step (with obtained AES key of step 4)\n * 6. Do the REST call to get all contacts with (allSecretForeignKeysDelimitedByComa, hcpartyId)\n *\n * After these painful steps, you have the contacts of the patient.\n *\n * @deprecated use {@link findIdsBy} instead.\n * @param hcpartyId\n * @param patient (Promise)\n * @param usingPost\n */\n async findBy(hcpartyId: string, patient: models.Patient, usingPost: boolean = false) {\n return await this.crypto.xapi.secretIdsForHcpHierarchyOf({ entity: patient, type: EntityWithDelegationTypeName.Patient }).then((keysHierarchy) =>\n keysHierarchy && keysHierarchy.length > 0\n ? Promise.all(\n keysHierarchy\n .reduce((acc, level) => {\n return acc.concat([\n {\n hcpartyId: level.ownerId,\n extractedKeys: level.extracted.filter((key) => !acc.some((previousLevel) => previousLevel.extractedKeys.includes(key))),\n },\n ])\n }, [] as Array<{ hcpartyId: string; extractedKeys: Array<string> }>)\n .filter((l) => l.extractedKeys.length > 0)\n .map(({ hcpartyId, extractedKeys }) =>\n usingPost\n ? this.findByHCPartyPatientSecretFKeysArray(hcpartyId, _.uniq(extractedKeys))\n : this.findByHCPartyPatientSecretFKeys(hcpartyId, _.uniq(extractedKeys).join(','))\n )\n ).then((results) => _.uniqBy(_.flatMap(results), (x) => x.id))\n : Promise.resolve([])\n )\n }\n\n /**\n * Same as {@link findIdsBy} but it will only return the ids of the contacts. It can also filter the contacts where Contact.openingDate is between\n * startDate and endDate in ascending or descending order by that field. (default: ascending).\n */\n async findIdsBy(hcpartyId: string, patient: models.Patient, startDate?: number, endDate?: number, descending?: boolean) {\n return await this.crypto.xapi.secretIdsForHcpHierarchyOf({ entity: patient, type: EntityWithDelegationTypeName.Patient }).then((keysHierarchy) =>\n keysHierarchy && keysHierarchy.length > 0\n ? Promise.all(\n keysHierarchy\n .reduce((acc, level) => {\n return acc.concat([\n {\n hcpartyId: level.ownerId,\n extractedKeys: level.extracted.filter((key) => !acc.some((previousLevel) => previousLevel.extractedKeys.includes(key))),\n },\n ])\n }, [] as Array<{ hcpartyId: string; extractedKeys: Array<string> }>)\n .filter((l) => l.extractedKeys.length > 0)\n .map(({ hcpartyId, extractedKeys }) =>\n this.findContactIdsByDataOwnerPatientOpeningDate(hcpartyId, extractedKeys, startDate, endDate, descending)\n )\n ).then((results) => _.uniq(_.flatMap(results)))\n : Promise.resolve([])\n )\n }\n\n /**\n * @deprecated Unused method, bugged: won't work if `hcpartyId` is not the parent hcp and doesn't decrypt contacts.\n * Will be permanently removed in version 8.2.0\n */\n async findByPatientSFKs(hcpartyId: string, patients: Array<models.Patient>): Promise<Array<models.Contact>> {\n const perHcpId: { [key: string]: string[] } = {}\n for (const patient of patients) {\n ;(await this.crypto.xapi.secretIdsForHcpHierarchyOf({ entity: patient, type: EntityWithDelegationTypeName.Patient }))\n .reduce((acc, level) => {\n return acc.concat([\n {\n hcpartyId: level.ownerId,\n extractedKeys: level.extracted.filter((key) => !acc.some((previousLevel) => previousLevel.extractedKeys.includes(key))),\n },\n ])\n }, [] as Array<{ hcpartyId: string; extractedKeys: Array<string> }>)\n .filter((l) => l.extractedKeys.length > 0)\n .forEach(({ hcpartyId, extractedKeys }) => {\n ;(perHcpId[hcpartyId] || (perHcpId[hcpartyId] = [])).push(...extractedKeys)\n })\n }\n\n return _.uniqBy(\n _.flatMap(\n await Promise.all(\n Object.keys(perHcpId).map((hcpId) =>\n this.findContactsByHCPartyPatientForeignKeys(\n hcpartyId,\n new models.ListOfIds({\n ids: perHcpId[hcpId],\n })\n )\n )\n )\n ),\n (x) => x.id\n )\n }\n\n filterBy(startKey?: string, startDocumentId?: string, limit?: number, body?: models.FilterChainContact): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n listContactsByOpeningDate(\n startDate: number,\n endDate: number,\n hcpartyid: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n listServices(body?: ListOfIds): Promise<Array<Service>> {\n throw new Error('Cannot call a method that returns services without providing a user for de/encryption')\n }\n\n findByHCPartyFormId(hcPartyId?: string, formId?: string): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n findByHCPartyFormIds(hcPartyId?: string, body?: models.ListOfIds): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n getContact(contactId: string): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n getContacts(body?: models.ListOfIds): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n modifyContact(body?: Contact): never {\n throw new Error('Cannot call a method that modify contacts without providing a user for de/encryption')\n }\n\n modifyContacts(body?: Array<Contact>): never {\n throw new Error('Cannot call a method that modify contacts without providing a user for de/encryption')\n }\n\n createContact(body?: Contact): never {\n throw new Error('Cannot call a method that modify contacts without providing a user for de/encryption')\n }\n\n /**\n * @deprecated use {@link findContactIdsByDataOwnerPatientOpeningDate} instead.\n */\n findByHCPartyPatientSecretFKeys(\n hcPartyId: string,\n secretFKeys: string,\n planOfActionIds?: string,\n skipClosedContacts?: boolean\n ): Promise<Array<models.Contact>> {\n return super\n .findByHCPartyPatientSecretFKeys(hcPartyId, secretFKeys, planOfActionIds, skipClosedContacts)\n .then((contacts) => this.decrypt(hcPartyId, contacts))\n }\n\n /**\n * @deprecated use {@link findContactIdsByDataOwnerPatientOpeningDate} instead.\n */\n findByHCPartyPatientSecretFKeysArray(\n hcPartyId: string,\n secretFKeys: string[],\n planOfActionIds?: string,\n skipClosedContacts?: boolean\n ): Promise<Array<models.Contact> | any> {\n return super\n .findByHCPartyPatientSecretFKeysUsingPost(hcPartyId, planOfActionIds, skipClosedContacts, secretFKeys)\n .then((contacts) => this.decrypt(hcPartyId, contacts))\n }\n\n filterByWithUser(\n user: models.User,\n startDocumentId?: string,\n limit?: number,\n body?: models.FilterChainContact\n ): Promise<PaginatedListContact | any> {\n return super\n .filterContactsBy(startDocumentId, limit, body)\n .then((ctcs) =>\n this.decrypt(user.healthcarePartyId! || user.patientId!, ctcs.rows!).then((decryptedRows) => Object.assign(ctcs, { rows: decryptedRows }))\n )\n }\n\n listContactsByOpeningDateWithUser(\n user: models.User,\n startDate: number,\n endDate: number,\n hcpartyid: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListContact | any> {\n return super\n .listContactsByOpeningDate(startDate, endDate, hcpartyid, startKey, startDocumentId, limit)\n .then((ctcs) =>\n this.decrypt(user.healthcarePartyId! || user.patientId!, ctcs.rows!).then((decryptedRows) => Object.assign(ctcs, { rows: decryptedRows }))\n )\n }\n\n getServiceWithUser(user: models.User, serviceId: string): Promise<Service> {\n return super\n .getService(serviceId)\n .then((service) => this.decryptServices(user.healthcarePartyId ?? user.patientId ?? user.deviceId!, [service]))\n .then((decrypted) => decrypted[0])\n }\n\n listServicesWithUser(user: models.User, serviceIds: ListOfIds): Promise<Array<Service> | any> {\n return super\n .filterServicesBy(undefined, serviceIds.ids?.length, new FilterChainService({ filter: new ServiceByIdsFilter({ ids: serviceIds.ids }) }))\n .then((paginatedList) => this.decryptServices(user.healthcarePartyId ?? user.patientId ?? user.deviceId!, paginatedList.rows ?? []))\n }\n\n findByHCPartyFormIdWithUser(user: models.User, hcPartyId: string, formId: string): Promise<Array<models.Contact> | any> {\n return super.findByHCPartyFormId(hcPartyId, formId).then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n }\n\n findByHCPartyFormIdsWithUser(user: models.User, hcPartyId: string, body: models.ListOfIds): Promise<Array<models.Contact> | any> {\n return super.findByHCPartyFormIds(hcPartyId, body).then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n }\n\n getContactWithUser(user: models.User, contactId: string): Promise<models.Contact> {\n return super\n .getContact(contactId)\n .then((ctc) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, [ctc]))\n .then((ctcs) => ctcs[0])\n }\n\n getContactsWithUser(user: models.User, body?: models.ListOfIds): Promise<Array<models.Contact> | any> {\n return super.getContacts(body).then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n }\n\n async modifyContactWithUser(user: models.User, body?: models.Contact): Promise<models.Contact | any> {\n return body ? this.modifyContactAs(this.dataOwnerApi.getDataOwnerIdOf(user)!, body) : null\n }\n\n private modifyContactAs(dataOwner: string, body: models.Contact): Promise<models.Contact> {\n return this.encryptAs(dataOwner, [_.cloneDeep(body)])\n .then((ctcs) => super.modifyContact(ctcs[0]))\n .then((ctc) => this.decrypt(dataOwner, [ctc]))\n .then((ctcs) => ctcs[0])\n }\n\n async modifyContactsWithUser(user: models.User, bodies?: Array<models.Contact>): Promise<models.Contact[] | any> {\n return bodies\n ? this.encrypt(\n user,\n bodies.map((c) => _.cloneDeep(c))\n )\n .then((ctcs) => super.modifyContacts(ctcs))\n .then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n : null\n }\n\n async createContactWithUser(user: models.User, body?: models.Contact): Promise<models.Contact | null> {\n return body\n ? this.encrypt(user, [_.cloneDeep(body)])\n .then((ctcs) => super.createContact(ctcs[0]))\n .then((ctc) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, [ctc]))\n .then((ctcs) => ctcs[0])\n : null\n }\n\n async createContactsWithUser(user: models.User, bodies?: Array<models.Contact>): Promise<models.Contact[] | null> {\n return bodies\n ? this.encrypt(\n user,\n bodies.map((c) => _.cloneDeep(c))\n )\n .then((ctcs) => super.createContacts(ctcs))\n .then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n : null\n }\n\n encryptServices(key: CryptoKey, rawKey: string, services: Service[]): PromiseLike<Service[]> {\n return Promise.all(\n services.map(async (svc) => {\n if (\n svc.content &&\n Object.values(svc.content).every(\n (c) =>\n c.compoundValue &&\n !c.stringValue &&\n !c.documentId &&\n !c.measureValue &&\n !c.medicationValue &&\n (c.booleanValue === null || c.booleanValue === undefined) &&\n (c.numberValue === null || c.numberValue === undefined) &&\n !c.instantValue &&\n !c.fuzzyDateValue &&\n !c.binaryValue\n )\n ) {\n const recursivelyEncryptedContent = Object.fromEntries(\n await Promise.all(\n Object.entries(svc.content).map(async (p) => {\n if (p[1].compoundValue?.length) {\n return [p[0], { ...p[1], compoundValue: await this.encryptServices(key, rawKey, p[1].compoundValue!) }]\n } else return p\n })\n )\n )\n const copyWithEncryptedContent = { ...svc, content: recursivelyEncryptedContent }\n return this.serviceEncryptedFieldsNoContent\n ? encryptObject(\n copyWithEncryptedContent,\n (obj) => {\n return this.crypto.primitives.AES.encrypt(key, utf8_2ua(JSON.stringify(obj)), rawKey)\n },\n this.serviceEncryptedFieldsNoContent,\n 'service'\n )\n : copyWithEncryptedContent\n } else {\n return encryptObject(\n svc,\n (obj) => {\n return this.crypto.primitives.AES.encrypt(key, utf8_2ua(JSON.stringify(obj)), rawKey)\n },\n this.serviceEncryptedFieldsWithContent,\n 'service'\n )\n }\n })\n )\n }\n\n encrypt(user: models.User, ctcs: Array<models.Contact>) {\n return this.encryptAs(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs)\n }\n\n private async encryptAs(hcpartyId: string, ctcs: Array<models.Contact>): Promise<models.Contact[]> {\n const initializedContacts: models.Contact[] = []\n for (const ctc of ctcs) {\n initializedContacts.push((await this.crypto.xapi.ensureEncryptionKeysInitialised(ctc, EntityWithDelegationTypeName.Contact)) ?? ctc)\n }\n const allEncrypted = await this.crypto.xapi.doManyIncrementallyDecryptingKeys(\n initializedContacts,\n EntityWithDelegationTypeName.Contact,\n async (entity, t, keys) => {\n for (const k of keys) {\n try {\n const encrypted = new Contact(\n await encryptObject(\n {\n ...entity,\n services: entity.services ? await this.encryptServices(k.key, k.raw, entity.services) : [],\n },\n (obj) => {\n return this.crypto.primitives.AES.encrypt(k.key, utf8_2ua(JSON.stringify(obj)), k.raw)\n },\n this.contactEncryptedFields,\n EntityWithDelegationTypeName.Contact\n )\n )\n return { success: encrypted }\n } catch (e) {\n console.warn(`Failed to encrypt contact ${entity.id} with key ${k.raw}`)\n }\n }\n return null\n }\n )\n if (ctcs.length != allEncrypted.size) {\n throw new Error(`Couldn't encrypt contacts ${ctcs.flatMap((e) => (allEncrypted.has(e.id!) ? [] : [e.id!]))}`)\n }\n return ctcs.map((e) => allEncrypted.get(e.id!)!)\n }\n\n async decrypt(hcpartyId: string, ctcs: Array<models.Contact>): Promise<Array<models.Contact>> {\n return (await this.crypto.xapi.tryDecryptEntities(ctcs, EntityWithDelegationTypeName.Contact, (x) => new Contact(x))).map(({ entity }) => entity)\n }\n\n async decryptServices(hcpartyId: string, svcs: Array<models.Service>): Promise<Array<models.Service>> {\n /*TODO\n * not super efficient, re-decrypts the encryption key metadata of services multiple times, but should mostly rely\n * on cached exchange data after the first decryption and should not do any extra requests to the db.\n * We could ensure to use only cached exchange data by doing limited-size batches of services from the same contact\n * id.\n */\n return (await this.crypto.xapi.tryDecryptEntities(svcs, EntityWithDelegationTypeName.Contact, (x) => new Service(x))).map(({ entity }) => entity)\n }\n\n contactOfService(ctcs: Array<models.Contact>, svcId: string): models.Contact | undefined {\n let latestContact: models.Contact | undefined = undefined\n let latestService: models.Service\n ctcs.forEach((c) => {\n const s: models.Service | undefined = c.services!.find((it) => svcId === it.id)\n if (s && (!latestService || moment(s.valueDate).isAfter(moment(latestService.valueDate)))) {\n latestContact = c\n latestService = s\n }\n })\n return latestContact\n }\n\n filteredServices(ctcs: Array<models.Contact>, filter: any): Array<models.Service> {\n const byIds: { [key: string]: models.Service } = {}\n ctcs.forEach((c) =>\n (c.services || [])\n .filter((s) => filter(s, c))\n .forEach((s) => {\n const ps = byIds[s.id!]\n if (!ps || !ps.modified || (s.modified && ps.modified < s.modified)) {\n byIds[s.id!] = s\n s.contactId = c.id\n }\n })\n )\n return _.values(byIds).filter((s: any) => !s.deleted && !s.endOfLife)\n }\n\n //Return a promise\n filterServices(ctcs: Array<models.Contact>, filter: any): Promise<Array<models.Service>> {\n return Promise.resolve(this.filteredServices(ctcs, filter))\n }\n\n services(ctc: models.Contact, label: string) {\n return ctc.services!.filter((s) => s.label === label)\n }\n\n preferredContent(svc: models.Service, lng: string) {\n return (\n svc && svc.content && (svc.content[lng] || svc.content['fr'] || (Object.keys(svc.content)[0] ? svc.content[Object.keys(svc.content)[0]] : null))\n )\n }\n\n contentValue(c: models.Content) {\n return (\n c.stringValue ||\n ((c.numberValue || c.numberValue === 0) && c.numberValue) ||\n (c.measureValue && (c.measureValue.value || c.measureValue.value === 0) ? c.measureValue : null) ||\n c.medicationValue ||\n c.booleanValue\n )\n }\n\n shortServiceDescription(svc: models.Service, lng: string) {\n const c = this.preferredContent(svc, lng)\n return !c ? '' : this.shortContentDescription(c, lng, svc.label)\n }\n\n shortContentDescription(c: models.Content, lng: string, label?: string) {\n return (\n c.stringValue ||\n ((c.numberValue || c.numberValue === 0) && c.numberValue) ||\n (c.measureValue &&\n '' +\n (c.measureValue.value || c.measureValue.value === 0 ? c.measureValue.value : '-') +\n (c.measureValue.unit ? ' ' + c.measureValue.unit : '')) ||\n (c.medicationValue ? this.medication().medicationToString(c.medicationValue, lng) : null) ||\n (c.booleanValue && label) ||\n 'OK'\n )\n }\n\n medicationValue(svc: models.Service, lng: string) {\n const c =\n svc && svc.content && (svc.content[lng] || svc.content['fr'] || (Object.keys(svc.content)[0] ? svc.content[Object.keys(svc.content)[0]] : null))\n return c && c.medicationValue\n }\n\n contentHasData(c: any): boolean {\n return c.stringValue || c.numberValue || c.measureValue || c.booleanValue || c.booleanValue === false || c.medicationValue || c.documentId\n }\n\n localize(e: any, lng: string) {\n if (!e) {\n return null\n }\n return e[lng] || e.fr || e.en || e.nl\n }\n\n /**\n * Modifies the subcontacts this svc belongs to while minimizing the number of references to the svcs inside the subcontacts\n * After the invocation, there is at least one subcontact with provided poaId and heId that contains the svc\n * The svc is not removed from a previous subcontact it would belong to except if the new conditions are compatible\n * Note that undefined and null do not have the same meaning for formId\n * If formId is null: the subcontact which refers svc must have a null formId\n * If formId is undefined, the subcontact can have any value for formId\n *\n * When a svc does not exist yet in the current contact but exists in a previous contact, all the scs it was belonging to are\n * copied in the current contact\n *\n * the svc returned is the one that's inside the ctc\n *\n * @param ctc\n * @param user\n * @param ctcs\n * @param svc\n * @param formId\n * @param poaId aMap {heId2: [poaId11, poaId12], heId2: [poaId21] }\n * @param heId an Array of heIds, equivalent to poaIds = {heId: [], ...}\n * @param init\n * @returns {*}\n */\n\n promoteServiceInContact(\n ctc: models.Contact,\n user: models.User,\n ctcs: Array<models.Contact>,\n svc: models.Service,\n formId: string,\n poaIds?: { [key: string]: string[] },\n heIds?: Array<string>,\n init?: any\n ) {\n if (!ctc) {\n return null\n }\n const existing = ctc.services!.find((s) => s.id === svc.id)\n const promoted = _.extend(_.extend(existing || {}, svc), {\n author: user.id,\n responsible: this.dataOwnerApi.getDataOwnerIdOf(user),\n modified: new Date().getTime(),\n })\n if (!existing) {\n ;(ctc.services || (ctc.services = [])).push(promoted)\n }\n const allSubcontactsInCurrentContactContainingService = (ctc.subContacts || []).filter((csc) =>\n (csc.services || []).some((s) => s.serviceId === svc.id)\n )\n\n //Rearrange poaIds and heIds as a hierarchy\n const hierarchyOfHeAndPoaIds: { [key: string]: Array<any> } = {}\n ;(heIds || []).forEach((id) => (hierarchyOfHeAndPoaIds[id || '_'] = []))\n Object.keys(poaIds || {}).forEach((k: string) => {\n const poas = hierarchyOfHeAndPoaIds[k]\n if (poas) {\n hierarchyOfHeAndPoaIds[k] = _.concat(poas, (poaIds || {})[k])\n } else {\n hierarchyOfHeAndPoaIds[k] = (poaIds || {})[k]\n }\n })\n\n const pastCtc =\n (svc.contactId && svc.contactId !== ctc.id && ctcs.find((c) => c.id === svc.contactId)) ||\n ctcs.reduce(\n (selected: { s: models.Service | null; c: models.Contact | null }, c: models.Contact) => {\n const candidate = (c.services || []).find((s) => s.id === svc.id)\n return ctc.id !== c.id && candidate && (selected.s === null || before(selected.s.modified || 0, candidate.modified || 0))\n ? { s: candidate, c: c }\n : selected\n },\n { s: null, c: null }\n ).c\n //Make sure that all scs the svc was belonging to are copied inside the current contact\n pastCtc &&\n pastCtc\n .subContacts!.filter((psc) => psc.services!.some((s) => s.serviceId === svc.id))\n .forEach((psc) => {\n const sameInCurrent = allSubcontactsInCurrentContactContainingService.find(\n (csc) => csc.formId === psc.formId && csc.planOfActionId === psc.planOfActionId && csc.healthElementId === psc.healthElementId\n )\n if (sameInCurrent) {\n if (!sameInCurrent.services!.some((s) => s.serviceId === svc.id)) {\n sameInCurrent.services!.push({ serviceId: svc.id })\n }\n } else {\n const newSubContact = _.assign(_.assign({}, psc), {\n services: [{ serviceId: svc.id }],\n })\n ctc.subContacts!.push(newSubContact)\n allSubcontactsInCurrentContactContainingService.push(newSubContact)\n }\n })\n\n if (!Object.keys(hierarchyOfHeAndPoaIds).length) {\n hierarchyOfHeAndPoaIds._ = [] //Default is to have at least one option with heId equals to null (represented by _)\n }\n\n Object.keys(hierarchyOfHeAndPoaIds).forEach((heId: string | null) => {\n if (heId === '_') {\n heId = null\n }\n const subPoaIds = heId ? hierarchyOfHeAndPoaIds[heId] : []\n ;((subPoaIds || []).length ? subPoaIds : [null]).forEach((poaId) => {\n //Create or assign subcontacts for all pairs he/poa (can be null/null)\n let destinationSubcontact = ctc.subContacts!.find(\n (sc) =>\n (!formId || sc.formId === formId) &&\n ((!poaId && !sc.planOfActionId) || sc.planOfActionId === poaId) &&\n ((!heId && !sc.healthElementId) || sc.healthElementId === heId)\n )\n if (!destinationSubcontact) {\n ctc.subContacts!.push(\n (destinationSubcontact = new models.SubContact({\n formId: formId || undefined,\n planOfActionId: poaId,\n healthElementId: heId,\n services: [],\n }))\n )\n }\n\n const redundantSubcontact =\n allSubcontactsInCurrentContactContainingService.find((aSc) => destinationSubcontact === aSc) ||\n allSubcontactsInCurrentContactContainingService.find(\n (aSc) =>\n (!aSc.planOfActionId || aSc.planOfActionId === destinationSubcontact!.planOfActionId) &&\n (!aSc.healthElementId || aSc.healthElementId === destinationSubcontact!.healthElementId) &&\n (!aSc.formId || aSc.formId === destinationSubcontact!.formId)\n ) // Find a compatible sc: one that does not contain extra and ≠ information than the destination\n\n if (redundantSubcontact && redundantSubcontact !== destinationSubcontact) {\n redundantSubcontact.services!.splice(\n redundantSubcontact.services!.findIndex((link) => link.serviceId === svc.id),\n 1\n )\n }\n if (!destinationSubcontact.services!.some((s) => s.serviceId === svc.id)) {\n destinationSubcontact.services!.push({ serviceId: svc.id! })\n }\n })\n })\n\n return (init && init(promoted)) || promoted\n }\n\n isNumeric(svc: models.Service, lng: string) {\n const c = this.preferredContent(svc, lng)\n return c && (c.measureValue || c.numberValue || c.numberValue == 0)\n }\n\n service() {\n return {\n newInstance: (user: models.User, s: any) =>\n _.extend(\n {\n id: this.crypto.primitives.randomUuid(),\n _type: 'org.taktik.icure.entities.embed.Service',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: s?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: s?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: [],\n tags: [],\n content: {},\n valueDate: parseInt(moment().format('YYYYMMDDHHmmss')),\n },\n s\n ),\n }\n }\n\n medication() {\n const regimenScores: any = {\n afterwakingup: 63000,\n beforebreakfast: 70000,\n duringbreakfast: 80000,\n afterbreakfast: 90000,\n morning: 100000,\n betweenbreakfastandlunch: 103000,\n beforelunch: 113000,\n midday: 120000,\n duringlunch: 123000,\n afterlunch: 130000,\n afternoon: 140000,\n betweenlunchanddinner: 160000,\n beforedinner: 180000,\n duringdinner: 190000,\n afterdinner: 200000,\n evening: 210000,\n betweendinnerandsleep: 213000,\n thehourofsleep: 220000,\n night: 230000,\n beforemeals: -30000,\n betweenmeals: -20000,\n aftermeals: -10000,\n }\n\n const myself = {\n regimenScores: function () {\n return regimenScores\n },\n medicationNameToString: function (m: any): string {\n return m && m.compoundPrescription\n ? m.compoundPrescription\n : m && m.substanceProduct\n ? myself.productToString(m && m.substanceProduct)\n : myself.productToString(m && m.medicinalProduct)\n },\n reimbursementReasonToString: (m: any, lang: string) => {\n return m && m.reimbursementReason && m.reimbursementReason.label && m.reimbursementReason.label.hasOwnProperty(lang)\n ? m.reimbursementReason.label[lang]\n : ''\n },\n medicationToString: (m: any, lang: string) => {\n let res = `${myself.medicationNameToString(m)}, ${myself.posologyToString(m, lang)}`\n const reason = myself.reimbursementReasonToString(m, lang)\n res = m.numberOfPackages\n ? `${m.numberOfPackages} ${m.numberOfPackages > 1 ? this.i18n[lang].packagesOf : this.i18n[lang].packageOf} ${res}`\n : res\n res = m.duration ? `${res} ${this.i18n[lang].during} ${myself.durationToString(m.duration, lang)}` : res\n res = reason ? `${res} (${reason})` : res\n return res\n },\n productToString: (m: any): string => {\n if (!m) {\n return ''\n }\n return m.intendedname\n },\n posologyToString: (m: any, lang: string) => {\n if (m) {\n if (m.instructionForPatient && m.instructionForPatient.length) {\n return m.instructionForPatient\n }\n if (!m.regimen || !m.regimen.length) {\n return ''\n }\n\n const unit =\n m.regimen[0].administratedQuantity && m.regimen[0].administratedQuantity.administrationUnit\n ? m.regimen[0].administratedQuantity.administrationUnit.code\n : m.regimen[0].administratedQuantity && m.regimen[0].administratedQuantity.unit\n let quantity = m.regimen[0].administratedQuantity && m.regimen[0].administratedQuantity.quantity\n\n m.regimen.slice(1).find((ri: any) => {\n const oUnit =\n ri.administratedQuantity && ri.administratedQuantity.administrationUnit\n ? ri.administratedQuantity.administrationUnit.code\n : ri.administratedQuantity && ri.administratedQuantity.unit\n const oQuantity = ri.administratedQuantity && ri.administratedQuantity.quantity\n\n if (oQuantity !== quantity) {\n quantity = -1\n }\n return oUnit !== unit && oQuantity !== quantity\n })\n\n const cplxRegimen = !unit || quantity < 0\n const quantityUnit = cplxRegimen ? `1 ${this.i18n[lang].take_s_}` : `${quantity} ${unit || this.i18n[lang].take_s_}`\n\n const dayPeriod = m.regimen.find((r: any) => r.weekday !== null && r.weekday !== undefined)\n ? this.i18n[lang].weekly\n : m.regimen.find((r: any) => r.date)\n ? this.i18n[lang].monthly\n : this.i18n[lang].daily\n\n return `${quantityUnit}, ${m.regimen.length} x ${dayPeriod}, ${_.sortBy(\n m.regimen,\n (r) =>\n (r.date ? r.date * 1000000 : 29990000000000) +\n (r.dayNumber || 0) * 1000000 +\n ((r.weekday && r.weekday.weekNumber) || 0) * 7 * 1000000 +\n (r.timeOfDay ? r.timeOfDay : r.dayPeriod && r.dayPeriod.code ? (regimenScores[r.dayPeriod.code] as number) : 0)\n )\n .map((r) => (cplxRegimen ? myself.regimenToExtString(r, lang) : myself.regimenToString(r, lang)))\n .join(', ')}`\n }\n },\n frequencyToString: (m: any, lang: string) => {\n if (m.instructionForPatient && m.instructionForPatient.length) {\n return m.instructionForPatient\n }\n if (!m.regimen || !m.regimen.length) {\n return ''\n }\n\n const dayPeriod = m.regimen.find((r: any) => r.weekday !== null && r.weekday !== undefined)\n ? this.i18n[lang].weekly\n : m.regimen.find((r: any) => r.date)\n ? this.i18n[lang].monthly\n : this.i18n[lang].daily\n\n return `${m.regimen.length} x ${dayPeriod}`\n },\n durationToString: (d: models.Duration, lang: string) => {\n return d.value ? `${d.value} ${this.localize(d.unit!.label, lang)}` : ''\n },\n regimenToExtString: (r: models.RegimenItem, lang: string) => {\n const desc = myself.regimenToString(r, lang)\n return (\n (r.administratedQuantity && r.administratedQuantity.quantity && desc\n ? `${desc} (${r.administratedQuantity.quantity} ${\n (r.administratedQuantity.administrationUnit ? r.administratedQuantity.administrationUnit.code : r.administratedQuantity.unit) ||\n this.i18n[lang].take_s_\n })`\n : desc) || ''\n )\n },\n regimenToString: (r: models.RegimenItem, lang: string) => {\n let res = r.date\n ? `${this.i18n[lang].the} ${moment(r.date).format('DD/MM/YYYY')}`\n : r.dayNumber\n ? `${this.i18n[lang].onDay} ${r.dayNumber}`\n : r.weekday && r.weekday.weekday\n ? `${this.i18n[lang].on} ${r.weekday.weekday}`\n : null\n if (r.dayPeriod && r.dayPeriod.code && r.dayPeriod.code.length) {\n res = res\n ? `${res} ${this.i18n[lang][r.dayPeriod.code] || this.localize(r.dayPeriod.label, lang) || r.dayPeriod.code}`\n : this.i18n[lang][r.dayPeriod.code] || this.localize(r.dayPeriod.label, lang) || r.dayPeriod.code\n }\n if (r.timeOfDay) {\n const timeOfDay =\n r.timeOfDay === 120000\n ? this.i18n[lang].noon\n : `${Math.floor(r.timeOfDay / 10000)}:${('' + (Math.floor(r.timeOfDay / 100) % 100)).replace(/^(.)$/, '0$1')}`\n res = res ? res + ' ' + this.i18n[lang].at + ' ' + timeOfDay : timeOfDay\n }\n return res\n },\n localize: (s: any, lang: string) => {\n if (!s) {\n return s\n }\n return (\n this.i18n[lang][s] ||\n (this.i18n[lang][s.toLowerCase()] &&\n this.i18n[lang][s.toLowerCase()]\n .split('')\n .map((c: string, idx: number) => (idx >= s.length || s[idx].toLocaleLowerCase() === s[idx] ? c : c.toLocaleUpperCase()))\n .join('')) ||\n s\n ) //Applies the (lower/upper)case to the translated lowercase version of the input string (s)\n },\n }\n return myself\n }\n\n /**\n * @param contact a contact\n * @return the id of the patient that the contact refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptPatientIdOf(contact: models.Contact): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: contact, type: EntityWithDelegationTypeName.Contact }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given contact\n */\n async hasWriteAccess(contact: models.Contact): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: contact, type: EntityWithDelegationTypeName.Contact })\n }\n\n /**\n * Share an existing contact with other data owners, allowing them to access the non-encrypted data of the contact and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the contact.\n * @param contact the contact to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * contact does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this contact refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n contact: models.Contact,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Contact> {\n return this.shareWithMany(contact, { [delegateId]: options })\n }\n\n /**\n * Share an existing contact with other data owners, allowing them to access the non-encrypted data of the contact and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param contact the contact to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * contact does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this contact refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWithMany(\n contact: models.Contact,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Contact> {\n return (await this.tryShareWithMany(contact, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing contact with other data owners, allowing them to access the non-encrypted data of the contact and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param contact the contact to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * contact does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this contact refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n contact: models.Contact,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Contact>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(contact, EntityWithDelegationTypeName.Contact)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyContactAs(self, entityWithEncryptionKey) : contact\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Contact,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.sharePatientId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareContacts(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Contact\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Contact })\n }\n\n getEncryptionKeysOf(entity: models.Contact): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Contact }, undefined)\n }\n\n async subscribeToServiceEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<Service> | undefined,\n eventFired: (dataSample: Service) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n const currentUser = await this.userApi.getCurrentUser()\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n 'Service',\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted: Service) => (await this.decryptServices(currentUser.healthcarePartyId!, [encrypted]))[0]\n ).then((ws) => new ConnectionImpl(ws))\n }\n\n async subscribeToContactEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<Contact> | undefined,\n eventFired: (dataSample: Contact) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n const currentUser = await this.userApi.getCurrentUser()\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n EntityWithDelegationTypeName.Contact,\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted: Contact) => (await this.decrypt(currentUser.healthcarePartyId!, [encrypted]))[0]\n ).then((ws) => new ConnectionImpl(ws))\n }\n\n createDelegationDeAnonymizationMetadata(entity: Contact, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: EntityWithDelegationTypeName.Contact }, delegates)\n }\n}\n"]}
1
+ {"version":3,"file":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\n\nimport i18n from './rsrc/contact.i18n'\n\nimport * as moment from 'moment'\nimport * as _ from 'lodash'\nimport * as models from '../icc-api/model/models'\nimport { Contact, FilterChainService, ListOfIds, Service } from '../icc-api/model/models'\nimport { PaginatedListContact } from '../icc-api/model/PaginatedListContact'\nimport { utf8_2ua } from './utils/binary-utils'\nimport { ServiceByIdsFilter } from './filters/ServiceByIdsFilter'\nimport { IccDataOwnerXApi } from './icc-data-owner-x-api'\nimport {\n before,\n decryptObject,\n EncryptedFieldsManifest,\n encryptObject,\n EntityWithDelegationTypeName,\n parseEncryptedFields,\n subscribeToEntityEvents,\n SubscriptionOptions,\n} from './utils'\nimport { AuthenticationProvider, NoAuthenticationProvider } from './auth/AuthenticationProvider'\nimport { SecureDelegation } from '../icc-api/model/SecureDelegation'\nimport { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour'\nimport { ShareResult } from './utils/ShareResult'\nimport { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest'\nimport { XHR } from '../icc-api/api/XHR'\nimport { IccUserXApi } from './icc-user-x-api'\nimport { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi'\nimport { AbstractFilter } from './filters/filters'\nimport { Connection, ConnectionImpl } from '../icc-api/model/Connection'\nimport AccessLevelEnum = SecureDelegation.AccessLevelEnum\nimport RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum\nimport { SecretIdUseOption } from './crypto/SecretIdUseOption'\n\nexport class IccContactXApi extends IccContactApi implements EncryptedEntityXApi<models.Contact> {\n i18n: any = i18n\n private readonly contactEncryptedFields: EncryptedFieldsManifest\n private readonly serviceEncryptedFieldsNoContent: EncryptedFieldsManifest | undefined\n private readonly serviceEncryptedFieldsWithContent: EncryptedFieldsManifest\n\n get headers(): Promise<Array<XHR.Header>> {\n return super.headers.then((h) => this.crypto.accessControlKeysHeaders.addAccessControlKeysHeaders(h, EntityWithDelegationTypeName.Contact))\n }\n\n constructor(\n host: string,\n headers: { [key: string]: string },\n private readonly crypto: IccCryptoXApi,\n private readonly dataOwnerApi: IccDataOwnerXApi,\n private readonly userApi: IccUserXApi,\n private readonly authApi: IccAuthApi,\n private readonly autofillAuthor: boolean,\n authenticationProvider: AuthenticationProvider = new NoAuthenticationProvider(),\n fetchImpl: (input: RequestInfo, init?: RequestInit) => Promise<Response> = typeof window !== 'undefined'\n ? window.fetch\n : typeof self !== 'undefined'\n ? self.fetch\n : fetch,\n contactEncryptedKeys: string[] = ['descr'],\n serviceEncryptedKeys: string[] = []\n ) {\n super(host, headers, authenticationProvider, fetchImpl)\n if (contactEncryptedKeys.some((key) => key.startsWith('services'))) {\n throw new Error(\"You can't customise encryption of the `services` field of Contact. Use the serviceEncryptedKeys parameter instead.\")\n }\n if (serviceEncryptedKeys.some((key) => key.startsWith('content'))) {\n throw new Error(\"You can't customise encryption of the `content` of a Service. The content values for services is automatically encrypted.\")\n }\n this.crypto = crypto\n this.dataOwnerApi = dataOwnerApi\n this.userApi = userApi\n this.authApi = authApi\n this.contactEncryptedFields = parseEncryptedFields(contactEncryptedKeys, 'Contact.')\n const customServiceEncryptedFields = parseEncryptedFields(serviceEncryptedKeys, 'Service.')\n if (serviceEncryptedKeys.length > 0) {\n this.serviceEncryptedFieldsNoContent = customServiceEncryptedFields\n }\n this.serviceEncryptedFieldsWithContent = {\n ...customServiceEncryptedFields,\n topLevelFields: [...customServiceEncryptedFields.topLevelFields, { fieldName: 'content', fieldPath: 'Service.content' }],\n }\n }\n\n /**\n * Creates a new instance of contact with initialised encryption metadata (not in the database).\n * @param user the current user.\n * @param patient the patient this contact refers to.\n * @param c initialised data for the contact. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify other\n * kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.\n * @param options optional parameters:\n * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the\n * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with\n * auto-delegations, in such case the access level specified here will be used.\n * - sfkOption: specifies which sfk of the owning entity to use.\n * - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates\n * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,\n * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.\n * @return a new instance of contact.\n */\n async newInstance(\n user: models.User,\n patient: models.Patient,\n c: any,\n options: {\n additionalDelegates?: { [dataOwnerId: string]: AccessLevelEnum }\n sfkOption?: SecretIdUseOption\n ignoreAutoDelegations?: boolean // default is considered false\n alternateRootDelegation?: string\n } = {}\n ): Promise<models.Contact> {\n const contact = new models.Contact({\n ...(c ?? {}),\n _type: 'org.taktik.icure.entities.Contact',\n id: c?.id ?? this.crypto.primitives.randomUuid(),\n created: c?.created ?? new Date().getTime(),\n modified: c?.modified ?? new Date().getTime(),\n responsible: c?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: c?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: c?.codes ?? [],\n tags: c?.tags ?? [],\n groupId: c?.groupId ?? this.crypto.primitives.randomUuid(),\n subContacts: c?.subContacts ?? [],\n services: c?.services ?? [],\n openingDate: c?.openingDate ?? parseInt(moment().format('YYYYMMDDHHmmss')),\n })\n\n const ownerId = this.dataOwnerApi.getDataOwnerIdOf(user)\n if (ownerId !== (await this.dataOwnerApi.getCurrentDataOwnerId())) throw new Error('Can only initialise entities as current data owner.')\n const sfk = await this.crypto.xapi.resolveSecretIdUseOptions(\n { entity: patient, type: EntityWithDelegationTypeName.Patient },\n options.sfkOption ?? SecretIdUseOption.UseAnySharedWithParent\n )\n const extraDelegations = {\n ...(options.ignoreAutoDelegations == true\n ? {}\n : Object.fromEntries(\n [...(user.autoDelegations?.all ?? []), ...(user.autoDelegations?.medicalInformation ?? [])].map((d) => [d, AccessLevelEnum.WRITE])\n )),\n ...(options?.additionalDelegates ?? {}),\n }\n const initialisationInfo = await this.crypto.xapi.entityWithInitialisedEncryptedMetadata(\n contact,\n EntityWithDelegationTypeName.Contact,\n patient.id,\n sfk,\n true,\n extraDelegations,\n options.alternateRootDelegation\n )\n return new models.Contact(initialisationInfo.updatedEntity)\n }\n\n /**\n * 1. Check whether there is a delegation with 'hcpartyId' or not.\n * 2. 'fetchHcParty[hcpartyId][1]': is encrypted AES exchange key by RSA public key of him.\n * 3. Obtain the AES exchange key, by decrypting the previous step value with hcparty private key\n * 3.1. KeyPair should be fetch from cache (in jwk)\n * 3.2. if it doesn't exist in the cache, it has to be loaded from Browser Local store, and then import it to WebCrypto\n * 4. Obtain the array of delegations which are delegated to his ID (hcpartyId) in this patient\n * 5. Decrypt and collect all keys (secretForeignKeys) within delegations of previous step (with obtained AES key of step 4)\n * 6. Do the REST call to get all contacts with (allSecretForeignKeysDelimitedByComa, hcpartyId)\n *\n * After these painful steps, you have the contacts of the patient.\n *\n * @deprecated use {@link findIdsBy} instead.\n * @param hcpartyId\n * @param patient (Promise)\n * @param usingPost\n */\n async findBy(hcpartyId: string, patient: models.Patient, usingPost: boolean = false) {\n return await this.crypto.xapi.secretIdsForHcpHierarchyOf({ entity: patient, type: EntityWithDelegationTypeName.Patient }).then((keysHierarchy) =>\n keysHierarchy && keysHierarchy.length > 0\n ? Promise.all(\n keysHierarchy\n .reduce((acc, level) => {\n return acc.concat([\n {\n hcpartyId: level.ownerId,\n extractedKeys: level.extracted.filter((key) => !acc.some((previousLevel) => previousLevel.extractedKeys.includes(key))),\n },\n ])\n }, [] as Array<{ hcpartyId: string; extractedKeys: Array<string> }>)\n .filter((l) => l.extractedKeys.length > 0)\n .map(({ hcpartyId, extractedKeys }) =>\n usingPost\n ? this.findByHCPartyPatientSecretFKeysArray(hcpartyId, _.uniq(extractedKeys))\n : this.findByHCPartyPatientSecretFKeys(hcpartyId, _.uniq(extractedKeys).join(','))\n )\n ).then((results) => _.uniqBy(_.flatMap(results), (x) => x.id))\n : Promise.resolve([])\n )\n }\n\n /**\n * Same as {@link findIdsBy} but it will only return the ids of the contacts. It can also filter the contacts where Contact.openingDate is between\n * startDate and endDate in ascending or descending order by that field. (default: ascending).\n */\n async findIdsBy(hcpartyId: string, patient: models.Patient, startDate?: number, endDate?: number, descending?: boolean) {\n return await this.crypto.xapi.secretIdsForHcpHierarchyOf({ entity: patient, type: EntityWithDelegationTypeName.Patient }).then((keysHierarchy) =>\n keysHierarchy && keysHierarchy.length > 0\n ? Promise.all(\n keysHierarchy\n .reduce((acc, level) => {\n return acc.concat([\n {\n hcpartyId: level.ownerId,\n extractedKeys: level.extracted.filter((key) => !acc.some((previousLevel) => previousLevel.extractedKeys.includes(key))),\n },\n ])\n }, [] as Array<{ hcpartyId: string; extractedKeys: Array<string> }>)\n .filter((l) => l.extractedKeys.length > 0)\n .map(({ hcpartyId, extractedKeys }) =>\n this.findContactIdsByDataOwnerPatientOpeningDate(hcpartyId, extractedKeys, startDate, endDate, descending)\n )\n ).then((results) => _.uniq(_.flatMap(results)))\n : Promise.resolve([])\n )\n }\n\n /**\n * @deprecated Unused method, bugged: won't work if `hcpartyId` is not the parent hcp and doesn't decrypt contacts.\n * Will be permanently removed in version 8.2.0\n */\n async findByPatientSFKs(hcpartyId: string, patients: Array<models.Patient>): Promise<Array<models.Contact>> {\n const perHcpId: { [key: string]: string[] } = {}\n for (const patient of patients) {\n ;(await this.crypto.xapi.secretIdsForHcpHierarchyOf({ entity: patient, type: EntityWithDelegationTypeName.Patient }))\n .reduce((acc, level) => {\n return acc.concat([\n {\n hcpartyId: level.ownerId,\n extractedKeys: level.extracted.filter((key) => !acc.some((previousLevel) => previousLevel.extractedKeys.includes(key))),\n },\n ])\n }, [] as Array<{ hcpartyId: string; extractedKeys: Array<string> }>)\n .filter((l) => l.extractedKeys.length > 0)\n .forEach(({ hcpartyId, extractedKeys }) => {\n ;(perHcpId[hcpartyId] || (perHcpId[hcpartyId] = [])).push(...extractedKeys)\n })\n }\n\n return _.uniqBy(\n _.flatMap(\n await Promise.all(\n Object.keys(perHcpId).map((hcpId) =>\n this.findContactsByHCPartyPatientForeignKeys(\n hcpartyId,\n new models.ListOfIds({\n ids: perHcpId[hcpId],\n })\n )\n )\n )\n ),\n (x) => x.id\n )\n }\n\n filterBy(startKey?: string, startDocumentId?: string, limit?: number, body?: models.FilterChainContact): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n listContactsByOpeningDate(\n startDate: number,\n endDate: number,\n hcpartyid: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n listServices(body?: ListOfIds): Promise<Array<Service>> {\n throw new Error('Cannot call a method that returns services without providing a user for de/encryption')\n }\n\n findByHCPartyFormId(hcPartyId?: string, formId?: string): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n findByHCPartyFormIds(hcPartyId?: string, body?: models.ListOfIds): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n getContact(contactId: string): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n getContacts(body?: models.ListOfIds): never {\n throw new Error('Cannot call a method that returns contacts without providing a user for de/encryption')\n }\n\n modifyContact(body?: Contact): never {\n throw new Error('Cannot call a method that modify contacts without providing a user for de/encryption')\n }\n\n modifyContacts(body?: Array<Contact>): never {\n throw new Error('Cannot call a method that modify contacts without providing a user for de/encryption')\n }\n\n createContact(body?: Contact): never {\n throw new Error('Cannot call a method that modify contacts without providing a user for de/encryption')\n }\n\n /**\n * @deprecated use {@link findContactIdsByDataOwnerPatientOpeningDate} instead.\n */\n findByHCPartyPatientSecretFKeys(\n hcPartyId: string,\n secretFKeys: string,\n planOfActionIds?: string,\n skipClosedContacts?: boolean\n ): Promise<Array<models.Contact>> {\n return super\n .findByHCPartyPatientSecretFKeys(hcPartyId, secretFKeys, planOfActionIds, skipClosedContacts)\n .then((contacts) => this.decrypt(hcPartyId, contacts))\n }\n\n /**\n * @deprecated use {@link findContactIdsByDataOwnerPatientOpeningDate} instead.\n */\n findByHCPartyPatientSecretFKeysArray(\n hcPartyId: string,\n secretFKeys: string[],\n planOfActionIds?: string,\n skipClosedContacts?: boolean\n ): Promise<Array<models.Contact> | any> {\n return super\n .findByHCPartyPatientSecretFKeysUsingPost(hcPartyId, planOfActionIds, skipClosedContacts, secretFKeys)\n .then((contacts) => this.decrypt(hcPartyId, contacts))\n }\n\n filterByWithUser(\n user: models.User,\n startDocumentId?: string,\n limit?: number,\n body?: models.FilterChainContact\n ): Promise<PaginatedListContact | any> {\n return super\n .filterContactsBy(startDocumentId, limit, body)\n .then((ctcs) =>\n this.decrypt(user.healthcarePartyId! || user.patientId!, ctcs.rows!).then((decryptedRows) => Object.assign(ctcs, { rows: decryptedRows }))\n )\n }\n\n listContactsByOpeningDateWithUser(\n user: models.User,\n startDate: number,\n endDate: number,\n hcpartyid: string,\n startKey?: string,\n startDocumentId?: string,\n limit?: number\n ): Promise<PaginatedListContact | any> {\n return super\n .listContactsByOpeningDate(startDate, endDate, hcpartyid, startKey, startDocumentId, limit)\n .then((ctcs) =>\n this.decrypt(user.healthcarePartyId! || user.patientId!, ctcs.rows!).then((decryptedRows) => Object.assign(ctcs, { rows: decryptedRows }))\n )\n }\n\n getServiceWithUser(user: models.User, serviceId: string): Promise<Service> {\n return super\n .getService(serviceId)\n .then((service) => this.decryptServices(user.healthcarePartyId ?? user.patientId ?? user.deviceId!, [service]))\n .then((decrypted) => decrypted[0])\n }\n\n listServicesWithUser(user: models.User, serviceIds: ListOfIds): Promise<Array<Service> | any> {\n return super\n .filterServicesBy(undefined, serviceIds.ids?.length, new FilterChainService({ filter: new ServiceByIdsFilter({ ids: serviceIds.ids }) }))\n .then((paginatedList) => this.decryptServices(user.healthcarePartyId ?? user.patientId ?? user.deviceId!, paginatedList.rows ?? []))\n }\n\n findByHCPartyFormIdWithUser(user: models.User, hcPartyId: string, formId: string): Promise<Array<models.Contact> | any> {\n return super.findByHCPartyFormId(hcPartyId, formId).then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n }\n\n findByHCPartyFormIdsWithUser(user: models.User, hcPartyId: string, body: models.ListOfIds): Promise<Array<models.Contact> | any> {\n return super.findByHCPartyFormIds(hcPartyId, body).then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n }\n\n getContactWithUser(user: models.User, contactId: string): Promise<models.Contact> {\n return super\n .getContact(contactId)\n .then((ctc) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, [ctc]))\n .then((ctcs) => ctcs[0])\n }\n\n getContactsWithUser(user: models.User, body?: models.ListOfIds): Promise<Array<models.Contact> | any> {\n return super.getContacts(body).then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n }\n\n async modifyContactWithUser(user: models.User, body?: models.Contact): Promise<models.Contact | any> {\n return body ? this.modifyContactAs(this.dataOwnerApi.getDataOwnerIdOf(user)!, body) : null\n }\n\n private modifyContactAs(dataOwner: string, body: models.Contact): Promise<models.Contact> {\n return this.encryptAs(dataOwner, [_.cloneDeep(body)])\n .then((ctcs) => super.modifyContact(ctcs[0]))\n .then((ctc) => this.decrypt(dataOwner, [ctc]))\n .then((ctcs) => ctcs[0])\n }\n\n async modifyContactsWithUser(user: models.User, bodies?: Array<models.Contact>): Promise<models.Contact[] | any> {\n return bodies\n ? this.encrypt(\n user,\n bodies.map((c) => _.cloneDeep(c))\n )\n .then((ctcs) => super.modifyContacts(ctcs))\n .then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n : null\n }\n\n async createContactWithUser(user: models.User, body?: models.Contact): Promise<models.Contact | null> {\n return body\n ? this.encrypt(user, [_.cloneDeep(body)])\n .then((ctcs) => super.createContact(ctcs[0]))\n .then((ctc) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, [ctc]))\n .then((ctcs) => ctcs[0])\n : null\n }\n\n async createContactsWithUser(user: models.User, bodies?: Array<models.Contact>): Promise<models.Contact[] | null> {\n return bodies\n ? this.encrypt(\n user,\n bodies.map((c) => _.cloneDeep(c))\n )\n .then((ctcs) => super.createContacts(ctcs))\n .then((ctcs) => this.decrypt(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs))\n : null\n }\n\n encryptServices(key: CryptoKey, rawKey: string, services: Service[]): PromiseLike<Service[]> {\n return Promise.all(\n services.map(async (svc) => {\n if (\n svc.content &&\n Object.values(svc.content).every(\n (c) =>\n c.compoundValue &&\n !c.stringValue &&\n !c.documentId &&\n !c.measureValue &&\n !c.medicationValue &&\n (c.booleanValue === null || c.booleanValue === undefined) &&\n (c.numberValue === null || c.numberValue === undefined) &&\n !c.instantValue &&\n !c.fuzzyDateValue &&\n !c.binaryValue\n )\n ) {\n const recursivelyEncryptedContent = Object.fromEntries(\n await Promise.all(\n Object.entries(svc.content).map(async (p) => {\n if (p[1].compoundValue?.length) {\n return [p[0], { ...p[1], compoundValue: await this.encryptServices(key, rawKey, p[1].compoundValue!) }]\n } else return p\n })\n )\n )\n const copyWithEncryptedContent = { ...svc, content: recursivelyEncryptedContent }\n return this.serviceEncryptedFieldsNoContent\n ? encryptObject(\n copyWithEncryptedContent,\n (obj) => {\n return this.crypto.primitives.AES.encrypt(key, utf8_2ua(JSON.stringify(obj)), rawKey)\n },\n this.serviceEncryptedFieldsNoContent,\n 'service'\n )\n : copyWithEncryptedContent\n } else {\n return encryptObject(\n svc,\n (obj) => {\n return this.crypto.primitives.AES.encrypt(key, utf8_2ua(JSON.stringify(obj)), rawKey)\n },\n this.serviceEncryptedFieldsWithContent,\n 'service'\n )\n }\n })\n )\n }\n\n encrypt(user: models.User, ctcs: Array<models.Contact>) {\n return this.encryptAs(this.dataOwnerApi.getDataOwnerIdOf(user)!, ctcs)\n }\n\n private async encryptAs(hcpartyId: string, ctcs: Array<models.Contact>): Promise<models.Contact[]> {\n const initializedContacts: models.Contact[] = []\n for (const ctc of ctcs) {\n initializedContacts.push((await this.crypto.xapi.ensureEncryptionKeysInitialised(ctc, EntityWithDelegationTypeName.Contact)) ?? ctc)\n }\n const allEncrypted = await this.crypto.xapi.doManyIncrementallyDecryptingKeys(\n initializedContacts,\n EntityWithDelegationTypeName.Contact,\n async (entity, t, keys) => {\n for (const k of keys) {\n try {\n const encrypted = new Contact(\n await encryptObject(\n {\n ...entity,\n services: entity.services ? await this.encryptServices(k.key, k.raw, entity.services) : [],\n },\n (obj) => {\n return this.crypto.primitives.AES.encrypt(k.key, utf8_2ua(JSON.stringify(obj)), k.raw)\n },\n this.contactEncryptedFields,\n EntityWithDelegationTypeName.Contact\n )\n )\n return { success: encrypted }\n } catch (e) {\n console.warn(`Failed to encrypt contact ${entity.id} with key ${k.raw}`)\n }\n }\n return null\n }\n )\n if (ctcs.length != allEncrypted.size) {\n throw new Error(`Couldn't encrypt contacts ${ctcs.flatMap((e) => (allEncrypted.has(e.id!) ? [] : [e.id!]))}`)\n }\n return ctcs.map((e) => allEncrypted.get(e.id!)!)\n }\n\n async decrypt(hcpartyId: string, ctcs: Array<models.Contact>): Promise<Array<models.Contact>> {\n return (await this.crypto.xapi.tryDecryptEntities(ctcs, EntityWithDelegationTypeName.Contact, (x) => new Contact(x))).map(({ entity }) => entity)\n }\n\n async decryptServices(hcpartyId: string, svcs: Array<models.Service>): Promise<Array<models.Service>> {\n /*TODO\n * not super efficient, re-decrypts the encryption key metadata of services multiple times, but should mostly rely\n * on cached exchange data after the first decryption and should not do any extra requests to the db.\n * We could ensure to use only cached exchange data by doing limited-size batches of services from the same contact\n * id.\n */\n return (await this.crypto.xapi.tryDecryptEntities(svcs, EntityWithDelegationTypeName.Contact, (x) => new Service(x))).map(({ entity }) => entity)\n }\n\n contactOfService(ctcs: Array<models.Contact>, svcId: string): models.Contact | undefined {\n let latestContact: models.Contact | undefined = undefined\n let latestService: models.Service\n ctcs.forEach((c) => {\n const s: models.Service | undefined = c.services!.find((it) => svcId === it.id)\n if (s && (!latestService || moment(s.valueDate).isAfter(moment(latestService.valueDate)))) {\n latestContact = c\n latestService = s\n }\n })\n return latestContact\n }\n\n filteredServices(ctcs: Array<models.Contact>, filter: any): Array<models.Service> {\n const byIds: { [key: string]: models.Service } = {}\n ctcs.forEach((c) =>\n (c.services || [])\n .filter((s) => filter(s, c))\n .forEach((s) => {\n const ps = byIds[s.id!]\n if (!ps || !ps.modified || (s.modified && ps.modified < s.modified)) {\n byIds[s.id!] = s\n s.contactId = c.id\n }\n })\n )\n return _.values(byIds).filter((s: any) => !s.deleted && !s.endOfLife)\n }\n\n //Return a promise\n filterServices(ctcs: Array<models.Contact>, filter: any): Promise<Array<models.Service>> {\n return Promise.resolve(this.filteredServices(ctcs, filter))\n }\n\n services(ctc: models.Contact, label: string) {\n return ctc.services!.filter((s) => s.label === label)\n }\n\n preferredContent(svc: models.Service, lng: string) {\n return (\n svc && svc.content && (svc.content[lng] || svc.content['fr'] || (Object.keys(svc.content)[0] ? svc.content[Object.keys(svc.content)[0]] : null))\n )\n }\n\n contentValue(c: models.Content) {\n return (\n c.stringValue ||\n ((c.numberValue || c.numberValue === 0) && c.numberValue) ||\n (c.measureValue && (c.measureValue.value || c.measureValue.value === 0) ? c.measureValue : null) ||\n c.medicationValue ||\n c.booleanValue\n )\n }\n\n shortServiceDescription(svc: models.Service, lng: string) {\n const c = this.preferredContent(svc, lng)\n return !c ? '' : this.shortContentDescription(c, lng, svc.label)\n }\n\n shortContentDescription(c: models.Content, lng: string, label?: string) {\n return (\n c.stringValue ||\n ((c.numberValue || c.numberValue === 0) && c.numberValue) ||\n (c.measureValue &&\n '' +\n (c.measureValue.value || c.measureValue.value === 0 ? c.measureValue.value : '-') +\n (c.measureValue.unit ? ' ' + c.measureValue.unit : '')) ||\n (c.medicationValue ? this.medication().medicationToString(c.medicationValue, lng) : null) ||\n (c.booleanValue && label) ||\n 'OK'\n )\n }\n\n medicationValue(svc: models.Service, lng: string) {\n const c =\n svc && svc.content && (svc.content[lng] || svc.content['fr'] || (Object.keys(svc.content)[0] ? svc.content[Object.keys(svc.content)[0]] : null))\n return c && c.medicationValue\n }\n\n contentHasData(c: any): boolean {\n return c.stringValue || c.numberValue || c.measureValue || c.booleanValue || c.booleanValue === false || c.medicationValue || c.documentId\n }\n\n localize(e: any, lng: string) {\n if (!e) {\n return null\n }\n return e[lng] || e.fr || e.FR || e.en || e.EN || e.nl || e.NL\n }\n\n /**\n * Modifies the subcontacts this svc belongs to while minimizing the number of references to the svcs inside the subcontacts\n * After the invocation, there is at least one subcontact with provided poaId and heId that contains the svc\n * The svc is not removed from a previous subcontact it would belong to except if the new conditions are compatible\n * Note that undefined and null do not have the same meaning for formId\n * If formId is null: the subcontact which refers svc must have a null formId\n * If formId is undefined, the subcontact can have any value for formId\n *\n * When a svc does not exist yet in the current contact but exists in a previous contact, all the scs it was belonging to are\n * copied in the current contact\n *\n * the svc returned is the one that's inside the ctc\n *\n * @param ctc\n * @param user\n * @param ctcs\n * @param svc\n * @param formId\n * @param poaId aMap {heId2: [poaId11, poaId12], heId2: [poaId21] }\n * @param heId an Array of heIds, equivalent to poaIds = {heId: [], ...}\n * @param init\n * @returns {*}\n */\n\n promoteServiceInContact(\n ctc: models.Contact,\n user: models.User,\n ctcs: Array<models.Contact>,\n svc: models.Service,\n formId: string,\n poaIds?: { [key: string]: string[] },\n heIds?: Array<string>,\n init?: any\n ) {\n if (!ctc) {\n return null\n }\n const existing = ctc.services!.find((s) => s.id === svc.id)\n const promoted = _.extend(_.extend(existing || {}, svc), {\n author: user.id,\n responsible: this.dataOwnerApi.getDataOwnerIdOf(user),\n modified: new Date().getTime(),\n })\n if (!existing) {\n ;(ctc.services || (ctc.services = [])).push(promoted)\n }\n const allSubcontactsInCurrentContactContainingService = (ctc.subContacts || []).filter((csc) =>\n (csc.services || []).some((s) => s.serviceId === svc.id)\n )\n\n //Rearrange poaIds and heIds as a hierarchy\n const hierarchyOfHeAndPoaIds: { [key: string]: Array<any> } = {}\n ;(heIds || []).forEach((id) => (hierarchyOfHeAndPoaIds[id || '_'] = []))\n Object.keys(poaIds || {}).forEach((k: string) => {\n const poas = hierarchyOfHeAndPoaIds[k]\n if (poas) {\n hierarchyOfHeAndPoaIds[k] = _.concat(poas, (poaIds || {})[k])\n } else {\n hierarchyOfHeAndPoaIds[k] = (poaIds || {})[k]\n }\n })\n\n const pastCtc =\n (svc.contactId && svc.contactId !== ctc.id && ctcs.find((c) => c.id === svc.contactId)) ||\n ctcs.reduce(\n (selected: { s: models.Service | null; c: models.Contact | null }, c: models.Contact) => {\n const candidate = (c.services || []).find((s) => s.id === svc.id)\n return ctc.id !== c.id && candidate && (selected.s === null || before(selected.s.modified || 0, candidate.modified || 0))\n ? { s: candidate, c: c }\n : selected\n },\n { s: null, c: null }\n ).c\n //Make sure that all scs the svc was belonging to are copied inside the current contact\n pastCtc &&\n pastCtc\n .subContacts!.filter((psc) => psc.services!.some((s) => s.serviceId === svc.id))\n .forEach((psc) => {\n const sameInCurrent = allSubcontactsInCurrentContactContainingService.find(\n (csc) => csc.formId === psc.formId && csc.planOfActionId === psc.planOfActionId && csc.healthElementId === psc.healthElementId\n )\n if (sameInCurrent) {\n if (!sameInCurrent.services!.some((s) => s.serviceId === svc.id)) {\n sameInCurrent.services!.push({ serviceId: svc.id })\n }\n } else {\n const newSubContact = _.assign(_.assign({}, psc), {\n services: [{ serviceId: svc.id }],\n })\n ctc.subContacts!.push(newSubContact)\n allSubcontactsInCurrentContactContainingService.push(newSubContact)\n }\n })\n\n if (!Object.keys(hierarchyOfHeAndPoaIds).length) {\n hierarchyOfHeAndPoaIds._ = [] //Default is to have at least one option with heId equals to null (represented by _)\n }\n\n Object.keys(hierarchyOfHeAndPoaIds).forEach((heId: string | null) => {\n if (heId === '_') {\n heId = null\n }\n const subPoaIds = heId ? hierarchyOfHeAndPoaIds[heId] : []\n ;((subPoaIds || []).length ? subPoaIds : [null]).forEach((poaId) => {\n //Create or assign subcontacts for all pairs he/poa (can be null/null)\n let destinationSubcontact = ctc.subContacts!.find(\n (sc) =>\n (!formId || sc.formId === formId) &&\n ((!poaId && !sc.planOfActionId) || sc.planOfActionId === poaId) &&\n ((!heId && !sc.healthElementId) || sc.healthElementId === heId)\n )\n if (!destinationSubcontact) {\n ctc.subContacts!.push(\n (destinationSubcontact = new models.SubContact({\n formId: formId || undefined,\n planOfActionId: poaId,\n healthElementId: heId,\n services: [],\n }))\n )\n }\n\n const redundantSubcontact =\n allSubcontactsInCurrentContactContainingService.find((aSc) => destinationSubcontact === aSc) ||\n allSubcontactsInCurrentContactContainingService.find(\n (aSc) =>\n (!aSc.planOfActionId || aSc.planOfActionId === destinationSubcontact!.planOfActionId) &&\n (!aSc.healthElementId || aSc.healthElementId === destinationSubcontact!.healthElementId) &&\n (!aSc.formId || aSc.formId === destinationSubcontact!.formId)\n ) // Find a compatible sc: one that does not contain extra and ≠ information than the destination\n\n if (redundantSubcontact && redundantSubcontact !== destinationSubcontact) {\n redundantSubcontact.services!.splice(\n redundantSubcontact.services!.findIndex((link) => link.serviceId === svc.id),\n 1\n )\n }\n if (!destinationSubcontact.services!.some((s) => s.serviceId === svc.id)) {\n destinationSubcontact.services!.push({ serviceId: svc.id! })\n }\n })\n })\n\n return (init && init(promoted)) || promoted\n }\n\n isNumeric(svc: models.Service, lng: string) {\n const c = this.preferredContent(svc, lng)\n return c && (c.measureValue || c.numberValue || c.numberValue == 0)\n }\n\n service() {\n return {\n newInstance: (user: models.User, s: any) =>\n _.extend(\n {\n id: this.crypto.primitives.randomUuid(),\n _type: 'org.taktik.icure.entities.embed.Service',\n created: new Date().getTime(),\n modified: new Date().getTime(),\n responsible: s?.responsible ?? (this.autofillAuthor ? this.dataOwnerApi.getDataOwnerIdOf(user) : undefined),\n author: s?.author ?? (this.autofillAuthor ? user.id : undefined),\n codes: [],\n tags: [],\n content: {},\n valueDate: parseInt(moment().format('YYYYMMDDHHmmss')),\n },\n s\n ),\n }\n }\n\n medication() {\n const regimenScores: any = {\n afterwakingup: 63000,\n beforebreakfast: 70000,\n duringbreakfast: 80000,\n afterbreakfast: 90000,\n morning: 100000,\n betweenbreakfastandlunch: 103000,\n beforelunch: 113000,\n midday: 120000,\n duringlunch: 123000,\n afterlunch: 130000,\n afternoon: 140000,\n betweenlunchanddinner: 160000,\n beforedinner: 180000,\n duringdinner: 190000,\n afterdinner: 200000,\n evening: 210000,\n betweendinnerandsleep: 213000,\n thehourofsleep: 220000,\n night: 230000,\n beforemeals: -30000,\n betweenmeals: -20000,\n aftermeals: -10000,\n }\n\n const myself = {\n regimenScores: function () {\n return regimenScores\n },\n medicationNameToString: function (m: any): string {\n return m && m.compoundPrescription\n ? m.compoundPrescription\n : m && m.substanceProduct\n ? myself.productToString(m && m.substanceProduct)\n : myself.productToString(m && m.medicinalProduct)\n },\n reimbursementReasonToString: (m: any, lang: string) => {\n return m && m.reimbursementReason && m.reimbursementReason.label && m.reimbursementReason.label.hasOwnProperty(lang)\n ? m.reimbursementReason.label[lang]\n : ''\n },\n medicationToString: (m: any, lang: string) => {\n let res = `${myself.medicationNameToString(m)}, ${myself.posologyToString(m, lang)}`\n const reason = myself.reimbursementReasonToString(m, lang)\n res = m.numberOfPackages\n ? `${m.numberOfPackages} ${m.numberOfPackages > 1 ? this.i18n[lang].packagesOf : this.i18n[lang].packageOf} ${res}`\n : res\n res = m.duration ? `${res} ${this.i18n[lang].during} ${myself.durationToString(m.duration, lang)}` : res\n res = reason ? `${res} (${reason})` : res\n return res\n },\n productToString: (m: any): string => {\n if (!m) {\n return ''\n }\n return m.intendedname\n },\n posologyToString: (m: any, lang: string) => {\n if (m) {\n if (m.instructionForPatient && m.instructionForPatient.length) {\n return m.instructionForPatient\n }\n if (!m.regimen || !m.regimen.length) {\n return ''\n }\n\n const unit =\n m.regimen[0].administratedQuantity && m.regimen[0].administratedQuantity.administrationUnit\n ? m.regimen[0].administratedQuantity.administrationUnit.code\n : m.regimen[0].administratedQuantity && m.regimen[0].administratedQuantity.unit\n let quantity = m.regimen[0].administratedQuantity && m.regimen[0].administratedQuantity.quantity\n\n m.regimen.slice(1).find((ri: any) => {\n const oUnit =\n ri.administratedQuantity && ri.administratedQuantity.administrationUnit\n ? ri.administratedQuantity.administrationUnit.code\n : ri.administratedQuantity && ri.administratedQuantity.unit\n const oQuantity = ri.administratedQuantity && ri.administratedQuantity.quantity\n\n if (oQuantity !== quantity) {\n quantity = -1\n }\n return oUnit !== unit && oQuantity !== quantity\n })\n\n const cplxRegimen = !unit || quantity < 0\n const quantityUnit = cplxRegimen ? `1 ${this.i18n[lang].take_s_}` : `${quantity} ${unit || this.i18n[lang].take_s_}`\n\n const dayPeriod = m.regimen.find((r: any) => r.weekday !== null && r.weekday !== undefined)\n ? this.i18n[lang].weekly\n : m.regimen.find((r: any) => r.date)\n ? this.i18n[lang].monthly\n : this.i18n[lang].daily\n\n return `${quantityUnit}, ${m.regimen.length} x ${dayPeriod}, ${_.sortBy(\n m.regimen,\n (r) =>\n (r.date ? r.date * 1000000 : 29990000000000) +\n (r.dayNumber || 0) * 1000000 +\n ((r.weekday && r.weekday.weekNumber) || 0) * 7 * 1000000 +\n (r.timeOfDay ? r.timeOfDay : r.dayPeriod && r.dayPeriod.code ? (regimenScores[r.dayPeriod.code] as number) : 0)\n )\n .map((r) => (cplxRegimen ? myself.regimenToExtString(r, lang) : myself.regimenToString(r, lang)))\n .join(', ')}`\n }\n },\n frequencyToString: (m: any, lang: string) => {\n if (m.instructionForPatient && m.instructionForPatient.length) {\n return m.instructionForPatient\n }\n if (!m.regimen || !m.regimen.length) {\n return ''\n }\n\n const dayPeriod = m.regimen.find((r: any) => r.weekday !== null && r.weekday !== undefined)\n ? this.i18n[lang].weekly\n : m.regimen.find((r: any) => r.date)\n ? this.i18n[lang].monthly\n : this.i18n[lang].daily\n\n return `${m.regimen.length} x ${dayPeriod}`\n },\n durationToString: (d: models.Duration, lang: string) => {\n return d.value ? `${d.value} ${this.localize(d.unit!.label, lang)}` : ''\n },\n regimenToExtString: (r: models.RegimenItem, lang: string) => {\n const desc = myself.regimenToString(r, lang)\n return (\n (r.administratedQuantity && r.administratedQuantity.quantity && desc\n ? `${desc} (${r.administratedQuantity.quantity} ${\n (r.administratedQuantity.administrationUnit ? r.administratedQuantity.administrationUnit.code : r.administratedQuantity.unit) ||\n this.i18n[lang].take_s_\n })`\n : desc) || ''\n )\n },\n regimenToString: (r: models.RegimenItem, lang: string) => {\n let res = r.date\n ? `${this.i18n[lang].the} ${moment(r.date).format('DD/MM/YYYY')}`\n : r.dayNumber\n ? `${this.i18n[lang].onDay} ${r.dayNumber}`\n : r.weekday && r.weekday.weekday\n ? `${this.i18n[lang].on} ${r.weekday.weekday}`\n : null\n if (r.dayPeriod && r.dayPeriod.code && r.dayPeriod.code.length) {\n res = res\n ? `${res} ${this.i18n[lang][r.dayPeriod.code] || this.localize(r.dayPeriod.label, lang) || r.dayPeriod.code}`\n : this.i18n[lang][r.dayPeriod.code] || this.localize(r.dayPeriod.label, lang) || r.dayPeriod.code\n }\n if (r.timeOfDay) {\n const timeOfDay =\n r.timeOfDay === 120000\n ? this.i18n[lang].noon\n : `${Math.floor(r.timeOfDay / 10000)}:${('' + (Math.floor(r.timeOfDay / 100) % 100)).replace(/^(.)$/, '0$1')}`\n res = res ? res + ' ' + this.i18n[lang].at + ' ' + timeOfDay : timeOfDay\n }\n return res\n },\n localize: (s: any, lang: string) => {\n if (!s) {\n return s\n }\n return (\n this.i18n[lang][s] ||\n (this.i18n[lang][s.toLowerCase()] &&\n this.i18n[lang][s.toLowerCase()]\n .split('')\n .map((c: string, idx: number) => (idx >= s.length || s[idx].toLocaleLowerCase() === s[idx] ? c : c.toLocaleUpperCase()))\n .join('')) ||\n s\n ) //Applies the (lower/upper)case to the translated lowercase version of the input string (s)\n },\n }\n return myself\n }\n\n /**\n * @param contact a contact\n * @return the id of the patient that the contact refers to, retrieved from the encrypted metadata. Normally there should only be one element\n * in the returned array, but in case of entity merges there could be multiple values.\n */\n async decryptPatientIdOf(contact: models.Contact): Promise<string[]> {\n return this.crypto.xapi.owningEntityIdsOf({ entity: contact, type: EntityWithDelegationTypeName.Contact }, undefined)\n }\n\n /**\n * @return if the logged data owner has write access to the content of the given contact\n */\n async hasWriteAccess(contact: models.Contact): Promise<boolean> {\n return this.crypto.xapi.hasWriteAccess({ entity: contact, type: EntityWithDelegationTypeName.Contact })\n }\n\n /**\n * Share an existing contact with other data owners, allowing them to access the non-encrypted data of the contact and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param delegateId the id of the data owner which will be granted access to the contact.\n * @param contact the contact to share.\n * @param options optional parameters to customize the sharing behaviour:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * contact does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this contact refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWith(\n delegateId: string,\n contact: models.Contact,\n options: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n } = {}\n ): Promise<models.Contact> {\n return this.shareWithMany(contact, { [delegateId]: options })\n }\n\n /**\n * Share an existing contact with other data owners, allowing them to access the non-encrypted data of the contact and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param contact the contact to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * contact does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this contact refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return the updated entity\n */\n async shareWithMany(\n contact: models.Contact,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<models.Contact> {\n return (await this.tryShareWithMany(contact, delegates)).updatedEntityOrThrow\n }\n\n /**\n * Share an existing contact with other data owners, allowing them to access the non-encrypted data of the contact and optionally also\n * the encrypted content, with read-only or read-write permissions.\n * @param contact the contact to share.\n * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:\n * - shareSecretIds: specifies which secret ids of the entity should be shared. If not provided all secret ids available to the current user will be shared\n * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted\n * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a\n * contact does not have encrypted content.\n * - sharePatientId: specifies if the id of the patient that this contact refers to should be shared with the delegate (defaults to\n * {@link ShareMetadataBehaviour.IF_AVAILABLE}).\n * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.\n * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if\n * the operation failed.\n */\n async tryShareWithMany(\n contact: models.Contact,\n delegates: {\n [delegateId: string]: {\n shareSecretIds?: string[]\n requestedPermissions?: RequestedPermissionEnum\n shareEncryptionKey?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n sharePatientId?: ShareMetadataBehaviour // Defaults to ShareMetadataBehaviour.IF_AVAILABLE\n }\n }\n ): Promise<ShareResult<models.Contact>> {\n const self = await this.dataOwnerApi.getCurrentDataOwnerId()\n // All entities should have an encryption key.\n const entityWithEncryptionKey = await this.crypto.xapi.ensureEncryptionKeysInitialised(contact, EntityWithDelegationTypeName.Contact)\n const updatedEntity = entityWithEncryptionKey ? await this.modifyContactAs(self, entityWithEncryptionKey) : contact\n return this.crypto.xapi\n .simpleShareOrUpdateEncryptedEntityMetadata(\n {\n entity: updatedEntity,\n type: EntityWithDelegationTypeName.Contact,\n },\n Object.fromEntries(\n Object.entries(delegates).map(([delegateId, options]) => [\n delegateId,\n {\n requestedPermissions: options.requestedPermissions,\n shareEncryptionKeys: options.shareEncryptionKey,\n shareOwningEntityIds: options.sharePatientId,\n shareSecretIds: options.shareSecretIds,\n },\n ])\n ),\n (x) => this.bulkShareContacts(x)\n )\n .then((r) => r.mapSuccessAsync((e) => this.decrypt(self, [e]).then((es) => es[0])))\n }\n\n getDataOwnersWithAccessTo(\n entity: models.Contact\n ): Promise<{ permissionsByDataOwnerId: { [p: string]: AccessLevelEnum }; hasUnknownAnonymousDataOwners: boolean }> {\n return this.crypto.delegationsDeAnonymization.getDataOwnersWithAccessTo({ entity, type: EntityWithDelegationTypeName.Contact })\n }\n\n getEncryptionKeysOf(entity: models.Contact): Promise<string[]> {\n return this.crypto.xapi.encryptionKeysOf({ entity, type: EntityWithDelegationTypeName.Contact }, undefined)\n }\n\n async subscribeToServiceEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<Service> | undefined,\n eventFired: (dataSample: Service) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n const currentUser = await this.userApi.getCurrentUser()\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n 'Service',\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted: Service) => (await this.decryptServices(currentUser.healthcarePartyId!, [encrypted]))[0]\n ).then((ws) => new ConnectionImpl(ws))\n }\n\n async subscribeToContactEvents(\n eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[],\n filter: AbstractFilter<Contact> | undefined,\n eventFired: (dataSample: Contact) => Promise<void>,\n options: SubscriptionOptions = {}\n ): Promise<Connection> {\n const currentUser = await this.userApi.getCurrentUser()\n return subscribeToEntityEvents(\n this.host,\n this.authApi,\n EntityWithDelegationTypeName.Contact,\n eventTypes,\n filter,\n eventFired,\n options,\n async (encrypted: Contact) => (await this.decrypt(currentUser.healthcarePartyId!, [encrypted]))[0]\n ).then((ws) => new ConnectionImpl(ws))\n }\n\n createDelegationDeAnonymizationMetadata(entity: Contact, delegates: string[]): Promise<void> {\n return this.crypto.delegationsDeAnonymization.createOrUpdateDeAnonymizationInfo({ entity, type: EntityWithDelegationTypeName.Contact }, delegates)\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icure/api",
3
- "version": "8.4.5",
3
+ "version": "8.4.6",
4
4
  "description": "Typescript version of iCure standalone API client",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",