@precisa-saude/fhir 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LYDCZW4C.cjs → chunk-D6XKCRS2.cjs} +3 -3
- package/dist/{chunk-LYDCZW4C.cjs.map → chunk-D6XKCRS2.cjs.map} +1 -1
- package/dist/{chunk-YXYGKTVB.js → chunk-GTKRPCZB.js} +2 -2
- package/dist/{chunk-ZYSD6A2K.cjs → chunk-MJ254F5K.cjs} +440 -2
- package/dist/chunk-MJ254F5K.cjs.map +1 -0
- package/dist/{chunk-4KGWSF55.js → chunk-N6J26FVW.js} +2 -2
- package/dist/{chunk-CPZ7YNON.cjs → chunk-PJJVDGX4.cjs} +4 -4
- package/dist/{chunk-CPZ7YNON.cjs.map → chunk-PJJVDGX4.cjs.map} +1 -1
- package/dist/chunk-R4MUCMO3.js +917 -0
- package/dist/chunk-R4MUCMO3.js.map +1 -0
- package/dist/cli.js +425 -1
- package/dist/converter.cjs +3 -3
- package/dist/converter.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.js +3 -3
- package/dist/reference-ranges.cjs +3 -3
- package/dist/reference-ranges.js +2 -2
- package/dist/units.cjs +2 -2
- package/dist/units.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-R25V2E6S.js +0 -479
- package/dist/chunk-R25V2E6S.js.map +0 -1
- package/dist/chunk-ZYSD6A2K.cjs.map +0 -1
- /package/dist/{chunk-YXYGKTVB.js.map → chunk-GTKRPCZB.js.map} +0 -0
- /package/dist/{chunk-4KGWSF55.js.map → chunk-N6J26FVW.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
labReportToFHIR,
|
|
4
4
|
labResultToFHIRBundle,
|
|
5
5
|
userProfileToFHIR
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N6J26FVW.js";
|
|
7
7
|
import {
|
|
8
8
|
MAX_FILE_SIZE,
|
|
9
9
|
MAX_OBSERVATIONS,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
getFallbackReferenceRange,
|
|
52
52
|
getRangeDirection,
|
|
53
53
|
getReferenceRange
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-GTKRPCZB.js";
|
|
55
55
|
import {
|
|
56
56
|
BIOMARKER_DEFAULT_UNIT,
|
|
57
57
|
BIOMARKER_UNITS,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
getDefaultUnit,
|
|
62
62
|
getSIUnit,
|
|
63
63
|
unitToUCUM
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-R4MUCMO3.js";
|
|
65
65
|
import {
|
|
66
66
|
validateFHIRDiagnosticReport,
|
|
67
67
|
validateFHIRImportBundle,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
8
|
+
var _chunkD6XKCRS2cjs = require('./chunk-D6XKCRS2.cjs');
|
|
9
|
+
require('./chunk-MJ254F5K.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -14,5 +14,5 @@ require('./chunk-ZYSD6A2K.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.applyFallbackReferenceRanges =
|
|
17
|
+
exports.applyFallbackReferenceRanges = _chunkD6XKCRS2cjs.applyFallbackReferenceRanges; exports.biomarkerRangeDefinitions = _chunkD6XKCRS2cjs.biomarkerRangeDefinitions; exports.defaultReferenceRanges = _chunkD6XKCRS2cjs.defaultReferenceRanges; exports.getFallbackReferenceRange = _chunkD6XKCRS2cjs.getFallbackReferenceRange; exports.getRangeDirection = _chunkD6XKCRS2cjs.getRangeDirection; exports.getReferenceRange = _chunkD6XKCRS2cjs.getReferenceRange;
|
|
18
18
|
//# sourceMappingURL=reference-ranges.cjs.map
|
package/dist/reference-ranges.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
getFallbackReferenceRange,
|
|
6
6
|
getRangeDirection,
|
|
7
7
|
getReferenceRange
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-GTKRPCZB.js";
|
|
9
|
+
import "./chunk-R4MUCMO3.js";
|
|
10
10
|
export {
|
|
11
11
|
applyFallbackReferenceRanges,
|
|
12
12
|
biomarkerRangeDefinitions,
|
package/dist/units.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkMJ254F5Kcjs = require('./chunk-MJ254F5K.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -17,5 +17,5 @@ var _chunkZYSD6A2Kcjs = require('./chunk-ZYSD6A2K.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.BIOMARKER_DEFAULT_UNIT =
|
|
20
|
+
exports.BIOMARKER_DEFAULT_UNIT = _chunkMJ254F5Kcjs.BIOMARKER_DEFAULT_UNIT; exports.BIOMARKER_UNITS = _chunkMJ254F5Kcjs.BIOMARKER_UNITS; exports.UNIT_TO_UCUM = _chunkMJ254F5Kcjs.UNIT_TO_UCUM; exports.convertUnit = _chunkMJ254F5Kcjs.convertUnit; exports.getCanonicalUnit = _chunkMJ254F5Kcjs.getCanonicalUnit; exports.getDefaultUnit = _chunkMJ254F5Kcjs.getDefaultUnit; exports.getSIUnit = _chunkMJ254F5Kcjs.getSIUnit; exports.unitToUCUM = _chunkMJ254F5Kcjs.unitToUCUM;
|
|
21
21
|
//# sourceMappingURL=units.cjs.map
|
package/dist/units.js
CHANGED
package/package.json
CHANGED
package/dist/chunk-R25V2E6S.js
DELETED
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
// src/units.ts
|
|
2
|
-
var UNIT_TO_UCUM = {
|
|
3
|
-
// Dimensionless / special measurements
|
|
4
|
-
"[pH]": "[pH]",
|
|
5
|
-
"{ratio}": "{ratio}",
|
|
6
|
-
"{specific gravity}": "{specific gravity}",
|
|
7
|
-
"/\xB5L": "/uL",
|
|
8
|
-
// Percentage
|
|
9
|
-
"%": "%",
|
|
10
|
-
// Count units
|
|
11
|
-
"10\xB3/\xB5L": "10*3/uL",
|
|
12
|
-
"10\u2076/\xB5L": "10*6/uL",
|
|
13
|
-
// Volume
|
|
14
|
-
fL: "fL",
|
|
15
|
-
g: "g",
|
|
16
|
-
// Mass concentration
|
|
17
|
-
"g/dL": "g/dL",
|
|
18
|
-
L: "L",
|
|
19
|
-
// Molar concentration
|
|
20
|
-
"mEq/L": "meq/L",
|
|
21
|
-
mg: "mg",
|
|
22
|
-
"mg/dL": "mg/dL",
|
|
23
|
-
mL: "mL",
|
|
24
|
-
"mmol/L": "mmol/L",
|
|
25
|
-
"mUI/mL": "m[IU]/mL",
|
|
26
|
-
ng: "ng",
|
|
27
|
-
"ng/dL": "ng/dL",
|
|
28
|
-
"ng/mL": "ng/mL",
|
|
29
|
-
"nmol/L": "nmol/L",
|
|
30
|
-
// Mass
|
|
31
|
-
pg: "pg",
|
|
32
|
-
"pg/mL": "pg/mL",
|
|
33
|
-
pH: "[pH]",
|
|
34
|
-
// Enzyme activity
|
|
35
|
-
"U/L": "U/L",
|
|
36
|
-
// Special units
|
|
37
|
-
"U/mL": "U/mL",
|
|
38
|
-
"UI/L": "[IU]/L",
|
|
39
|
-
"UI/mL": "[IU]/mL",
|
|
40
|
-
\u00B5g: "ug",
|
|
41
|
-
"\xB5g/dL": "ug/dL",
|
|
42
|
-
"\xB5mol/L": "umol/L",
|
|
43
|
-
"\xB5UI/mL": "u[IU]/mL"
|
|
44
|
-
};
|
|
45
|
-
var BIOMARKER_DEFAULT_UNIT = {
|
|
46
|
-
// Proteins
|
|
47
|
-
Albumin: "g/dL",
|
|
48
|
-
AlkalinePhosphatase: "U/L",
|
|
49
|
-
// Liver
|
|
50
|
-
ALT: "U/L",
|
|
51
|
-
AST: "U/L",
|
|
52
|
-
Calcium: "mg/dL",
|
|
53
|
-
Chloride: "mEq/L",
|
|
54
|
-
// Lipids
|
|
55
|
-
Cholesterol: "mg/dL",
|
|
56
|
-
// Kidney
|
|
57
|
-
Creatinine: "mg/dL",
|
|
58
|
-
eAG: "mg/dL",
|
|
59
|
-
Ferritin: "ng/mL",
|
|
60
|
-
FolicAcid: "ng/mL",
|
|
61
|
-
GGT: "U/L",
|
|
62
|
-
// Glucose/Diabetes
|
|
63
|
-
Glucose: "mg/dL",
|
|
64
|
-
HbA1c: "%",
|
|
65
|
-
Hct: "%",
|
|
66
|
-
HDL: "mg/dL",
|
|
67
|
-
// Hematology
|
|
68
|
-
Hgb: "g/dL",
|
|
69
|
-
Insulin: "\xB5UI/mL",
|
|
70
|
-
// Iron studies
|
|
71
|
-
Iron: "\xB5g/dL",
|
|
72
|
-
LDL: "mg/dL",
|
|
73
|
-
Magnesium: "mg/dL",
|
|
74
|
-
NonHDL_Cholesterol: "mg/dL",
|
|
75
|
-
// Urinalysis - dimensionless
|
|
76
|
-
pH_Urine: "[pH]",
|
|
77
|
-
Potassium: "mEq/L",
|
|
78
|
-
RDW: "%",
|
|
79
|
-
// Electrolytes
|
|
80
|
-
Sodium: "mEq/L",
|
|
81
|
-
SpecificGravity_Urine: "{specific gravity}",
|
|
82
|
-
T3Free: "pg/mL",
|
|
83
|
-
T4Free: "ng/dL",
|
|
84
|
-
TIBC: "\xB5g/dL",
|
|
85
|
-
TotalProtein: "g/dL",
|
|
86
|
-
TransferrinSaturation: "%",
|
|
87
|
-
Triglycerides: "mg/dL",
|
|
88
|
-
// Thyroid
|
|
89
|
-
TSH: "\xB5UI/mL",
|
|
90
|
-
Urea: "mg/dL",
|
|
91
|
-
UricAcid: "mg/dL",
|
|
92
|
-
// Vitamins
|
|
93
|
-
VitaminB12: "pg/mL",
|
|
94
|
-
VitaminD: "ng/mL",
|
|
95
|
-
VLDL: "mg/dL"
|
|
96
|
-
};
|
|
97
|
-
function unitToUCUM(unit) {
|
|
98
|
-
return UNIT_TO_UCUM[unit] || unit;
|
|
99
|
-
}
|
|
100
|
-
function getDefaultUnit(biomarkerCode) {
|
|
101
|
-
return BIOMARKER_DEFAULT_UNIT[biomarkerCode] || "";
|
|
102
|
-
}
|
|
103
|
-
var CBC_DIFF_ALIASES = {
|
|
104
|
-
"/ul": "/uL",
|
|
105
|
-
"/\xB5l": "/uL",
|
|
106
|
-
"10*3/ul": "K/uL",
|
|
107
|
-
"cells/ul": "/uL",
|
|
108
|
-
"cells/\xB5l": "/uL",
|
|
109
|
-
"k/ul": "K/uL",
|
|
110
|
-
"x10e3/ul": "K/uL"
|
|
111
|
-
};
|
|
112
|
-
var CBC_DIFF = {
|
|
113
|
-
canonicalUcum: "10*3/uL",
|
|
114
|
-
canonicalUnit: "K/uL",
|
|
115
|
-
siUcum: "10*3/uL",
|
|
116
|
-
siUnit: "K/uL"
|
|
117
|
-
};
|
|
118
|
-
var DEXA_KG_ALIASES = {
|
|
119
|
-
kg: "kg",
|
|
120
|
-
lb: "[lb_av]",
|
|
121
|
-
lbs: "[lb_av]"
|
|
122
|
-
};
|
|
123
|
-
var DEXA_KG = {
|
|
124
|
-
canonicalUcum: "kg",
|
|
125
|
-
canonicalUnit: "kg",
|
|
126
|
-
siUcum: "kg",
|
|
127
|
-
siUnit: "kg"
|
|
128
|
-
};
|
|
129
|
-
var URINE_SEDIMENT_ALIASES = {
|
|
130
|
-
"/hpf": "/HPF",
|
|
131
|
-
"/ml": "/mL"
|
|
132
|
-
};
|
|
133
|
-
var URINE_SEDIMENT = {
|
|
134
|
-
canonicalUcum: "/[HPF]",
|
|
135
|
-
canonicalUnit: "/HPF",
|
|
136
|
-
siUcum: "/[HPF]",
|
|
137
|
-
siUnit: "/HPF"
|
|
138
|
-
};
|
|
139
|
-
var BIOMARKER_UNITS = {
|
|
140
|
-
Albumin: {
|
|
141
|
-
aliases: { "g/dl": "g/dL", "g/l": "g/L" },
|
|
142
|
-
canonicalUcum: "g/dL",
|
|
143
|
-
canonicalUnit: "g/dL",
|
|
144
|
-
siUcum: "g/L",
|
|
145
|
-
siUnit: "g/L"
|
|
146
|
-
},
|
|
147
|
-
AntiThyroglobulin: {
|
|
148
|
-
aliases: { "iu/ml": "IU/mL", "ui/ml": "IU/mL" },
|
|
149
|
-
canonicalUcum: "[iU]/mL",
|
|
150
|
-
canonicalUnit: "IU/mL",
|
|
151
|
-
siUcum: "[iU]/mL",
|
|
152
|
-
siUnit: "IU/mL"
|
|
153
|
-
},
|
|
154
|
-
Basophils_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },
|
|
155
|
-
BMC: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },
|
|
156
|
-
Cholesterol: {
|
|
157
|
-
aliases: { "mg/dl": "mg/dL", "mmol/l": "mmol/L" },
|
|
158
|
-
canonicalUcum: "mg/dL",
|
|
159
|
-
canonicalUnit: "mg/dL",
|
|
160
|
-
molecularWeight: 386.65,
|
|
161
|
-
siUcum: "mmol/L",
|
|
162
|
-
siUnit: "mmol/L"
|
|
163
|
-
},
|
|
164
|
-
Creatinine: {
|
|
165
|
-
aliases: { "mg/dl": "mg/dL", "umol/l": "\xB5mol/L", "\xB5mol/l": "\xB5mol/L" },
|
|
166
|
-
canonicalUcum: "mg/dL",
|
|
167
|
-
canonicalUnit: "mg/dL",
|
|
168
|
-
molecularWeight: 113.12,
|
|
169
|
-
siUcum: "umol/L",
|
|
170
|
-
siUnit: "\xB5mol/L"
|
|
171
|
-
},
|
|
172
|
-
CRP: {
|
|
173
|
-
aliases: { "mg/dl": "mg/dL", "mg/l": "mg/L" },
|
|
174
|
-
canonicalUcum: "mg/L",
|
|
175
|
-
canonicalUnit: "mg/L",
|
|
176
|
-
siUcum: "mg/L",
|
|
177
|
-
siUnit: "mg/L"
|
|
178
|
-
},
|
|
179
|
-
eGFR: {
|
|
180
|
-
aliases: {
|
|
181
|
-
"ml/min/1,73 m2": "mL/min/1.73m\xB2",
|
|
182
|
-
"ml/min/1.73m2": "mL/min/1.73m\xB2",
|
|
183
|
-
"ml/min/1.73m\xB2": "mL/min/1.73m\xB2"
|
|
184
|
-
},
|
|
185
|
-
canonicalUcum: "mL/min/{1.73_m2}",
|
|
186
|
-
canonicalUnit: "mL/min/1.73m\xB2",
|
|
187
|
-
siUcum: "mL/min/{1.73_m2}",
|
|
188
|
-
siUnit: "mL/min/1.73m\xB2"
|
|
189
|
-
},
|
|
190
|
-
Eosinophils_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },
|
|
191
|
-
Estradiol: {
|
|
192
|
-
aliases: { "ng/dl": "ng/dL", "pg/ml": "pg/mL" },
|
|
193
|
-
canonicalUcum: "pg/mL",
|
|
194
|
-
canonicalUnit: "pg/mL",
|
|
195
|
-
molecularWeight: 272.38,
|
|
196
|
-
siUcum: "pmol/L",
|
|
197
|
-
siUnit: "pmol/L"
|
|
198
|
-
},
|
|
199
|
-
FatFreeMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },
|
|
200
|
-
FatMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },
|
|
201
|
-
Ferritin: {
|
|
202
|
-
aliases: {
|
|
203
|
-
"mcg/l": "ng/mL",
|
|
204
|
-
"microg/l": "ng/mL",
|
|
205
|
-
"ng/ml": "ng/mL",
|
|
206
|
-
"\xB5g/l": "ng/mL"
|
|
207
|
-
},
|
|
208
|
-
canonicalUcum: "ng/mL",
|
|
209
|
-
canonicalUnit: "ng/mL",
|
|
210
|
-
siUcum: "ug/L",
|
|
211
|
-
siUnit: "\xB5g/L"
|
|
212
|
-
},
|
|
213
|
-
FSH: {
|
|
214
|
-
aliases: {
|
|
215
|
-
"iu/l": "mIU/mL",
|
|
216
|
-
"miu/ml": "mIU/mL",
|
|
217
|
-
"ui/l": "mIU/mL"
|
|
218
|
-
},
|
|
219
|
-
canonicalUcum: "mIU/mL",
|
|
220
|
-
canonicalUnit: "mIU/mL",
|
|
221
|
-
siUcum: "[iU]/L",
|
|
222
|
-
siUnit: "IU/L"
|
|
223
|
-
},
|
|
224
|
-
Glucose: {
|
|
225
|
-
aliases: { "mg/dl": "mg/dL", "mmol/l": "mmol/L" },
|
|
226
|
-
canonicalUcum: "mg/dL",
|
|
227
|
-
canonicalUnit: "mg/dL",
|
|
228
|
-
molecularWeight: 180.156,
|
|
229
|
-
siUcum: "mmol/L",
|
|
230
|
-
siUnit: "mmol/L"
|
|
231
|
-
},
|
|
232
|
-
HDL: {
|
|
233
|
-
aliases: { "mg/dl": "mg/dL", "mmol/l": "mmol/L" },
|
|
234
|
-
canonicalUcum: "mg/dL",
|
|
235
|
-
canonicalUnit: "mg/dL",
|
|
236
|
-
molecularWeight: 386.65,
|
|
237
|
-
siUcum: "mmol/L",
|
|
238
|
-
siUnit: "mmol/L"
|
|
239
|
-
},
|
|
240
|
-
Hgb: {
|
|
241
|
-
aliases: { "g/dl": "g/dL", "g/l": "g/L" },
|
|
242
|
-
canonicalUcum: "g/dL",
|
|
243
|
-
canonicalUnit: "g/dL",
|
|
244
|
-
siUcum: "g/L",
|
|
245
|
-
siUnit: "g/L"
|
|
246
|
-
},
|
|
247
|
-
Insulin: {
|
|
248
|
-
aliases: {
|
|
249
|
-
"mu/l": "uIU/mL",
|
|
250
|
-
"uiu/ml": "uIU/mL",
|
|
251
|
-
"\xB5u/ml": "uIU/mL",
|
|
252
|
-
"\xB5ui/ml": "uIU/mL"
|
|
253
|
-
},
|
|
254
|
-
canonicalUcum: "u[iU]/mL",
|
|
255
|
-
canonicalUnit: "uIU/mL",
|
|
256
|
-
siUcum: "pmol/L",
|
|
257
|
-
siUnit: "pmol/L"
|
|
258
|
-
},
|
|
259
|
-
Iron: {
|
|
260
|
-
aliases: {
|
|
261
|
-
"mcg/dl": "mcg/dL",
|
|
262
|
-
"microg/dl": "mcg/dL",
|
|
263
|
-
"ug/dl": "mcg/dL",
|
|
264
|
-
"\xB5g/dl": "mcg/dL"
|
|
265
|
-
},
|
|
266
|
-
canonicalUcum: "ug/dL",
|
|
267
|
-
canonicalUnit: "mcg/dL",
|
|
268
|
-
siUcum: "umol/L",
|
|
269
|
-
siUnit: "\xB5mol/L"
|
|
270
|
-
},
|
|
271
|
-
LDL: {
|
|
272
|
-
aliases: { "mg/dl": "mg/dL", "mmol/l": "mmol/L" },
|
|
273
|
-
canonicalUcum: "mg/dL",
|
|
274
|
-
canonicalUnit: "mg/dL",
|
|
275
|
-
molecularWeight: 386.65,
|
|
276
|
-
siUcum: "mmol/L",
|
|
277
|
-
siUnit: "mmol/L"
|
|
278
|
-
},
|
|
279
|
-
LDL_Peak_Size: {
|
|
280
|
-
aliases: { \u00E5: "Ao", angstrom: "Ao", ao: "Ao", nm: "nm" },
|
|
281
|
-
canonicalUcum: "Ao",
|
|
282
|
-
canonicalUnit: "Angstrom",
|
|
283
|
-
siUcum: "nm",
|
|
284
|
-
siUnit: "nm"
|
|
285
|
-
},
|
|
286
|
-
LeanMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },
|
|
287
|
-
Leukocytes_Urine: { aliases: URINE_SEDIMENT_ALIASES, ...URINE_SEDIMENT },
|
|
288
|
-
LH: {
|
|
289
|
-
aliases: {
|
|
290
|
-
"iu/l": "mIU/mL",
|
|
291
|
-
"miu/ml": "mIU/mL",
|
|
292
|
-
"ui/l": "mIU/mL"
|
|
293
|
-
},
|
|
294
|
-
canonicalUcum: "mIU/mL",
|
|
295
|
-
canonicalUnit: "mIU/mL",
|
|
296
|
-
siUcum: "[iU]/L",
|
|
297
|
-
siUnit: "IU/L"
|
|
298
|
-
},
|
|
299
|
-
Lipoprotein_a: {
|
|
300
|
-
aliases: { "mg/dl": "mg/dL", "nmol/l": "nmol/L" },
|
|
301
|
-
canonicalUcum: "nmol/L",
|
|
302
|
-
canonicalUnit: "nmol/L",
|
|
303
|
-
siUcum: "nmol/L",
|
|
304
|
-
siUnit: "nmol/L"
|
|
305
|
-
},
|
|
306
|
-
Lymphocytes_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },
|
|
307
|
-
MCHC: {
|
|
308
|
-
aliases: { "g/dl": "g/dL", "g/l": "g/L" },
|
|
309
|
-
canonicalUcum: "g/dL",
|
|
310
|
-
canonicalUnit: "g/dL",
|
|
311
|
-
siUcum: "g/L",
|
|
312
|
-
siUnit: "g/L"
|
|
313
|
-
},
|
|
314
|
-
Monocytes_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },
|
|
315
|
-
Neutrophils_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },
|
|
316
|
-
Platelets: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },
|
|
317
|
-
Prolactin: {
|
|
318
|
-
aliases: {
|
|
319
|
-
"microg/l": "ng/mL",
|
|
320
|
-
"ng/ml": "ng/mL",
|
|
321
|
-
"\xB5g/l": "ng/mL"
|
|
322
|
-
},
|
|
323
|
-
canonicalUcum: "ng/mL",
|
|
324
|
-
canonicalUnit: "ng/mL",
|
|
325
|
-
siUcum: "ug/L",
|
|
326
|
-
siUnit: "\xB5g/L"
|
|
327
|
-
},
|
|
328
|
-
RBC: {
|
|
329
|
-
aliases: {
|
|
330
|
-
"/ul": "/uL",
|
|
331
|
-
"/\xB5l": "/uL",
|
|
332
|
-
"10*6/ul": "M/uL",
|
|
333
|
-
"cells/ul": "/uL",
|
|
334
|
-
"m/ul": "M/uL",
|
|
335
|
-
"milh\xF5es/mm3": "M/uL",
|
|
336
|
-
"milh\xF5es/mm\xB3": "M/uL",
|
|
337
|
-
"x10e6/ul": "M/uL"
|
|
338
|
-
},
|
|
339
|
-
canonicalUcum: "10*6/uL",
|
|
340
|
-
canonicalUnit: "M/uL",
|
|
341
|
-
siUcum: "10*6/uL",
|
|
342
|
-
siUnit: "M/uL"
|
|
343
|
-
},
|
|
344
|
-
RBC_Urine: { aliases: URINE_SEDIMENT_ALIASES, ...URINE_SEDIMENT },
|
|
345
|
-
TestosteroneFree: {
|
|
346
|
-
aliases: { "pg/ml": "pg/mL", "pmol/l": "pmol/L" },
|
|
347
|
-
canonicalUcum: "pg/mL",
|
|
348
|
-
canonicalUnit: "pg/mL",
|
|
349
|
-
molecularWeight: 288.42,
|
|
350
|
-
siUcum: "pmol/L",
|
|
351
|
-
siUnit: "pmol/L"
|
|
352
|
-
},
|
|
353
|
-
TIBC: {
|
|
354
|
-
aliases: {
|
|
355
|
-
"mcg/dl": "mcg/dL",
|
|
356
|
-
"microg/dl": "mcg/dL",
|
|
357
|
-
"ug/dl": "mcg/dL",
|
|
358
|
-
"\xB5g/dl": "mcg/dL"
|
|
359
|
-
},
|
|
360
|
-
canonicalUcum: "ug/dL",
|
|
361
|
-
canonicalUnit: "mcg/dL",
|
|
362
|
-
siUcum: "umol/L",
|
|
363
|
-
siUnit: "\xB5mol/L"
|
|
364
|
-
},
|
|
365
|
-
TotalMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },
|
|
366
|
-
Triglycerides: {
|
|
367
|
-
aliases: { "mg/dl": "mg/dL", "mmol/l": "mmol/L" },
|
|
368
|
-
canonicalUcum: "mg/dL",
|
|
369
|
-
canonicalUnit: "mg/dL",
|
|
370
|
-
molecularWeight: 885.4,
|
|
371
|
-
siUcum: "mmol/L",
|
|
372
|
-
siUnit: "mmol/L"
|
|
373
|
-
},
|
|
374
|
-
TSH: {
|
|
375
|
-
aliases: {
|
|
376
|
-
"miu/l": "uIU/mL",
|
|
377
|
-
"mui/l": "uIU/mL",
|
|
378
|
-
"uiu/ml": "uIU/mL",
|
|
379
|
-
"\xB5ui/ml": "uIU/mL"
|
|
380
|
-
},
|
|
381
|
-
canonicalUcum: "u[iU]/mL",
|
|
382
|
-
canonicalUnit: "uIU/mL",
|
|
383
|
-
siUcum: "mIU/L",
|
|
384
|
-
siUnit: "mIU/L"
|
|
385
|
-
},
|
|
386
|
-
Urea: {
|
|
387
|
-
aliases: { "mg/dl": "mg/dL", "mmol/l": "mmol/L" },
|
|
388
|
-
canonicalUcum: "mg/dL",
|
|
389
|
-
canonicalUnit: "mg/dL",
|
|
390
|
-
molecularWeight: 60.06,
|
|
391
|
-
siUcum: "mmol/L",
|
|
392
|
-
siUnit: "mmol/L"
|
|
393
|
-
},
|
|
394
|
-
VATMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },
|
|
395
|
-
VATVolume: {
|
|
396
|
-
aliases: { cm3: "cm3", "cm\xB3": "cm3", in3: "[in_i]3", "in\xB3": "[in_i]3" },
|
|
397
|
-
canonicalUcum: "cm3",
|
|
398
|
-
canonicalUnit: "cm\xB3",
|
|
399
|
-
siUcum: "cm3",
|
|
400
|
-
siUnit: "cm\xB3"
|
|
401
|
-
},
|
|
402
|
-
VitaminB12: {
|
|
403
|
-
aliases: { "ng/l": "pg/mL", "pg/ml": "pg/mL" },
|
|
404
|
-
canonicalUcum: "pg/mL",
|
|
405
|
-
canonicalUnit: "pg/mL",
|
|
406
|
-
siUcum: "pmol/L",
|
|
407
|
-
siUnit: "pmol/L"
|
|
408
|
-
},
|
|
409
|
-
VitaminD: {
|
|
410
|
-
aliases: { "ng/ml": "ng/mL", "nmol/l": "nmol/L" },
|
|
411
|
-
canonicalUcum: "ng/mL",
|
|
412
|
-
canonicalUnit: "ng/mL",
|
|
413
|
-
molecularWeight: 384.64,
|
|
414
|
-
siUcum: "nmol/L",
|
|
415
|
-
siUnit: "nmol/L"
|
|
416
|
-
},
|
|
417
|
-
WBC: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF }
|
|
418
|
-
};
|
|
419
|
-
function getCanonicalUnit(code) {
|
|
420
|
-
return BIOMARKER_UNITS[code]?.canonicalUnit ?? null;
|
|
421
|
-
}
|
|
422
|
-
function getSIUnit(code) {
|
|
423
|
-
return BIOMARKER_UNITS[code]?.siUnit ?? null;
|
|
424
|
-
}
|
|
425
|
-
function normalizeUnit(unit, config) {
|
|
426
|
-
return config.aliases[unit.toLowerCase()] ?? config.aliases[unit] ?? unit;
|
|
427
|
-
}
|
|
428
|
-
var FIXED_FACTORS = {
|
|
429
|
-
"g/dL -> g/L": 10,
|
|
430
|
-
"g/L -> g/dL": 0.1,
|
|
431
|
-
"ng/dL -> pg/mL": 10,
|
|
432
|
-
"ng/mL -> \xB5g/L": 1,
|
|
433
|
-
"pg/mL -> ng/dL": 0.1,
|
|
434
|
-
"\xB5g/L -> ng/mL": 1
|
|
435
|
-
};
|
|
436
|
-
var MW_CONVERSIONS = {
|
|
437
|
-
"mg/dL -> mmol/L": { divideByMW: true, scale: 10 },
|
|
438
|
-
"mg/dL -> \xB5mol/L": { divideByMW: true, scale: 1e4 },
|
|
439
|
-
"mmol/L -> mg/dL": { divideByMW: false, scale: 10 },
|
|
440
|
-
"ng/dL -> nmol/L": { divideByMW: true, scale: 10 },
|
|
441
|
-
"ng/mL -> nmol/L": { divideByMW: true, scale: 1e3 },
|
|
442
|
-
"nmol/L -> ng/dL": { divideByMW: false, scale: 10 },
|
|
443
|
-
"nmol/L -> ng/mL": { divideByMW: false, scale: 1e3 },
|
|
444
|
-
"pg/mL -> pmol/L": { divideByMW: true, scale: 1e3 },
|
|
445
|
-
"pmol/L -> pg/mL": { divideByMW: false, scale: 1e3 },
|
|
446
|
-
"\xB5mol/L -> mg/dL": { divideByMW: false, scale: 1e4 }
|
|
447
|
-
};
|
|
448
|
-
function convertUnit(value, fromUnit, toUnit, biomarkerCode) {
|
|
449
|
-
const config = BIOMARKER_UNITS[biomarkerCode];
|
|
450
|
-
if (!config) return null;
|
|
451
|
-
const normFrom = normalizeUnit(fromUnit, config);
|
|
452
|
-
const normTo = normalizeUnit(toUnit, config);
|
|
453
|
-
if (normFrom === normTo) {
|
|
454
|
-
return { unit: normTo, value };
|
|
455
|
-
}
|
|
456
|
-
const key = `${normFrom} -> ${normTo}`;
|
|
457
|
-
const fixedFactor = FIXED_FACTORS[key];
|
|
458
|
-
if (fixedFactor !== void 0) {
|
|
459
|
-
return { unit: normTo, value: value * fixedFactor };
|
|
460
|
-
}
|
|
461
|
-
const mwConv = MW_CONVERSIONS[key];
|
|
462
|
-
if (mwConv && config.molecularWeight) {
|
|
463
|
-
const result = mwConv.divideByMW ? value * mwConv.scale / config.molecularWeight : value * config.molecularWeight / mwConv.scale;
|
|
464
|
-
return { unit: normTo, value: result };
|
|
465
|
-
}
|
|
466
|
-
return null;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
export {
|
|
470
|
-
UNIT_TO_UCUM,
|
|
471
|
-
BIOMARKER_DEFAULT_UNIT,
|
|
472
|
-
unitToUCUM,
|
|
473
|
-
getDefaultUnit,
|
|
474
|
-
BIOMARKER_UNITS,
|
|
475
|
-
getCanonicalUnit,
|
|
476
|
-
getSIUnit,
|
|
477
|
-
convertUnit
|
|
478
|
-
};
|
|
479
|
-
//# sourceMappingURL=chunk-R25V2E6S.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/units.ts"],"sourcesContent":["/**\n * Unit Mappings and Biomarker Unit Definitions\n *\n * Maps units to UCUM format, provides default units for biomarkers,\n * and defines canonical/SI unit configurations with aliases.\n */\n\n// ─── UCUM Mappings ───────────────────────────────────────────────────────────\n\n/**\n * Map units to UCUM (Unified Code for Units of Measure)\n * See: https://ucum.org/\n */\nexport const UNIT_TO_UCUM: Record<string, string> = {\n // Dimensionless / special measurements\n '[pH]': '[pH]',\n '{ratio}': '{ratio}',\n '{specific gravity}': '{specific gravity}',\n\n '/µL': '/uL',\n // Percentage\n '%': '%',\n // Count units\n '10³/µL': '10*3/uL',\n '10⁶/µL': '10*6/uL',\n // Volume\n fL: 'fL',\n g: 'g',\n\n // Mass concentration\n 'g/dL': 'g/dL',\n L: 'L',\n // Molar concentration\n 'mEq/L': 'meq/L',\n\n mg: 'mg',\n 'mg/dL': 'mg/dL',\n mL: 'mL',\n 'mmol/L': 'mmol/L',\n 'mUI/mL': 'm[IU]/mL',\n\n ng: 'ng',\n\n 'ng/dL': 'ng/dL',\n 'ng/mL': 'ng/mL',\n 'nmol/L': 'nmol/L',\n // Mass\n pg: 'pg',\n\n 'pg/mL': 'pg/mL',\n pH: '[pH]',\n // Enzyme activity\n 'U/L': 'U/L',\n // Special units\n 'U/mL': 'U/mL',\n 'UI/L': '[IU]/L',\n\n 'UI/mL': '[IU]/mL',\n\n µg: 'ug',\n 'µg/dL': 'ug/dL',\n 'µmol/L': 'umol/L',\n 'µUI/mL': 'u[IU]/mL',\n};\n\n/**\n * Default units for biomarkers when source data doesn't provide one\n * These are the most common units used in Brazilian labs\n */\nexport const BIOMARKER_DEFAULT_UNIT: Record<string, string> = {\n // Proteins\n Albumin: 'g/dL',\n AlkalinePhosphatase: 'U/L',\n // Liver\n ALT: 'U/L',\n AST: 'U/L',\n\n Calcium: 'mg/dL',\n Chloride: 'mEq/L',\n // Lipids\n Cholesterol: 'mg/dL',\n // Kidney\n Creatinine: 'mg/dL',\n eAG: 'mg/dL',\n Ferritin: 'ng/mL',\n\n FolicAcid: 'ng/mL',\n GGT: 'U/L',\n // Glucose/Diabetes\n Glucose: 'mg/dL',\n\n HbA1c: '%',\n Hct: '%',\n\n HDL: 'mg/dL',\n // Hematology\n Hgb: 'g/dL',\n Insulin: 'µUI/mL',\n\n // Iron studies\n Iron: 'µg/dL',\n LDL: 'mg/dL',\n Magnesium: 'mg/dL',\n NonHDL_Cholesterol: 'mg/dL',\n\n // Urinalysis - dimensionless\n pH_Urine: '[pH]',\n Potassium: 'mEq/L',\n RDW: '%',\n // Electrolytes\n Sodium: 'mEq/L',\n SpecificGravity_Urine: '{specific gravity}',\n\n T3Free: 'pg/mL',\n T4Free: 'ng/dL',\n TIBC: 'µg/dL',\n TotalProtein: 'g/dL',\n\n TransferrinSaturation: '%',\n Triglycerides: 'mg/dL',\n // Thyroid\n TSH: 'µUI/mL',\n\n Urea: 'mg/dL',\n UricAcid: 'mg/dL',\n\n // Vitamins\n VitaminB12: 'pg/mL',\n VitaminD: 'ng/mL',\n VLDL: 'mg/dL',\n};\n\n/**\n * Convert unit to UCUM format\n */\nexport function unitToUCUM(unit: string): string {\n return UNIT_TO_UCUM[unit] || unit;\n}\n\n/**\n * Get default unit for a biomarker code\n * @param biomarkerCode - The biomarker code (e.g., \"Glucose\", \"HbA1c\")\n * @returns The default unit or empty string if not found\n */\nexport function getDefaultUnit(biomarkerCode: string): string {\n return BIOMARKER_DEFAULT_UNIT[biomarkerCode] || '';\n}\n\n// ─── Biomarker Unit Configurations ───────────────────────────────────────────\n\n/** Biomarker unit definitions — canonical units match reference-ranges.ts (BR conventional). */\n\nexport interface BiomarkerUnitConfig {\n aliases: Record<string, string>;\n canonicalUcum: string;\n canonicalUnit: string;\n molecularWeight?: number;\n siUcum: string;\n siUnit: string;\n}\n\nconst CBC_DIFF_ALIASES: Record<string, string> = {\n '/ul': '/uL',\n '/µl': '/uL',\n '10*3/ul': 'K/uL',\n 'cells/ul': '/uL',\n 'cells/µl': '/uL',\n 'k/ul': 'K/uL',\n 'x10e3/ul': 'K/uL',\n};\nconst CBC_DIFF: Omit<BiomarkerUnitConfig, 'aliases'> = {\n canonicalUcum: '10*3/uL',\n canonicalUnit: 'K/uL',\n siUcum: '10*3/uL',\n siUnit: 'K/uL',\n};\nconst DEXA_KG_ALIASES: Record<string, string> = {\n kg: 'kg',\n lb: '[lb_av]',\n lbs: '[lb_av]',\n};\nconst DEXA_KG: Omit<BiomarkerUnitConfig, 'aliases'> = {\n canonicalUcum: 'kg',\n canonicalUnit: 'kg',\n siUcum: 'kg',\n siUnit: 'kg',\n};\n\n/**\n * Urine sediment units — Brazilian automated analyzers (Sysmex UF-series)\n * report in /mL while manual microscopy uses /HPF. Canonical unit is /HPF.\n */\nconst URINE_SEDIMENT_ALIASES: Record<string, string> = {\n '/hpf': '/HPF',\n '/ml': '/mL',\n};\nconst URINE_SEDIMENT: Omit<BiomarkerUnitConfig, 'aliases'> = {\n canonicalUcum: '/[HPF]',\n canonicalUnit: '/HPF',\n siUcum: '/[HPF]',\n siUnit: '/HPF',\n};\n\nexport const BIOMARKER_UNITS: Record<string, BiomarkerUnitConfig> = {\n Albumin: {\n aliases: { 'g/dl': 'g/dL', 'g/l': 'g/L' },\n canonicalUcum: 'g/dL',\n canonicalUnit: 'g/dL',\n siUcum: 'g/L',\n siUnit: 'g/L',\n },\n AntiThyroglobulin: {\n aliases: { 'iu/ml': 'IU/mL', 'ui/ml': 'IU/mL' },\n canonicalUcum: '[iU]/mL',\n canonicalUnit: 'IU/mL',\n siUcum: '[iU]/mL',\n siUnit: 'IU/mL',\n },\n Basophils_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n BMC: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },\n Cholesterol: {\n aliases: { 'mg/dl': 'mg/dL', 'mmol/l': 'mmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 386.65,\n siUcum: 'mmol/L',\n siUnit: 'mmol/L',\n },\n Creatinine: {\n aliases: { 'mg/dl': 'mg/dL', 'umol/l': 'µmol/L', 'µmol/l': 'µmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 113.12,\n siUcum: 'umol/L',\n siUnit: 'µmol/L',\n },\n CRP: {\n aliases: { 'mg/dl': 'mg/dL', 'mg/l': 'mg/L' },\n canonicalUcum: 'mg/L',\n canonicalUnit: 'mg/L',\n siUcum: 'mg/L',\n siUnit: 'mg/L',\n },\n eGFR: {\n aliases: {\n 'ml/min/1,73 m2': 'mL/min/1.73m²',\n 'ml/min/1.73m2': 'mL/min/1.73m²',\n 'ml/min/1.73m²': 'mL/min/1.73m²',\n },\n canonicalUcum: 'mL/min/{1.73_m2}',\n canonicalUnit: 'mL/min/1.73m²',\n siUcum: 'mL/min/{1.73_m2}',\n siUnit: 'mL/min/1.73m²',\n },\n Eosinophils_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n Estradiol: {\n aliases: { 'ng/dl': 'ng/dL', 'pg/ml': 'pg/mL' },\n canonicalUcum: 'pg/mL',\n canonicalUnit: 'pg/mL',\n molecularWeight: 272.38,\n siUcum: 'pmol/L',\n siUnit: 'pmol/L',\n },\n FatFreeMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },\n FatMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },\n Ferritin: {\n aliases: {\n 'mcg/l': 'ng/mL',\n 'microg/l': 'ng/mL',\n 'ng/ml': 'ng/mL',\n 'µg/l': 'ng/mL',\n },\n canonicalUcum: 'ng/mL',\n canonicalUnit: 'ng/mL',\n siUcum: 'ug/L',\n siUnit: 'µg/L',\n },\n FSH: {\n aliases: {\n 'iu/l': 'mIU/mL',\n 'miu/ml': 'mIU/mL',\n 'ui/l': 'mIU/mL',\n },\n canonicalUcum: 'mIU/mL',\n canonicalUnit: 'mIU/mL',\n siUcum: '[iU]/L',\n siUnit: 'IU/L',\n },\n Glucose: {\n aliases: { 'mg/dl': 'mg/dL', 'mmol/l': 'mmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 180.156,\n siUcum: 'mmol/L',\n siUnit: 'mmol/L',\n },\n HDL: {\n aliases: { 'mg/dl': 'mg/dL', 'mmol/l': 'mmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 386.65,\n siUcum: 'mmol/L',\n siUnit: 'mmol/L',\n },\n Hgb: {\n aliases: { 'g/dl': 'g/dL', 'g/l': 'g/L' },\n canonicalUcum: 'g/dL',\n canonicalUnit: 'g/dL',\n siUcum: 'g/L',\n siUnit: 'g/L',\n },\n Insulin: {\n aliases: {\n 'mu/l': 'uIU/mL',\n 'uiu/ml': 'uIU/mL',\n 'µu/ml': 'uIU/mL',\n 'µui/ml': 'uIU/mL',\n },\n canonicalUcum: 'u[iU]/mL',\n canonicalUnit: 'uIU/mL',\n siUcum: 'pmol/L',\n siUnit: 'pmol/L',\n },\n Iron: {\n aliases: {\n 'mcg/dl': 'mcg/dL',\n 'microg/dl': 'mcg/dL',\n 'ug/dl': 'mcg/dL',\n 'µg/dl': 'mcg/dL',\n },\n canonicalUcum: 'ug/dL',\n canonicalUnit: 'mcg/dL',\n siUcum: 'umol/L',\n siUnit: 'µmol/L',\n },\n LDL: {\n aliases: { 'mg/dl': 'mg/dL', 'mmol/l': 'mmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 386.65,\n siUcum: 'mmol/L',\n siUnit: 'mmol/L',\n },\n LDL_Peak_Size: {\n aliases: { å: 'Ao', angstrom: 'Ao', ao: 'Ao', nm: 'nm' },\n canonicalUcum: 'Ao',\n canonicalUnit: 'Angstrom',\n siUcum: 'nm',\n siUnit: 'nm',\n },\n LeanMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },\n Leukocytes_Urine: { aliases: URINE_SEDIMENT_ALIASES, ...URINE_SEDIMENT },\n LH: {\n aliases: {\n 'iu/l': 'mIU/mL',\n 'miu/ml': 'mIU/mL',\n 'ui/l': 'mIU/mL',\n },\n canonicalUcum: 'mIU/mL',\n canonicalUnit: 'mIU/mL',\n siUcum: '[iU]/L',\n siUnit: 'IU/L',\n },\n Lipoprotein_a: {\n aliases: { 'mg/dl': 'mg/dL', 'nmol/l': 'nmol/L' },\n canonicalUcum: 'nmol/L',\n canonicalUnit: 'nmol/L',\n siUcum: 'nmol/L',\n siUnit: 'nmol/L',\n },\n Lymphocytes_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n MCHC: {\n aliases: { 'g/dl': 'g/dL', 'g/l': 'g/L' },\n canonicalUcum: 'g/dL',\n canonicalUnit: 'g/dL',\n siUcum: 'g/L',\n siUnit: 'g/L',\n },\n Monocytes_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n Neutrophils_Abs: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n Platelets: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n Prolactin: {\n aliases: {\n 'microg/l': 'ng/mL',\n 'ng/ml': 'ng/mL',\n 'µg/l': 'ng/mL',\n },\n canonicalUcum: 'ng/mL',\n canonicalUnit: 'ng/mL',\n siUcum: 'ug/L',\n siUnit: 'µg/L',\n },\n RBC: {\n aliases: {\n '/ul': '/uL',\n '/µl': '/uL',\n '10*6/ul': 'M/uL',\n 'cells/ul': '/uL',\n 'm/ul': 'M/uL',\n 'milhões/mm3': 'M/uL',\n 'milhões/mm³': 'M/uL',\n 'x10e6/ul': 'M/uL',\n },\n canonicalUcum: '10*6/uL',\n canonicalUnit: 'M/uL',\n siUcum: '10*6/uL',\n siUnit: 'M/uL',\n },\n RBC_Urine: { aliases: URINE_SEDIMENT_ALIASES, ...URINE_SEDIMENT },\n TestosteroneFree: {\n aliases: { 'pg/ml': 'pg/mL', 'pmol/l': 'pmol/L' },\n canonicalUcum: 'pg/mL',\n canonicalUnit: 'pg/mL',\n molecularWeight: 288.42,\n siUcum: 'pmol/L',\n siUnit: 'pmol/L',\n },\n TIBC: {\n aliases: {\n 'mcg/dl': 'mcg/dL',\n 'microg/dl': 'mcg/dL',\n 'ug/dl': 'mcg/dL',\n 'µg/dl': 'mcg/dL',\n },\n canonicalUcum: 'ug/dL',\n canonicalUnit: 'mcg/dL',\n siUcum: 'umol/L',\n siUnit: 'µmol/L',\n },\n TotalMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },\n Triglycerides: {\n aliases: { 'mg/dl': 'mg/dL', 'mmol/l': 'mmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 885.4,\n siUcum: 'mmol/L',\n siUnit: 'mmol/L',\n },\n TSH: {\n aliases: {\n 'miu/l': 'uIU/mL',\n 'mui/l': 'uIU/mL',\n 'uiu/ml': 'uIU/mL',\n 'µui/ml': 'uIU/mL',\n },\n canonicalUcum: 'u[iU]/mL',\n canonicalUnit: 'uIU/mL',\n siUcum: 'mIU/L',\n siUnit: 'mIU/L',\n },\n Urea: {\n aliases: { 'mg/dl': 'mg/dL', 'mmol/l': 'mmol/L' },\n canonicalUcum: 'mg/dL',\n canonicalUnit: 'mg/dL',\n molecularWeight: 60.06,\n siUcum: 'mmol/L',\n siUnit: 'mmol/L',\n },\n VATMass: { aliases: DEXA_KG_ALIASES, ...DEXA_KG },\n VATVolume: {\n aliases: { cm3: 'cm3', 'cm³': 'cm3', in3: '[in_i]3', 'in³': '[in_i]3' },\n canonicalUcum: 'cm3',\n canonicalUnit: 'cm³',\n siUcum: 'cm3',\n siUnit: 'cm³',\n },\n VitaminB12: {\n aliases: { 'ng/l': 'pg/mL', 'pg/ml': 'pg/mL' },\n canonicalUcum: 'pg/mL',\n canonicalUnit: 'pg/mL',\n siUcum: 'pmol/L',\n siUnit: 'pmol/L',\n },\n VitaminD: {\n aliases: { 'ng/ml': 'ng/mL', 'nmol/l': 'nmol/L' },\n canonicalUcum: 'ng/mL',\n canonicalUnit: 'ng/mL',\n molecularWeight: 384.64,\n siUcum: 'nmol/L',\n siUnit: 'nmol/L',\n },\n WBC: { aliases: CBC_DIFF_ALIASES, ...CBC_DIFF },\n};\n\n/**\n * Get the canonical unit for a biomarker code.\n */\nexport function getCanonicalUnit(code: string): string | null {\n return BIOMARKER_UNITS[code]?.canonicalUnit ?? null;\n}\n\n/**\n * Get the SI unit for a biomarker code.\n */\nexport function getSIUnit(code: string): string | null {\n return BIOMARKER_UNITS[code]?.siUnit ?? null;\n}\n\n// ─── Unit Conversion ────────────────────────────────────────────────────────────\n\n/**\n * Normalize a unit string to its canonical display form for a given biomarker.\n * Returns the input unchanged if no alias is found.\n */\nfunction normalizeUnit(unit: string, config: BiomarkerUnitConfig): string {\n return config.aliases[unit.toLowerCase()] ?? config.aliases[unit] ?? unit;\n}\n\n/**\n * Conversion factor tables for unit pairs that don't require molecular weight.\n * Key format: \"fromUnit -> toUnit\" (using canonical display forms).\n * Both directions must be listed explicitly — there is no auto-inversion.\n */\nconst FIXED_FACTORS: Record<string, number> = {\n 'g/dL -> g/L': 10,\n 'g/L -> g/dL': 0.1,\n 'ng/dL -> pg/mL': 10,\n 'ng/mL -> µg/L': 1,\n 'pg/mL -> ng/dL': 0.1,\n 'µg/L -> ng/mL': 1,\n};\n\n/**\n * MW-based conversion definitions.\n * Each entry maps a (fromUnit, toUnit) pair to the formula:\n * result = value × numerator / (MW × denominator)\n *\n * Common patterns:\n * mg/dL → mmol/L: value × 10 / MW\n * mg/dL → µmol/L: value × 10000 / MW (or equivalently × 10 / MW × 1000)\n * ng/mL → nmol/L: value × 1000 / MW\n * pg/mL → pmol/L: value × 1000 / MW\n * ng/dL → nmol/L: value × 10 / MW\n */\n/**\n * MW conversion entries. Each direction is explicit to avoid fragile inversion logic.\n * Formula: result = value × scale / MW (when divideByMW is true)\n * result = value × MW / scale (when divideByMW is false)\n */\ninterface MWConversion {\n divideByMW: boolean;\n scale: number;\n}\n\nconst MW_CONVERSIONS: Record<string, MWConversion> = {\n 'mg/dL -> mmol/L': { divideByMW: true, scale: 10 },\n 'mg/dL -> µmol/L': { divideByMW: true, scale: 10_000 },\n 'mmol/L -> mg/dL': { divideByMW: false, scale: 10 },\n 'ng/dL -> nmol/L': { divideByMW: true, scale: 10 },\n 'ng/mL -> nmol/L': { divideByMW: true, scale: 1000 },\n 'nmol/L -> ng/dL': { divideByMW: false, scale: 10 },\n 'nmol/L -> ng/mL': { divideByMW: false, scale: 1000 },\n 'pg/mL -> pmol/L': { divideByMW: true, scale: 1000 },\n 'pmol/L -> pg/mL': { divideByMW: false, scale: 1000 },\n 'µmol/L -> mg/dL': { divideByMW: false, scale: 10_000 },\n};\n\nexport interface ConversionResult {\n unit: string;\n value: number;\n}\n\n/**\n * Convert a biomarker value between units.\n *\n * Supports:\n * - Fixed-factor conversions (e.g. ng/dL ↔ pg/mL, g/dL ↔ g/L)\n * - Molecular-weight-based conversions (e.g. mg/dL ↔ mmol/L, pg/mL ↔ pmol/L)\n *\n * @returns The converted value and target unit, or null if conversion is not possible.\n */\nexport function convertUnit(\n value: number,\n fromUnit: string,\n toUnit: string,\n biomarkerCode: string,\n): ConversionResult | null {\n const config = BIOMARKER_UNITS[biomarkerCode];\n if (!config) return null;\n\n const normFrom = normalizeUnit(fromUnit, config);\n const normTo = normalizeUnit(toUnit, config);\n\n if (normFrom === normTo) {\n return { unit: normTo, value };\n }\n\n const key = `${normFrom} -> ${normTo}`;\n\n const fixedFactor = FIXED_FACTORS[key];\n if (fixedFactor !== undefined) {\n return { unit: normTo, value: value * fixedFactor };\n }\n\n const mwConv = MW_CONVERSIONS[key];\n if (mwConv && config.molecularWeight) {\n const result = mwConv.divideByMW\n ? (value * mwConv.scale) / config.molecularWeight\n : (value * config.molecularWeight) / mwConv.scale;\n return { unit: normTo, value: result };\n }\n\n return null;\n}\n"],"mappings":";AAaO,IAAM,eAAuC;AAAA;AAAA,EAElD,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,sBAAsB;AAAA,EAEtB,UAAO;AAAA;AAAA,EAEP,KAAK;AAAA;AAAA,EAEL,gBAAU;AAAA,EACV,kBAAU;AAAA;AAAA,EAEV,IAAI;AAAA,EACJ,GAAG;AAAA;AAAA,EAGH,QAAQ;AAAA,EACR,GAAG;AAAA;AAAA,EAEH,SAAS;AAAA,EAET,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,UAAU;AAAA,EACV,UAAU;AAAA,EAEV,IAAI;AAAA,EAEJ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA;AAAA,EAEV,IAAI;AAAA,EAEJ,SAAS;AAAA,EACT,IAAI;AAAA;AAAA,EAEJ,OAAO;AAAA;AAAA,EAEP,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,SAAS;AAAA,EAET,SAAI;AAAA,EACJ,YAAS;AAAA,EACT,aAAU;AAAA,EACV,aAAU;AACZ;AAMO,IAAM,yBAAiD;AAAA;AAAA,EAE5D,SAAS;AAAA,EACT,qBAAqB;AAAA;AAAA,EAErB,KAAK;AAAA,EACL,KAAK;AAAA,EAEL,SAAS;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